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

Update container handling with charliecloud #5300

Merged
merged 9 commits into from
Sep 16, 2024

Conversation

nschan
Copy link
Contributor

@nschan nschan commented Sep 12, 2024

Here are changes to the charliecloud driver.

  • charliecloud.writeFake is true by default (!)

  • if charliecloud.writeFake is true and $CH_IMAGE_STORAGE is set, images will go into $CH_IMAGE_STORAGE and be run from there with --write-fake (will be run by name in that case).

  • if charliecloud.writeFake is true, but $CH_IMAGE_STORAGE is unset, images will go into charliecloud.cacheDir, $NXF_CHARLIECLOUD_CACHE or work/charliecloud (order of priority) and will be run by path (since run by name only works if $CH_IMAGE_STORAGE is set)

  • if charliecloud.writeFake is set to false, images will need to be run with -w to enable mounting of the workDir. In this case $CH_IMAGE_STORAGE will not be used to store images, since $CH_IMAGE_STORAGE is incompatible with -w. Images will instead go into charliecloud.cacheDir, $NXF_CHARLIECLOUD_CACHE or work/charliecloud (order of priority). If the folder used to store images is the same as $CH_IMAGE_STORAGE, throw an exception. Images will be run by path.

In summary:

  • Give preference to $CH_IMAGE_STORAGE in the default case of writeFake

  • Make some effort to avoid using $CH_IMAGE_STORAGE when writeFake is false.

  • No longer create temporary containers for each task.

This is the same as #5212, but without the many merge conflicts created by a failed sign-off.

@phue I have updated the documentation. I have not added a unit test for switching between image and imageName in the builder, since I do not know of a way to set an env var for the tests. I have tested this locally (i.e. running tests with the var set or not) and it produced the expected results. Is it really worth adding a way to inject fake environments into the BuilderTest to test this specific behaviour?

-use writeFake as default
-run by name with writeFake and CH_IMAGE_STORAGE
-run by path with writeFake when CH_IMAGE_STORAGE is not set
-run by path without writeFake, but writeable, check that the path is not CH_IMAGE_STORAGE

Signed-off-by: Niklas Schandry <[email protected]>
…GE_STORAGE is preferred, in other cases charliecloud.cacheDir over NXF_CHARLIECLOUD_CACHE over work/charliecloud, prevent usage of CH_IMAGE_STORAGE when not using writeFake

Signed-off-by: Niklas Schandry <[email protected]>
Signed-off-by: Niklas Schandry <[email protected]>
@nschan nschan requested a review from a team as a code owner September 12, 2024 10:00
Copy link

netlify bot commented Sep 12, 2024

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit 9ec0941
🔍 Latest deploy log https://app.netlify.com/sites/nextflow-docs-staging/deploys/66e82e9a14a96a0008074f9f

@nschan
Copy link
Contributor Author

nschan commented Sep 12, 2024

I have also gone through open issues that mention charliecloud:

#3566 has been fixed a while ago
#3964 may still occur, seems to be timing dependent
#4463 should be properly handled here
#5192 is now fixed since there are no task-specific containers anymore

Signed-off-by: Niklas Schandry <[email protected]>
docs/config.md Outdated Show resolved Hide resolved
@phue
Copy link
Contributor

phue commented Sep 12, 2024

#3566 has been fixed a while ago

How was it fixed?

Signed-off-by: Niklas Schandry <[email protected]>
@nschan
Copy link
Contributor Author

nschan commented Sep 12, 2024

#3566 has been fixed a while ago

How was it fixed?

Trying to catch it and retry https://github.com/nextflow-io/nextflow/blob/master/modules/nextflow/src/main/groovy/nextflow/container/CharliecloudCache.groovy#L186

@nschan
Copy link
Contributor Author

nschan commented Sep 12, 2024

Thanks for the helpful discussion and review @phue ! @pditommaso do you have any additional comments on this?

Copy link
Member

@pditommaso pditommaso left a comment

Choose a reason for hiding this comment

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

Just lest a minor comment

Signed-off-by: Niklas Schandry <[email protected]>
@nschan
Copy link
Contributor Author

nschan commented Sep 16, 2024

Thanks @pditommaso, I have put in the suggested change.

@pditommaso
Copy link
Member

Nice, let's wait for the tests

@pditommaso pditommaso merged commit 8e6068d into nextflow-io:master Sep 16, 2024
23 checks passed
This pull request was closed.
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.

3 participants