Page MenuHomeSoftware Heritage

Several refactorings
ClosedPublic

Authored by douardda on Apr 10 2019, 12:29 PM.

Details

Summary

Mostly:

  • deploy entrypoint.sh files at exec time instead of copying them all in the image,
  • install python packages as swh user in a venv to make it easier to work with overloaded installation from sources (less caveats with file permissions),
  • set /srv/softwareheritahe as swh's HOME
  • and put every file in there (shell scripts, etc)

Depends on D1393

Diff Detail

Repository
rCDFD Dockerfiles for developers
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

douardda created this revision.Apr 10 2019, 12:29 PM

Instead of entrypoint: /entrypoint.sh for each service in docker-compose.yml, what about adding a RUN /entrypoint.sh in the Dockerfile?

Dockerfile
55

/srv is usually for data, not code. Maybe /opt or /usr/local instead?

services/swh-web/entrypoint.sh
17 ↗(On Diff #4490)

why || true?

Instead of entrypoint: /entrypoint.sh for each service in docker-compose.yml, what about adding a RUN /entrypoint.sh in the Dockerfile?

We tried but that did not work as the /entrypoint.sh is not yet mounted.
Touching the file first fails as well as then docker will reasonably refuse to mount the volume on an existing file.

olasd added a subscriber: olasd.Apr 10 2019, 1:11 PM

Instead of entrypoint: /entrypoint.sh for each service in docker-compose.yml, what about adding a RUN /entrypoint.sh in the Dockerfile?

Already tested by David, and that doesn't work; On the intertubes I find people having the same issue and it looks like entrypoints set inside an image can't be overridden by a mount, something about a cache effect.

services/swh-web/entrypoint.sh
17 ↗(On Diff #4490)

Because that command isn't idempotent (it fails when the admin user already exists, which prevents the container from coming up)

anlambert accepted this revision.Apr 10 2019, 2:35 PM
anlambert added a subscriber: anlambert.
anlambert added inline comments.
Dockerfile
1

Did you try to upgrade Python to 3.7 ? The only blocker for using it was celery that was missing support prior to version 4.3.

This revision is now accepted and ready to land.Apr 10 2019, 2:35 PM
This revision was automatically updated to reflect the committed changes.
This revision was automatically updated to reflect the committed changes.