PawseySC / pawsey-spack-config

Automated deployment system for the scientific software stack in use at Pawsey
BSD 3-Clause "New" or "Revised" License
4 stars 9 forks source link

Enables creation of spack environments at user and project levels #283

Closed dipietrantonio closed 1 month ago

dipietrantonio commented 1 month ago

Before this fix, users could not create environments as they would have been placed in the system-wide installation.

This PR addresses #272

dipietrantonio commented 1 month ago

Here is how I tested it

  1. Install spack
    
    cdipietrantonio@setonix-06:/software/projects/pawsey0001/cdipietrantonio/pawsey-spack-config/scripts> vi ../systems/setonix/settings.sh 
    cdipietrantonio@setonix-06:/software/projects/pawsey0001/cdipietrantonio/pawsey-spack-config/scripts> export INSTALL_PREFIX=$MYSCRATCH/test-spack-env/2024.05-tmp
    cdipietrantonio@setonix-06:/software/projects/pawsey0001/cdipietrantonio/pawsey-spack-config/scripts> export INSTALL_GROUP=pawsey0001
    cdipietrantonio@setonix-06:/software/projects/pawsey0001/cdipietrantonio/pawsey-spack-config/scripts> ./install_spack.sh 
    Cloning into '/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/spack'...
    remote: Enumerating objects: 566510, done.
    remote: Counting objects: 100% (2580/2580), done.
    remote: Compressing objects: 100% (1441/1441), done.
    remote: Total 566510 (delta 834), reused 1984 (delta 432), pack-reused 563930
    Receiving objects: 100% (566510/566510), 190.90 MiB | 9.62 MiB/s, done.
    Resolving deltas: 100% (264109/264109), done.
    Updating files: 100% (11720/11720), done.
    Updating files: 100% (9558/9558), done.
    Note: switching to 'v0.21.0'.

You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by switching back to a branch.

If you want to create a new branch to retain commits you create, you may do so (now or later) by using -c with the switch command. Example:

git switch -c

Or undo this operation with:

git switch -

Turn off this advice by setting config variable advice.detachedHead to false

HEAD is now at 65d3221a9c Update version and CHANGELOG.md for v0.21.0 patching file /scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/spack/lib/spack/spack/modules/lmod.py patch unexpectedly ends in middle of line Hunk #1 succeeded at 252 with fuzz 2 (offset 29 lines). patching file /scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/spack/lib/spack/spack/modules/common.py Hunk #1 succeeded at 70 (offset -25 lines). Hunk #2 succeeded at 592 (offset -24 lines). Hunk #3 succeeded at 914 (offset 62 lines). patching file /scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/spack/lib/spack/spack/cmd/modules/init.py patch unexpectedly ends in middle of line Hunk #1 succeeded at 329 with fuzz 2 (offset 1 line). patching file /scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/spack/lib/spack/spack/paths.py Hunk #1 succeeded at 76 (offset 1 line). Hunk #2 succeeded at 102 with fuzz 1 (offset 1 line). Hunk #3 succeeded at 137 (offset 1 line).


2. Activate spack and create envs

cdipietrantonio@setonix-01:~> cd $MYSCRATCH/ cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio> cd test-spack-env/ cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env> ls 2024.05-tmp cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env> cd 2024.05-tmp/ cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp> ls containers custom modules pawsey spack staff_modulefiles cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp> . spack/share/spack/setup-env.sh cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp> spack env create mytempenv ==> Created environment 'mytempenv' in /software/projects/pawsey0001/cdipietrantonio/setonix/2024.05-tmp/environments/mytempenv ==> You can activate this environment with: ==> spack env activate mytempenv cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp> spack project env create myothertempenv ==> Created environment 'myothertempenv' in /software/projects/pawsey0001/setonix/2024.05-tmp/environments/myothertempenv ==> You can activate this environment with: ==> spack env activate myothertempenv ==> Warning: upstream not found: /scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp/software/.spack-db/index.json cdipietrantonio@setonix-01:/scratch/pawsey0001/cdipietrantonio/test-spack-env/2024.05-tmp>