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

Fix geodynamics/rayleigh docker image for apptainer #465

Merged

Conversation

gassmoeller
Copy link
Member

Our current docker container geodynamics/rayleigh includes a user with limited permissions and a home directory that is only readable by that user. This is a problem if the container is run using singularity or apptainer, because these container systems automatically set the user identity inside the container to the user on the outside. This means the Rayleigh installation in the current container is not usable when using apptainer or singularity. A common solution to this problem is to have the docker container default to the root user.
This way the two use cases (docker / apptainer) both work:

  • for docker the user id switched to root inside the container and allows everything, including to install new software if necessary (=better than the current container)
  • for apptainer/singularity the user id will be taken from the host system, but because rayleigh is installed in a generally readable location they can execute it normally. In addition, because apptainer/singularity automatically mount the current directory into the container the user is also allowed to write in this directory.

@tukss and @cianwilson I have already rebuild and updated the geodynamics/rayleigh container on docker hub. Could you try to execute that container using Singularity or Apptainer on the systems you have available? I tried on my laptop and one other system and it seems to work.

apptainer pull docker://geodynamics/rayleigh
# This should always work
apptainer exec rayleigh_latest.sif mpirun -n 4 rayleigh.opt
# this should only work if MPI inside and outside of container are compatible
mpirun -n 4 apptainer exec rayleigh_latest.sif rayleigh.opt```

@cianwilson
Copy link
Member

Tested this on:

  • singularity on a linux box
  • docker on a linux box
  • docker on an intel mac
  • docker on an m1 mac (not built for this but works)
    and looks good on all.

Would it be worth adding a line about this being compatible with singualrity/apptainer to the docs?

@gassmoeller gassmoeller force-pushed the fix_docker_image_for_apptainer branch from 322d5cb to e8a6d85 Compare June 16, 2023 17:21
@gassmoeller
Copy link
Member Author

gassmoeller commented Jun 16, 2023

Good point, I now added a line into the docs.

Copy link
Contributor

@feathern feathern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This has been sitting unattended for a very long time now! Since Philipp's tests ran well and the docs were updated, I'm going to approve and merge.

@feathern feathern merged commit 65a38fa into geodynamics:main May 7, 2024
5 checks passed
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.

None yet

3 participants