-
Notifications
You must be signed in to change notification settings - Fork 4
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
Transition to spack workflow #275
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #275 +/- ##
==========================================
- Coverage 72.81% 71.07% -1.74%
==========================================
Files 18 18
Lines 982 968 -14
==========================================
- Hits 715 688 -27
- Misses 267 280 +13 ☔ View full report in Codecov by Sentry. |
Design (v0)Use spack environments (spack.yaml files) to install models.
Commit a spack.yaml file to the benchcab run directory repository (bench_example). This effectively makes the directory an anonymous environment. The new workflow consists of:
# Note: these commands are invoked by benchcab - not the user
# 1. Activate the spack environment:
spack env activate .
# 2. Install packages defined in spack.yaml:
spack concretize --force
spack install
# 3. Read machine readable output from spack to infer installed packages of CABLE (for example)
# in the current environment:
spack find --json cable
# 4. Deactivate the spack environment:
spack env deactivate
Deprecated functionality:
Changes to existing core functionality:
Strange spack errors:
|
Could you give a dummy example of what a
Hashs never seem to be very human-friendly to me. I wonder if there would be a different solution here. I can't think of what it would be, maybe the I think I'll comment further after I get the example as things will be clearer then. |
@ccarouge here is a spack.yaml that could be used with benchcab: # This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
# add package specs to the `specs` list
specs:
- matrix:
- [[email protected], [email protected]]
- ['%[email protected] ^[email protected] ^[email protected]']
view: false
concretizer:
unify: false or: # This is a Spack Environment file.
#
# It describes a set of packages to be installed, along with
# configuration settings.
spack:
# add package specs to the `specs` list
specs:
- [email protected]
packages:
cable:
require: '%[email protected] ^[email protected] ^[email protected]'
view: false
concretizer:
unify: false
develop: {} Installing the packages in this environment will compile the
By this do you mean building CABLE with spack using the same dependencies as how CABLE was built without spack? This should be possible provided all the module dependencies available on NCI are installable via spack. The release team has also setup spack "wrappers" around existing installs on NCI which can be used (for example the
We could use other metadata which is more human readable in addition to a hash, for example [
{
"name": "cable",
"version": "git.tmp-branch-for-testing-5=0-git.493",
"arch": {
"platform": "linux",
"platform_os": "rocky8",
"target": "x86_64"
},
"compiler": {
"name": "intel",
"version": "19.0.5.281"
},
"namespace": "access.nri",
"parameters": {
"build_system": "cmake",
"build_type": "Release",
... removed for demo purposes ...
},
"package_hash": "6xwaypybkzbwnwce6waylzppbzb2zxo3kmr5uqc5f23nvyaslkna====",
"dependencies": [
... removed for demo purposes ...
],
"hash": "z52w6i2uaoocckhpqraffduaf67cgswf"
}
] |
Thanks @SeanBryan51 that's useful. I'm guessing in the matrix we can refer to specific commits or tags, right? For the release that's not what I meant. When we will do a release of CABLE, we will have a deployed version of CABLE built with spack and centrally installed at NCI. Is there a way to design benchcab so that users can say they want that release and their branch built with the same dependency versions (same netcdf, mpi and compiler) as for that release? Is the simplest to do that to ensure these versions are what is in spack.yaml by default in bench_example?
Why cable as default instead of None? Is that to ensure it is set and not forgotten?
What do you mean? More exactly is that a change to the current behaviour of benchcab or is it keeping the behaviour? Lastly, I would expect we need some changes to the cleanup process. We need to remove all the spack installs. Easy? I'm worried about losing the local functionality. We'll need a solution. I'm happy if the solution is for the user to pre-build and benchcab to somehow know how to find these executables. |
Spack supports specifying git references for git projects.
I don't have the best answer to this as I'm not sure how the CABLE release would look like. One way could be to define the preferred dependencies for the CABLE release inside a package.yaml file, and then include these configurations in the spack.yaml file (see included configurations).
The default for
This is just so its clear to the end user which model versions are getting patched, as multiple model versions could match for a given model spec. I realised we already do this when setting up experiments so it isn't really a change to the current behaviour.
I haven't thought about how clean up will look but there will likely be some changes. I will add this to "Changes to existing core functionality".
We don't want to lose any of the existing functionality thats for sure. I plan on looking into |
I have looked more closely into |
3c200a7
to
45e4243
Compare
Design (v0.1)Same workflow as initial v0 design except no existing features are deprecated (i.e. fully backwards compatible). Support with Additional functionality:
Changes to existing core functionality:
Tasks
|
Currently, every |
@SeanBryan51 I was going through the PR, I read a potential issue of losing the local functionality since Another aspect which I thought to this was (if the above was viable) - An interesting link (not directly our use case but could be useful for dev workflows) I came about: https://key4hep.github.io/key4hep-doc/developing-key4hep-software/SpackForDevelopers.html |
@abhaasgoyal I'll give a crack at adding support for more than one spack environment file (e.g. having a spack-local.yaml). From the CABLE release meeting yesterday, it looks like releases of CABLE will also be defined with spack environments so this functionality will also be useful if we want to test against released versions of CABLE. |
Now that CABLE is installable with spack (see ACCESS-NRI/spack-packages#60), we can leverage features of spack in benchcab's workflow to build models in a way that:
Repo
hack from model.py #210repo
module #211This pull request contains all required changes for transitioning to a spack based workflow.
To be updated as the PR progresses.
Requirements
Edge cases
benchcab
may not havespack
installed.benchcab
may have an existing spack environment activated.benchcab
has not installed any dependencies of CABLE and will need install the entire dependency tree which may take a while.Checklist