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

Allow Overriding the Default Mount Point of the Stage Directory in Containers #3367

Open
mredenti opened this issue Jan 24, 2025 · 4 comments

Comments

@mredenti
Copy link

Description

Currently, ReFrame mounts the test’s stage directory inside the container to /rfm_workdir by default. This behavior is hard-coded and does not provide flexibility for users to specify an alternative mount point. - see https://reframe-hpc.readthedocs.io/en/stable/regression_test_api.html#reframe.core.containers.ContainerPlatform.workdir

Proposes feature

Introduce a configuration option that allows users to override the stage directory as the default mount point that points to /rfm_workdir directory inside the container.

Motivation

In environments with non-shared filesystems, input files are not located on the login node where the stage directory resides. As a result, the default mounting behavior restricts the accessibility of input files within the container. In this case one has to specify and additional mount point and and also set the self.container_platform.workdir. It would be more efficient to allow the possibility of changing the default mount point in such situations

@vkarak
Copy link
Contributor

vkarak commented Feb 4, 2025

I am not sure that this is actually needed, since you can still achieve the desired behaviour by setting two variables instead of one. Am I missing something?

@mredenti
Copy link
Author

mredenti commented Feb 5, 2025

So you can definitely mount any other directory anywhere else and also change the default working directory inside the container.
I guess it is just a matter of redundancy, why mount something in the container if you do not need it.

Mounting two host directories to /rfm_workdir makes we wonder whether this is defined behaviour. I need to check whether container engines allow this or the second one specified takes precedence. In this case you would not be able to mount into /rfm_workdir but it would be nice to keep a certain consistency for all tests such that the destination directory inside the container can always be
/rfm_workdir but need not be the stage directory being mounted

@vkarak
Copy link
Contributor

vkarak commented Feb 5, 2025

You would still need the stagedir mounted inside the container if you wanted to copy out some files for inspection. I guess in your example, everything is in stdout so you don't need this. Maybe a variable defined as:

mount_stagedir = variable(str, type(None), value='/rfm_workdir')

would make sense. If None, the stage directory would not be mounted at all. Afaiu this would work nicely for your case, wouldn't it?

@mredenti
Copy link
Author

mredenti commented Feb 5, 2025

Yes, that would work nicely

@vkarak vkarak added this to the ReFrame 4.8 milestone Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

2 participants