-
Notifications
You must be signed in to change notification settings - Fork 114
Copy /etc/localtime symlink and target instead of mounting #184
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
Conversation
558814c to
eeac008
Compare
|
Tested on ubuntu 20.04, 22.04 and 24.04, centos 7 and 8, and alpine 3.19. Ubuntu has the annoying habit of canonicalizing the symlink when installing tzdata, so when the container starts up it'll be whatever was on your host (e.g. |
With ubuntu 24.04, attempting to install the tzdata package inside an enroot container leads to the following error: ``` mv: cannot move '/etc/localtime.dpkg-new' to '/etc/localtime': Device or resource busy ``` The package's postinst script only skips setting the timezone if /etc/localtime already exists as a symlink. So, in order to set the timezone inside the container to match the host os, we must copy both the symlink and the symlink's target into the container rootfs.
eeac008 to
70febb1
Compare
|
HI, sorry to re-touch this issue, but it seems that this hook might introduce a race condition, when used with pyxis. So a user is re-using the same container on different nodes simultaneously, and previosusly, the mount was somewhat fine, cause it happens locally to the machine. However, copying into the container has the nasty side effect that, given that the container is on a shared file system, another node might just have done the same… |
|
To add some more context here: I'm running a sbatch job using a common pre-setup container like so Slurm will schedule executions on multiple nodes in parallel. The specific error I'm experiencing is However, this error only randomly appears in about 1/3 of executions. Our guess would be that this happens because the lines of |
|
Whoops! If you're able to reliably reproduce it, can you try simply adding |
|
I'll let Jon comment on whether we recommend running the same container rootfs across multiple machines (I believe not), but that |
We just tried your suggestion on one of our machines, and that machine was then the only one no longer experiencing errors, so we think that should do the trick 👍
I agree that this approach looks a bit suspicious, and I would not do it this way in any kind of serious production usage. In this case, we are talking about research work, though, and I like the convenience of having a manual change I make in a container immediately affect all future job executions. In any case, I believe adding the |
|
Yeah we don't usually recommend this since we don't test it. Line 243 in 2bd5143
So maybe your shared filesystem doesn't support it or is not properly configured |
|
It's GPFS, and it does support locking. |
|
I fail to understand what's happening here. |
With ubuntu 24.04, attempting to install the tzdata package inside an enroot container leads to the following error:
The package's postinst script only skips setting the timezone if /etc/localtime already exists as a symlink. So, in order to set the timezone inside the container to match the host os, we must copy both the symlink and the symlink's target into the container rootfs.
See https://git.launchpad.net/~ubuntu-core-dev/ubuntu/+source/tzdata/tree/debian/tzdata.postinst?h=debian/2024a-1ubuntu1