Page MenuHomeSoftware Heritage

[docker-compose] One image to bind them all
ClosedPublic

Authored by anlambert on Mar 13 2019, 11:36 AM.

Details

Summary

As pointed by @vlorentz yersteday in a f2f discussion, building the whole
set of docker images associated to each swh service takes too much time.

Moreover there is a lot of duplicated instructions in the service dockerfiles.
This calls for factorization in order to ease future maintenance of that
environment.

So, in order to speed up the docker-compose build process but also to remove
duplicated instructions in dockerfiles, prefer to use a single docker image
containing the full swh stack. Each swh service will run upon it while their
specific configuration (for instance entrypoint) will be picked from the
docker-compose.yml file.

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

anlambert retitled this revision from [docker-compose] One image to rule them all to [docker-compose] One image to bind them all.Mar 13 2019, 11:44 AM
ardumont added inline comments.
Dockerfile
46

I wonder if we don't need that as well for the deposit.

anlambert added inline comments.
Dockerfile
46

Migrations are currently handled in the entrypoint [1].
It could indeed be moved here.

[1] https://forge.softwareheritage.org/source/swh-docker-dev/browse/master/dockerfiles/swh-deposit/entrypoint.sh$33

Dockerfile
46

Right, though as exchanged orally, it's better to move that in the entrypoint.
Because then, we can use the mount point (when in dev mode) to actually test the dev migration works as expected ;)

\m/

anlambert added inline comments.
Dockerfile
46

Indeed, this is needed for dev mode. Migrations should also be performed in the entrypoint for the swh-web service. I will update accordingly.

I'm fine with this. I don't see any blocker, only pros:

  • less duplication
  • faster
  • clearer as well, a priori that will even be easier to maintain

Awesome stuff ;)
Thanks.

Please as you said, amend the entrypoint.sh for the webapp to deal with the webapp migration and good to go!

Cheers,

This revision is now accepted and ready to land.Mar 13 2019, 12:02 PM

I'm fine with this. I don't see any blocker, only pros:

  • less duplication
  • faster
  • clearer as well, a priori that will even be easier to maintain

And it saves disk space.

Update: Move swh-web database migration into the corresponding entrypoint script

Update: Copy client.py file for the swh-journal-client service into a dedicated directory instead of the root one

This revision was automatically updated to reflect the committed changes.