-
Notifications
You must be signed in to change notification settings - Fork 16
let EESSI container script's run mode call apptainer exec instead of apptainer run
#152
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
…hen running a command/script
| fi | ||
|
|
||
| # the run mode should actually call "apptainer exec", so simply override run to exec | ||
| if [[ "${MODE}" == "run" ]]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should print some warning here that we've changed the behavior of this option to effectively exec. Even if we don't rely on any runscripts - and using run was effectively a mistake - this doesn't mean no one else used the eessi_container.sh with a runscript AND relied on its behaviour.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should even introduce a mode force-run or something, which this warning may then suggest as an alternative (i.e. "if you really wanted the old behavior, use eessi_container.sh --mode force-run" (which we then remove at some point if we want to ever deprecate the run-to-exec fallback)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed in 01aba0c. It now prints a warning message about the changed behaviour when --mode run is used, and it tells users to use --mode exec to silence that warning.
|
Oh, and while I fully agree this should be 'fixed', I'm curious: did you hit issues because of this? If so, where? |
Yes, for the compat layer we have a container image that defines an entrypoint (https://github.com/EESSI/compatibility-layer/blob/main/Dockerfile.bootstrap-prefix-debian-13#L48) that acts as a runscript. Running that one with our eessi_container.sh script like |
casparvl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should also adapt the CI to use the --mode exec, and maybe adapt the --mode run check at
| # test use of --mode run |
eessi_container.sh --mode runexpects a command or scripts, and then callsapptainer run <container> <command/scripts>. This is not correct:Though that still seems to work for containers that don't have a runscript defined, you will get unexpected behaviour for ones that do have a run script defined: it will not run the given command/script, but pass that as argument to the defined runscript.
Instead, it should actually call
apptainer exec:In order to fix it, I'm overriding
runtoexecbefore the container is started. It also (silently) accepts--mode exec. We may even want to completely rename therunmode toexeclater on, and print a deprecation message? Would also require us to change it in several places.