Conversation
|
how do I label WIP? |
|
@mamelara Add [WIP] to the start of the title and click on the gear next to labels to add WIP. If you have access that is. I'm not sure whether or not everyone can do the latter. |
|
This is very interesting! I just got done ranting about how difficult it is to manually add external packages: #2504 (comment) |
nice, it should certainly ease the pain of setting up external packages while still being precise in what is needed for each build! 👍 |
i added the label |
|
I like the general idea of this PR... Once the basic machinery is set up, I think the big challenge will be in detecting external packages and versions. That info could come from:
The next step would be a command that rifles through your system and finds all the external packages it can. This brings up questions of course. Spack would ideally want to construct a full spec for a package including variants and dependencies, not just its version number. Even just the version number could be tricky, a full spec even trickier... And stuff that rifles through your system and finds versions (or even deduces versions from something the user gives) will be OS-specific. I would like to see this functionality broken out into a separate file with a clear API. Then we can start hanging more complexity into that file. |
61ed1d9 to
e2bde54
Compare
|
@citibeth I agree that eventually this should be refactored into something that includes automatic external registration in Spack. I don't think that should hold up integration of this PR though. It's a useful feature, and I don't know what the timeframe will be for the fuller feature (it could come along with the full rework of compilers that models them as dependencies on virtual deps). |
|
Could I get a review requested label on this? Thank you! |
|
@tgamblin @alalazo @adamjstewart ping. |
e559c9e to
a34f9f8
Compare
adamjstewart
left a comment
There was a problem hiding this comment.
This looks like a great start! We'll eventually want to add more tests for determining names and versions automatically (see #3181), but I think it would be good to merge this first and integrate that later.
P.S. A few files are missing licenses at the top. Other than that I couldn't see anything obviously broken.
|
Oh, documentation would be nice as well. |
| from spack.environment import EnvironmentModifications | ||
| from spack.external_package import ExternalPackage, SpecVersionMisMatch | ||
| import spack.spec | ||
| import spack.test.mock_packages_test as mock_test |
There was a problem hiding this comment.
This line is causing the unit tests to fail.
lib/spack/spack/test/cmd/external.py
Outdated
| @@ -0,0 +1,123 @@ | |||
| import spack.architecture | |||
| import spack.test.mock_packages_test as mock_test | |||
There was a problem hiding this comment.
This line is causing the unit tests to fail.
a34f9f8 to
67cd029
Compare
Add new spack commands. Usage is spack external [cmd-option]. So far the options include add, remove and list.
Committing work to update branch to llnl develop
Change attribute names, got rid of some property methods that are not necessary.
Moved tty.msg output to cmd/external renamed some variables
Updated external_rm tests to follow new design and also updated external_package.
Reworked external_rm so that it can display message when a spec satisfies multiple entries. Similar to compiler rm, it will notify user that multilple matches were found and tell them to use the optional -a, --all flag. Changed some var names in external_package.
Made some flake8 changes and corrected some tests that failed on TravisCI. Fix sphinx doc tests.
Changed self.assertRaises tests to not use context manager.
Update tests to pytest Squash commits to change tests Squashing commits where I changed the tests to be updated to pytest
Update tests to pytest Squash commits to change tests Squashing commits where I changed the tests to be updated to pytest
Decided it was better design to have both add and remove functions rather than using the external cmd have the main logic for removing.
67cd029 to
aa0b09d
Compare
Tests were failing and changed external remove also used external package constructor instead of classmethod function.
|
@mamelara Are there any plans for this PR ? I think externals lack a decent CLI, so let me know if I can help. |
|
This PR has grown stale. I would need to rebase and then maybe look through and adjust some of the methods since Spack has changed a lot since this was last worked on. I was hoping to get some help with the design aspect of the code and also maybe improving the functionality. I was also working on detecting some defaults though I think that should be a separate PR and this should focus on the CLI interface instead. Any help is welcome! I'll see if I can update this soon. |
|
Wasn't aware of this PR. This will be of great help! |
|
This PR is really what we need to an easy use of Spack on cluster platforms. I may be a little out topic but :
Have we an expected date for this PR to be merged ? |
|
I am also interested in this PR and whether it will be merged. |
|
I would also be interested, would be good to at least rebase and resolve conflicts, so to ease the testing activity |
|
@Oximore @amklinv @luigi-calori This PR will be merged eventually. @mamelara and I will probably need to tweak the interface. Eventually this should go along with automatic detection, but we don't have the technical solutions in place for that yet and it's a very hard problem. |
|
@mamelara : This will be very helpful! I was looking for the functionality to "export" installed packages to |
|
Closing to re-open to refresh check details since they are not available. (At least I was under the impression that would work but I guess not.) |
First working design for new spack external add/rm/list command. Would like some feedback on it.
Usage works as follows:
spack external add [package_spec] [path_or_module_for_external_pkg]spack external rm [package_spec]spack external listAll take an optional scope flag
external add
The external add command takes in a package spec (with or without a package version) and either a path or module name. This information is passed to the ExternalPackage class which then validates the path or module and attempts to detect a version. If a version is not detected and the user did not specify a version in the spec, a version is spit out. Otherwise, that version is appended to the spec. An external package object is created and is used to add an entry to packages.yaml.
example:
external rm
The external rm command also takes as input a package_spec. It will remove the specified spec entry from a package. If that package entry is empty (no specs) then that entire package entry is removed.
example:
external list
Outputs the contents of a list. Similar to compiler list.
output:
So far I've tested this on Cori and on my Mac. Please feel free to comment on it and I'm open to all kinds of suggestions and looking to improve functionality and design. Thanks!
Note: I'm not too excited about how I have been detecting versions from packages. Currently, I just look through the path for something that looks like a version and stick it on to the spec string. I also parse the output of module avail but not sure if my way is too NERSC specific.
Another thing, I added more tests and a mock modulefiles path to test modulecmd with fake modulefiles. Hopefully people will find that useful.