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

feat: implement mount points for task execution. #323

Merged
merged 6 commits into from
Feb 7, 2025

Conversation

peterhuene
Copy link
Collaborator

@peterhuene peterhuene commented Feb 6, 2025

This PR implements the calculation of mount points for task execution backends that use containers.

Paths from File and Directory values that are visible prior to evaluating the command section of a task are added to a PathTrie.

The PathTrie is used to determine the minimum number of mounts in the guest environment to be able to send input files to the container.

Command evaluation does a translation from host paths to guest paths so that the generated command script uses only guest paths.

Similarly, evaluation of output values does a translation from guest paths to host paths so that tasks always output the host path.

Fixes #267.

Before submitting this PR, please make sure:

  • You have added a few sentences describing the PR here.
  • You have added yourself or the appropriate individual as the assignee.
  • You have added at least one relevant code reviewer to the PR.
  • Your code builds clean without any errors or warnings.
  • You have added tests (when appropriate).
  • You have updated the README or other documentation to account for these
    changes (when appropriate).
  • You have added an entry to the relevant CHANGELOG.md (see
    "keep a changelog" for more information).
  • Your commit messages follow the conventional commit style.

This commit implements the calculation of mount points for task execution
backends that use containers.

Paths from `File` and `Directory` values that are visible prior to evaluating
the command section of a task are added to a `PathTrie`.

The `PathTrie` is used to determine the minimum number of mounts in the guest
environment to be able to send input files to the container.

Command evaluation does a translation from host paths to guest paths so that
the generated command script uses only guest paths.

Similarly, evaluation of output values does a translation from guest paths to
host paths so that tasks always output the host path.

Fixes stjude-rust-labs#267.
@peterhuene
Copy link
Collaborator Author

I forgot to mention that I need to test that new unit test on Windows as the paths obviously are for unix, so I expected the Windows CI to fail; I'll get a similar test implemented to test Windows paths.

Copy link
Member

@claymcleod claymcleod left a comment

Choose a reason for hiding this comment

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

LGTM.

wdl-engine/src/backend.rs Outdated Show resolved Hide resolved
wdl-engine/src/eval.rs Outdated Show resolved Hide resolved
* Rename `path2` to `path`.
* Add a `MountPoint` struct to replace the tuple in areas to make it less
  confusing as to the contents of a mount point.
@peterhuene peterhuene requested a review from a-frantz February 6, 2025 21:42
wdl-engine/src/backend.rs Outdated Show resolved Hide resolved
@peterhuene peterhuene merged commit cce783a into stjude-rust-labs:main Feb 7, 2025
16 checks passed
@peterhuene peterhuene deleted the mounts branch February 7, 2025 15:36
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.

feature: properly map file/directory paths for task evaluation
3 participants