-
Notifications
You must be signed in to change notification settings - Fork 17
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
Add --extra-inputs
to containers-add
#190
Add --extra-inputs
to containers-add
#190
Conversation
Code Climate has analyzed commit d46b443 and detected 2 issues on this pull request. Here's the issue category breakdown:
View more on Code Climate. |
Thanks for approaching that, @nobodyinperson! WRT to the CI failure: The new parameter needs to also become part of the actual signature: |
Yep, working on it! |
002e5b3
to
92c0989
Compare
Codecov ReportBase: 93.92% // Head: 93.49% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #190 +/- ##
==========================================
- Coverage 93.92% 93.49% -0.43%
==========================================
Files 19 19
Lines 889 938 +49
==========================================
+ Hits 835 877 +42
- Misses 54 61 +7
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
I'm happy with this so far. I give up on implementing a test for |
Thank you very much, @nobodyinperson . I'm looking into the test issues to finish this. |
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.
brief comments on how to harmonize with other interfaces etc
@yarikoptic I implemented all of your suggestions. I also made I tried again to make a test for |
just to make sure -- do you mean TODO at https://github.com/datalad/datalad-container/pull/190/files#diff-c9a6a0cde74f0c35ded765fc396d537f9485fe47645c4e00698ab951138042d6R218 ? |
Yes, in general a test for |
@nobodyinperson I sent a PR for your fork with suggestive changes/fixup to the test: nobodyinperson#1 |
Thanks @yarikoptic. How is the run-record accessed? The |
probably look at |
Thanks @yarikoptic, I was now finally able to add a proper test for |
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.
Looks good to me . Just nit picking to make a little more consistent with the rest of inconsistencies we have ;)
minor typo Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Thanks @yarikoptic for the hints
- {img_dspath} and {img_dirpath}
It now fails on the 2nd test with E datalad.runner.exception.CommandError: CommandError: 'datalad containers-run -n sub/mycontainer XXX' failed with exitcode 1 under /home/yoh/.tmp/datalad_temp_tree_test_extra_inputsratuqu5q [out: 'image=sub/containers/container.img cmd=XXX img_dspath=sub img_dirpath=sub/containers E run(error): /home/yoh/.tmp/datalad_temp_tree_test_extra_inputsratuqu5q (dataset) [Input did not match existing file: overlay1.img] E run(ok): /home/yoh/.tmp/datalad_temp_tree_test_extra_inputsratuqu5q (dataset) [echo image=sub/containers/container.img ...] E action summary: E get (notneeded: 4) E run (error: 1, ok: 1) E save (notneeded: 2)'] and not sure yet if legit since that overlay1.img extra_input is relative path, and intentionally or not is not present in super dataset: - we could have had it as a feature that somehow that extra_input is relative to current invocation path, while instructing people to use {img_dspath} whenever it needs to be relative from the img_ds. Then we would need to add one more overlay1.img in superdataet - but above would be a bit too of an obscure feature I think, so not sure if should be facilitated.
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
70b4a1a
to
af1034b
Compare
@yarikoptic I addressed all your remarks and rebased the branch onto Concerning the code style discussions I'd recommend using black as code formatter. Takes the discussion out of the formatting, it's one de-facto standard for Python code style. |
We do use |
@@ -0,0 +1,3 @@ | |||
### 🚀 Enhancements and New Features | |||
|
|||
- Add `--extra-inputs` to `containers-add`. Fixes [#189](https://github.com/datalad/datalad-container/issues/189) via [PR #190](https://github.com/datalad/datalad-container/pull/190) (by [@nobodyinperson](https://github.com/nobodyinperson)) |
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.
feel welcome to expand here on how/when to use this feature, e.g. close to your use case.
xi_kwargs = dict( | ||
img_dspath=image_dspath, | ||
img_dirpath=op.dirname(image_path) or ".", | ||
) |
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.
codeclimate btw warned about code duplication here. I think it is ok, although indeed duplicates with cmd_kwargs definition above so we could have some common_kwargs
to be this structure and defined before any use and then only enhanced for cmd_kwargs
. But really might be not worth the hassle this far, just wanted to leave a note that I am ok to suppress codeclimate for this.
…mand errors On appveyor env we got Selecting previously unselected package singularity-ce. (Reading database ... 300710 files and directories currently installed.) Preparing to unpack /tmp/singularity-ce.deb ... Unpacking singularity-ce (3.11.0-focal) ... dpkg: dependency problems prevent configuration of singularity-ce: singularity-ce depends on uidmap; however: Package uidmap is not installed. dpkg: error processing package singularity-ce (--install): dependency problems - leaving unconfigured Processing triggers for man-db (2.9.1-1) ... Errors were encountered while processing: singularity-ce Reading package lists... Done Building dependency tree Reading state information... Done Correcting dependencies... Done The following additional packages will be installed: uidmap The following NEW packages will be installed: uidmap 0 upgraded, 1 newly installed, 0 to remove and 155 not upgraded. 1 not fully installed or removed. Need to get 26.4 kB of archives. After this operation, 172 kB of additional disk space will be used. Do you want to continue? [Y/n] Abort. Command exited with code 1
pushed potential fix for appveyor failure to configure singularity. If doesn't work out -- can troubleshoot in a separate PR |
It did turn green -- let's proceed, thank you @nobodyinperson ! |
PR released in |
This PR adds the
datalad containers-add --extra-inputs
option to specify additional files that should be included in the run-record and thus auto-fetched upondatalad containers-run
.Furthermore the
--call-fmt
now also has a{img_dir}
placeholder for easier specification of files next to the image.I added a test for
containers-add
asserting that the correct values land in.datalad/config
. There is currently no test forcontainers-run
as I couldn't get this to work in CI. I tried a shell-script as 'container' and sourced files as 'overlays', works on my machine, weird errors in CI.Full test script
test/run.sh
for reference, a comparablepytest
is shipped with this PR:closes #189