-
Notifications
You must be signed in to change notification settings - Fork 23
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
Mount /tmp as a tmpfs volume to work around #537 #539
Conversation
This commit is a workaround for the issue #537. It allows the Content Publisher and Whitehall test suites to pass in the GOV.UK Docker development environment. Once docker/for-linux#1015 has been fixed, this workaround will no longer be needed.
Nice work @ollietreend ⭐ - great to hear there's an alternative option to the rather grim ones I presented in: #537 I don't know too much about tmpfs to know what the trade-offs are here. Is the /tmp mount localised to an individual container? i.e. has an ephemeral lifespan that matches the container; or does it persist? does it get shared between containers at all? |
@kevindew as I understand it, the I've just had a quick play with some containers running in parallel and that's the behaviour I observed. |
That sounds great - let's give it a go. Could you write a reply to the GitHub issue just to indicate there's a workaround? |
This change fixes a regression in filesystem permissions introduced in #539, which stopped `ruby-build` from being able to build the Ruby version required by `rbenv`. After #539 was merged, we started seeing the following error message when building the Whitehall and Content Publisher apps: ``` ruby-build: TMPDIR=/tmp cannot hold executables (partition possibly mounted with `noexec`) ``` The error was triggered by running `make whitehall` or `make content-publisher` to re-build the app's docker image. However it also dependended on the docker cache being empty, because otherwise the required Ruby version would already exist in a cached image layer and wouldn't need to be re-installed. The cause for the error was the new `tmpfs` volume which was mounted at `/tmp`. By default, `docker-compose` mounts `tmpfs` volumes with the `noexec` flag, which means that files inside the `/tmp` directory cannot be executed. But `ruby-build` needs to execute files in `/tmp` in order to build Ruby. This change re-enables execution of files inside `/tmp` by including the `exec` flag on the `tmpfs` volume mount.
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
For some reason, temporary files weren’t created correctly when running tests inside our Docker development environment. This seems to be a Docker issue that can be worked around by mounting the `/tmp` directory. References: alphagov/govuk-docker#539 docker/for-linux#1015
This commit is a workaround for the issue #537. It allows the Content Publisher and Whitehall test suites to pass in the GOV.UK Docker development environment.
Once docker/for-linux#1015 has been fixed, this workaround will no longer be needed.