Page MenuHomeSoftware Heritage

Data persistence for a devel setting
ClosedPublic

Authored by tenma on Dec 7 2020, 9:55 AM.

Diff Detail

Repository
rDENV Development environment
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

Precision about ownership

Suggest to adapt according to policy

ardumont added inline comments.
docker/README.md
605

so that data...

606

Common

douardda added inline comments.
docker/README.md
591

unused?

594

Docker and docker-compose documentatioms are not clear about their behavior regarding anonymous volumes.

This sentence is unnecessary.

607

We can also create them as named host volumes so that the data is also accessible like a non-containerized service (which is not portable).

this sentense is unclear to me, especially the "like a non-containerized service".

Also the "which is not portable" is unclear: what does the "which" refers to?

610

Data should be accesible to the user in the container.

what does this mean?

(also typo in "accesible")

612

Is it really necessary to deal with these permission / ownership stuff?

616

Note that using named volumes in docker-compose.yml (without making them external or bind-mounts of an existing directory) also make them resilient on docker-compose down (unless called with --volumes)

So IMHO this section could be simplified substancially, and I'd prefer the volumes declarations examples to be given as docker-compose override files rather than suggesting to modify the git-managed docker-compose.yml file.

This revision now requires changes to proceed.Dec 7 2020, 10:58 AM
docker/README.md
594

Agreed.

Also it'd be neat to pinpoint what's not clear in those other documentations to disambiguate them ;)

docker/README.md
612

Multiples resources online do it, probably not a good solution. After some more tests, it seems not necessary in my setup. Ownership and permissions on the bind mount are updated by the container.

616

About volumes:
Then you know more than me. Documentations are not clear about how each type of volumes become unused/dangling or removed, and volumes denominations are varying. I have lost data volumes 2 times without knowing why. In a simple test, named volume were not removed on docker-compose down, but I can't be sure of it.

About the override:
Will try it.

Usa a docker-compose.override definition.
Rephrased where appropriate.

tenma added inline comments.
docker/README.md
591

Yes, unused is one of the terms used in the documentation.
Sometimes docker-compose creates a new volume with the same role wrt a container and the old is no longer referenced but not deleted. "Sometimes", because doing down and up did not "delete/unreference the volume" my data for weeks, but should probably have according to recent changes to the documentation.
Named or host volumes should not be deleted on down, but use external to be sure.
https://docs.docker.com/compose/reference/down/ sums up pretty well the uncertainties.
https://github.com/docker/compose/issues/7444 issue leading to an update of the documentation.

607

Is it better?

tenma marked an inline comment as not done.Dec 10 2020, 7:29 PM
docker/README.md
594

I hesitated to write it in the first place, but thought it was important to mention. See supra link to the doc.

Removed. Indeed too generic.

docker/README.md
591

According to the doc you are mentioning:

Networks and volumes defined as external are never removed.

So it might be enough to find the way to declare volumes as external
within the docker-compose.override.yml for what you are trying to
describe here.

That's what I deduce from that documentation sentence,
that may not be that simple...

docker/README.md
591

ah sorry, i just reread between the discussion comments, that's what you are doing below...

neat.

Removed usage of external host volumes, as asked by @douardda, for brievety.

docker/README.md
614

persist

lgtm

a typo inline (around my last comment i think).

Finally fixed this PREsistent typo!

This revision was not accepted when it landed; it landed in state Needs Review.Dec 15 2020, 6:27 PM
This revision was automatically updated to reflect the committed changes.