-
Notifications
You must be signed in to change notification settings - Fork 59
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
NF: Add Environment class, with initial Native/Docker implementations #516
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## master #516 +/- ##
==========================================
- Coverage 83.42% 81.53% -1.90%
==========================================
Files 22 24 +2
Lines 4894 4949 +55
Branches 1410 0 -1410
==========================================
- Hits 4083 4035 -48
- Misses 807 914 +107
+ Partials 4 0 -4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
99867ef
to
ca4f83c
Compare
2ef506e
to
87f59dc
Compare
for now |
493071d
to
bab281c
Compare
I was able to test this PR successfully on pydra-deface using FSL tasks and a container image built from the latest version of FSL. A few paths of improvement:
More info can be found in the containers transport documentation. |
I agree, we should definitely try to keep this general. I don't have enough experience with non-Docker/non-Singularity runtimes to be opinionated here, so happy to follow your lead. |
I did a bit of research:
To conclude, I think the current implementation is good enough as it is 👍 |
fb9dddd
to
48b35b7
Compare
@djarecka This is passing locally, but there are a lot of skipped tests. We'll see how far this gets on CI, but this is it from me for today. |
@effigies - ok, thank you. I will review the tests that are failing |
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.
Looked at this with some fresh eyes and left a few notes. We should be careful to name the functions and attributes to make future contributors (such as ourselves) less confused.
pydra/engine/task.py
Outdated
for fld in attr_fields(self.inputs): | ||
if TypeParser.contains_type(FileSet, fld.type): | ||
# Is container_path necessary? Container paths should just be typed PurePath | ||
assert not fld.metadata.get("container_path") |
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.
This is presumably failing in test_docker_inputspec_3
. I think we need a clearer use-case and figure out the correct behavior. In any case, we've been putting up with a failing test for a while. I'm inclined to say let's re-add this feature when someone actually needs it.
i'm trying to understand why the slurm test fails now, since you didn't any new test here yet. any idea? |
Nope. I've never understood anything about the slurm tests. I'll rebase on master and push, if that might help. |
…ask; adding tests (more tests needed)
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 the value proposition from the proposed Environment
abstraction is clear, I am just a bit confused about the execution.
It sounds to me like they could be simplified to a bunch of context managers, maybe:
# somewhere in the submitter's code
match environment: # assuming [type, *args]
case ["docker", image, tag]:
with setup_docker(task, image, tag) as env:
...
case _: # fallback to native
with setup_native(task) as env:
...
Here I am using the new pattern matching syntax, but a stack of isintance
calls would work the same.
The other worry I have got is how composable the Environment
family of values is with the Submitter
one. All submitters (cf, Dask, SLURM, ...) should work with native, but would that be the case for containers (Docker, Singularity) or others we had in mind like Conda?
I am totally onboard with the idea to dissociate the execution environment from the task abstraction. But I am still feeling the boundary between Environment
and Submitter
is not as clear cut than anticipated? I don't have further ideas to improve the proposal at this point, so I won't be opposed to a merge 👍
adding the Singularity environment class
[WIP] cleaning, fixing tests
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.
This is pretty much ready to go. Small comments.
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
Co-authored-by: Chris Markiewicz <[email protected]>
for more information, see https://pre-commit.ci
Co-authored-by: Chris Markiewicz <[email protected]>
small fix
small edits to the core
No description provided.