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

Mount /tmp as a tmpfs volume to work around #537 #539

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

ollietreend
Copy link
Contributor

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.

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.
@kevindew
Copy link
Member

kevindew commented Dec 7, 2021

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?

@ollietreend
Copy link
Contributor Author

@kevindew as I understand it, the tmpfs option creates a RAM-backed filesystem mount which is localised to each individual container, and isn't persisted or shared between different instances of containers. So completely isolated and ephemeral.

I've just had a quick play with some containers running in parallel and that's the behaviour I observed.

@kevindew
Copy link
Member

kevindew commented Dec 7, 2021

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?

@ollietreend ollietreend merged commit 4847314 into main Dec 7, 2021
@ollietreend ollietreend deleted the workaround-for-issue-537 branch December 7, 2021 15:18
ollietreend added a commit that referenced this pull request Dec 13, 2021
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.
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 21, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 21, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 21, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 21, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 21, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request May 22, 2022
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
tillprochaska added a commit to tactilenews/100eyes that referenced this pull request Jul 12, 2022
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
mattwr18 pushed a commit to tactilenews/100eyes that referenced this pull request Jul 27, 2022
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants