Skip to content

Commit f82ca40

Browse files
committed
get-deploy-paths: Remove spack-package* outputs
Release instances of spack manage spack-packages, and Prerelease instances have spack-packages under the environment folder
1 parent 3daea16 commit f82ca40

File tree

3 files changed

+6
-31
lines changed

3 files changed

+6
-31
lines changed

.github/actions/get-deploy-paths/action.yml

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -25,31 +25,24 @@ inputs:
2525
required: true
2626
description: |
2727
Spack environment name that is used for this deployment.
28-
Used to construct Prerelease spack-packages path, which is demarcated by the environment name.
2928
outputs:
3029
root:
3130
description: |
3231
Path to the root of a specific deployment of `spack`.
33-
This path contains `spack-{packages,config}` repositories as well.
32+
This path contains `spack-config` and various `spack-packages` repositories in it's hierarchy as well.
3433
value: ${{ steps.path.outputs.root }}
3534
spack:
3635
description: Path to a specific installation of `spack`.
3736
value: ${{ steps.path.outputs.spack }}
3837
spack-config:
3938
description: Path to the ACCESS-NRI/spack-config repository associated with the install of spack.
4039
value: ${{ steps.path.outputs.spack-config }}
41-
spack-packages-root:
42-
description: |
43-
Path to the folder containing all ACCESS-NRI/spack-packages repositories used in the install of spack.
44-
For Release inputs.deployment-type, this is the repository itself.
45-
For Prerelease inputs.deployment-type, this is the folder containing multiple spack-packages repositories.
46-
value: ${{ steps.path.outputs.spack-packages-root }}
47-
spack-packages:
48-
description: Path to the ACCESS-NRI/spack-packages repository associated with the environment created in the install of spack.
49-
value: ${{ steps.path.outputs.spack-packages }}
5040
spack-environment:
51-
description: Path to the spack environment folder for the given inputs.spack-environment.
41+
description: Path to the spack environment folder for the given inputs.spack-environment. Also contains the `spack-packages` repository for Prerelease deployments.
5242
value: ${{ steps.path.outputs.spack-environment }}
43+
# Regarding our other important repository path, spack-packages:
44+
# Release instances of spack-packages are now managed by spack itself via `spack repo` commands, so deployment doesn't actually need to know where it is.
45+
# Prerelease instances of spack-packages are located within the outputs.spack-environment folder, and are removed when that environment is removed, so there is no need to track them either.
5346
runs:
5447
using: composite
5548
steps:
@@ -79,12 +72,4 @@ runs:
7972
echo "root=$root" >> $GITHUB_OUTPUT
8073
echo "spack=$root/spack" >> $GITHUB_OUTPUT
8174
echo "spack-config=$root/spack-config" >> $GITHUB_OUTPUT
82-
echo "spack-packages-root=$root/spack-packages" >> $GITHUB_OUTPUT
83-
84-
if [[ '${{ steps.validate.outputs.type }}' == Release ]]; then
85-
echo "spack-packages=$root/spack-packages" >> $GITHUB_OUTPUT
86-
elif [[ '${{ steps.validate.outputs.type }}' == Prerelease ]]; then
87-
echo "spack-packages=$root/spack-packages/${{ inputs.spack-environment }}/spack-packages" >> $GITHUB_OUTPUT
88-
fi
89-
9075
echo "spack-environment=$root/environments/${{ inputs.spack-environment }}" >> $GITHUB_OUTPUT

.github/workflows/deploy-2-start.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -149,7 +149,7 @@ jobs:
149149
python -m scripts.spack_manifest.injection.prerelease \
150150
--manifest ../${{ inputs.spack-manifest-path }} \
151151
--version ${{ inputs.version }} \
152-
--spack-packages-path ${{ steps.path.outputs.spack-packages }} \
152+
--spack-packages-path ${{ steps.path.outputs.spack-environment }}/access-spack-packages \
153153
--output ../${{ inputs.spack-manifest-path }}
154154
155155
- name: Copy ${{ inputs.spack-manifest-path }}

.github/workflows/undeploy-1-start.yml

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -83,16 +83,6 @@ jobs:
8383
spack gc --except-any-environment --yes-to-all
8484
EOT
8585
86-
- name: Undeploy spack-packages
87-
# ssh into deployment environment, remove all the unneeded spack-packages installations
88-
run: |
89-
ssh ${{ secrets.USER}}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT'
90-
find "${{ steps.path.outputs.spack-packages-root }}" \
91-
-mindepth 1 -maxdepth 1 \
92-
-type d -name "${{ inputs.version-pattern }}" \
93-
-exec rm -rfv {} +
94-
EOT
95-
9686
- name: Undeploy Status Notifier
9787
if: failure()
9888
run: echo '::error::Deployment ${{ inputs.version-pattern }} could not be removed from ${{ inputs.target }} ${{ inputs.type }}, found at ${{ steps.path.outputs.spack }}. Please check manually.'

0 commit comments

Comments
 (0)