Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Take out volume mount for mig/ directory in production #41

Open
benibr opened this issue Jan 24, 2024 · 4 comments
Open

Take out volume mount for mig/ directory in production #41

benibr opened this issue Jan 24, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@benibr
Copy link
Contributor

benibr commented Jan 24, 2024

As already discussed earlier I'd like to suggest, that we remove the volume mount for the mig/ application folder from the production compose file.

The current situation is: during first start the migrid Docker container populates the mig/ directory with the version of the application that is built into the container.
If the container is rebuilt with a newer version and the whole setup is started, the mig/ folder inside the container get overmounted by the already existing volume. Thus we end up with a running Docker container tagged as a newer version which effectively runs the old version.

This is accepable behavior for a development environment where a user wants to change the application on-the-fly and see the results.

For a production environment a user should be able to see the running version by looking at the image tag of the containers.

Current solutions to avoid the version mismatch are: running make clean or even running make distclean and redeploy everything.
Both are meant to be used manual and cause downtime. The latter is also very slow.

Without the mig/ volume it would be possible to rebuild the container with a new version, then just rerun telling docker-compose to recreate the container. This is fast and intuitive and does not need extra steps in the automation (eg. Ansible).

So my suggestions is to remove the mig volume from all containers in the production template docker-compose file:

    volumes:
...
      - type: volume
        source: mig
        target: /home/mig/mig

Any thoughts and suggestions appreciated.

@benibr
Copy link
Contributor Author

benibr commented Jan 24, 2024

One addition:

The checked out version should maybe be visible in the mig/ directory, not just inside the home directory in the container

https://github.com/ucphhpc/docker-migrid/blob/master/Dockerfile.rocky8#L772

@jonasbardino
Copy link
Contributor

Sorry for the slow response - vacation and other tasks kept me busy :-/

I'm not sure I have the full overview of the consequences of the proposed modification, but am not generally averse to the idea. Currently I usually end up using complete docker clean on dev and test sites because of various docker/podman caching issues, possibly including the mentioned one.

One possible problem is the fact that both the mig and httpd dirs/volumes contain generated configuration files implicitly bound to a specific migrid version. That is, I guess we can potentially run into similar issues with the httpd volume being out of sync with the running migrid version.

@benibr
Copy link
Contributor Author

benibr commented Mar 6, 2024

So maybe we should not only remove the mig volume but also the httpd volume in production?

@jonasbardino
Copy link
Contributor

Well, at least that's what I suppose we might end up having to do if so. I'm just not sure if this will drag us down the way to restructuring everything to use a separate configuration volume setup or something, as we discussed previously here but put on hold for various reasons. If anybody can find time to look into the matter it would be welcome of course.

@jonasbardino jonasbardino added the enhancement New feature or request label Mar 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants