From a066c6a462616ed84464c6c9ce981592ddbd4d85 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 1 Feb 2024 13:50:40 +1100 Subject: [PATCH 1/9] create-deployment-spack.yml: Added input for determining where in the environment spack should be installed --- .github/workflows/create-deployment-spack.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/create-deployment-spack.yml b/.github/workflows/create-deployment-spack.yml index 8f8fcbc..9ce8044 100644 --- a/.github/workflows/create-deployment-spack.yml +++ b/.github/workflows/create-deployment-spack.yml @@ -16,6 +16,12 @@ on: required: true default: main description: A version of ACCESS-NRI/spack-config + deployment-location: + type: string + required: true + description: | + A path in the deployment environment where Spack should be created. + For example, if it is `opt/spack`, spack will be installed under `opt/spack//` jobs: create-spack: name: Spack @@ -39,7 +45,7 @@ jobs: - name: Install env: - ROOT_VERSION_LOCATION: ${{ vars.ROOT_SPACK_LOCATION }}/${{ steps.strip.outputs.version-dir }} + ROOT_VERSION_LOCATION: ${{ inputs.deployment-location }}/${{ steps.strip.outputs.version-dir }} # This step will fail if `mkdir` fails to create a version directory (e.g. `0.20` is already deployed and exists) run: | ssh ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT' From 7743d9d64828a90976909e014cc1d1342e909ab1 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 1 Feb 2024 13:51:15 +1100 Subject: [PATCH 2/9] config: Added prerelease deployment environments and updated the associated schema --- config/deployment-environment.json | 3 +++ config/deployment-environment.schema.json | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/config/deployment-environment.json b/config/deployment-environment.json index 5e57e95..bb3ec0e 100644 --- a/config/deployment-environment.json +++ b/config/deployment-environment.json @@ -2,5 +2,8 @@ "$schema": "./deployment-environment.schema.json", "environments": [ "Gadi" + ], + "prerelease-environments": [ + "Gadi Prerelease" ] } \ No newline at end of file diff --git a/config/deployment-environment.schema.json b/config/deployment-environment.schema.json index 0519787..187c770 100644 --- a/config/deployment-environment.schema.json +++ b/config/deployment-environment.schema.json @@ -12,8 +12,14 @@ "items": { "type": "string" } + }, + "prerelease-environments": { + "type": "array", + "items": { + "type": "string" + } } }, - "required": ["environments"], + "required": ["environments", "prerelease-environments"], "additionalProperties": false } \ No newline at end of file From f708dd002d6f577f20bd3090181f7ce33c15d56f Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 1 Feb 2024 13:52:48 +1100 Subject: [PATCH 3/9] deploy-1-setup.yml: Added inputs for both type and version of the deployment, to account for prerelease deployments --- .github/workflows/deploy-1-setup.yml | 34 ++++++++++++++++++++++------ 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/.github/workflows/deploy-1-setup.yml b/.github/workflows/deploy-1-setup.yml index 32c10c6..cc6c96b 100644 --- a/.github/workflows/deploy-1-setup.yml +++ b/.github/workflows/deploy-1-setup.yml @@ -1,6 +1,16 @@ name: Deployment Setup on: workflow_call: + inputs: + type: + type: string + required: false + default: release + description: The type of deployment - either 'release' or 'prerelease' + version: + type: string + required: true + description: The version of the model being deployed jobs: setup-spack-env: name: Setup Spack Environment @@ -15,22 +25,31 @@ jobs: run: echo "model=$(echo ${{ github.event.repository.name }} | tr [:upper:] [:lower:])" >> $GITHUB_OUTPUT - name: Set Spack Env Name String id: get-env-name - # replace occurences of '.' with '_' in environment name as spack doesn't support '.'. Ex: 'access-om2-v1.0.0' -> 'access-om2-v1_0_0'. - run: echo "env-name=$(echo '${{ steps.get-model.outputs.model }}-${{ github.ref_name }}' | tr '.' '_')" >> $GITHUB_OUTPUT - + # replace occurences of '.' with '_' in environment name as spack doesn't support '.'. Ex: 'access-om2-v1.0.0' -> 'access-om2-v1_0_0'. + run: echo "env-name=$(echo '${{ steps.get-model.outputs.model }}-${{ inputs.version }}' | tr '.' '_')" >> $GITHUB_OUTPUT + setup-deployment-env: name: Setup Deployment Environment runs-on: ubuntu-latest outputs: deployment-environments: ${{ steps.get-deployment-environment.outputs.deployment-environments }} steps: - - name: Checkout config + - name: Checkout Config uses: actions/checkout@v4 with: repository: access-nri/build-cd - - name: Get environments + + - name: Get Environments id: get-deployment-environment - run: echo "deployment-environments=$(jq --compact-output '.environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + run: | + if [[ "${{ inputs.type }}" == "release" ]]; then + echo "deployment-environments=$(jq --compact-output '.environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + else if [[ "${{ inputs.type }}" == "prerelease" ]]; then + echo "deployment-environments=$(jq --compact-output '.prerelease-environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + else + echo "::error::The 'type' input was invalid. Check the inputs documentation." + exit 1 + fi deployment: name: Deployment @@ -43,8 +62,9 @@ jobs: deployment-environment: ${{ fromJson(needs.setup-deployment-env.outputs.deployment-environments) }} uses: access-nri/build-cd/.github/workflows/deploy-2-start.yml@main with: + type: ${{ inputs.type }} model: ${{ needs.setup-spack-env.outputs.model }} - version: ${{ github.ref_name }} + version: ${{ inputs.version }} env-name: ${{ needs.setup-spack-env.outputs.env-name }} deployment-environment: ${{ matrix.deployment-environment }} secrets: inherit From b232e8a9a0b81f8a69f42d3c02063f5bccb17eb9 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 1 Feb 2024 13:54:49 +1100 Subject: [PATCH 4/9] deploy-2-start.yml: Added deployment type input to disallow prerelease GitHub Releases --- .github/workflows/deploy-2-start.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/deploy-2-start.yml b/.github/workflows/deploy-2-start.yml index ecd5888..345605c 100644 --- a/.github/workflows/deploy-2-start.yml +++ b/.github/workflows/deploy-2-start.yml @@ -3,6 +3,10 @@ concurrency: ${{ inputs.deployment-environment }} on: workflow_call: inputs: + type: + type: string + required: true + description: The type of deployment - either 'release' or 'prerelease' model: type: string required: true @@ -72,11 +76,14 @@ jobs: # Release - name: Get Release Metadata + if: inputs.type == 'release' run: | rsync -e 'ssh -i ${{ steps.ssh.outputs.private-key-path }}' \ '${{ secrets.USER}}@${{ secrets.HOST_DATA }}:${{ vars.SPACK_LOCATION }}/var/spack/environments/${{ inputs.env-name }}/spack.*' \ ./${{ inputs.env-name }} + - name: Create Release + if: inputs.type == 'release' uses: softprops/action-gh-release@v0.1.15 with: tag_name: ${{ inputs.version }} From 8e8ce3aaf549eff497c21416ded1a145b8939f9b Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Thu, 1 Feb 2024 16:56:42 +1100 Subject: [PATCH 5/9] Added undeploy-*.yml workflows for removing deployments --- .github/workflows/undeploy-1-setup.yml | 55 ++++++++++++++++++++++++++ .github/workflows/undeploy-2-start.yml | 52 ++++++++++++++++++++++++ 2 files changed, 107 insertions(+) create mode 100644 .github/workflows/undeploy-1-setup.yml create mode 100644 .github/workflows/undeploy-2-start.yml diff --git a/.github/workflows/undeploy-1-setup.yml b/.github/workflows/undeploy-1-setup.yml new file mode 100644 index 0000000..7f467b8 --- /dev/null +++ b/.github/workflows/undeploy-1-setup.yml @@ -0,0 +1,55 @@ +name: Undeployment Setup +on: + workflow_call: + inputs: + version-pattern: + type: string + required: true + description: A wildcard-supported string for version(s) of the model being removed +jobs: + get-spack-env: + name: Get Spack Environment + runs-on: ubuntu-latest + outputs: + model: ${{ steps.get-model.outputs.model }} + env-name: ${{ steps.get-env-name.outputs.env-name }} + steps: + - name: Get Model + id: get-model + # for the cases where the repo name is in uppercase but the package name is lowercase (eg. access-nri/MOM5) + run: echo "model=$(echo ${{ github.event.repository.name }} | tr [:upper:] [:lower:])" >> $GITHUB_OUTPUT + - name: Set Spack Env Name String + id: get-env-name + # replace occurences of '.' with '_' in environment name as spack doesn't support '.'. Ex: 'access-om2-v1.0.0' -> 'access-om2-v1_0_0'. + run: echo "env-name=$(echo '${{ steps.get-model.outputs.model }}-${{ inputs.version-pattern }}' | tr '.' '_')" >> $GITHUB_OUTPUT + + get-prerelease-deployment-env: + name: Get Prerelease Deployment Environment + runs-on: ubuntu-latest + outputs: + deployment-environments: ${{ steps.get-deployment-environment.outputs.deployment-environments }} + steps: + - name: Checkout Config + uses: actions/checkout@v4 + with: + repository: access-nri/build-cd + + - name: Get Environments + id: get-deployment-environment + run: echo "deployment-environments=$(jq --compact-output '.prerelease-environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT + + + deployment: + name: Deployment + needs: + - get-spack-env + - get-prerelease-deployment-env + strategy: + fail-fast: false + matrix: + deployment-environment: ${{ fromJson(needs.get-prerelease-deployment-env.outputs.deployment-environments) }} + uses: access-nri/build-cd/.github/workflows/undeploy-2-start.yml@main + with: + deployment-environment: ${{ matrix.deployment-environment }} + env-name: ${{ needs.get-spack-env.outputs.env-name }} + secrets: inherit diff --git a/.github/workflows/undeploy-2-start.yml b/.github/workflows/undeploy-2-start.yml new file mode 100644 index 0000000..35f6f96 --- /dev/null +++ b/.github/workflows/undeploy-2-start.yml @@ -0,0 +1,52 @@ +name: Undeployment Start +on: + workflow_call: + inputs: + env-name: + type: string + required: true + description: The spack-env-compliant model name to remove + deployment-environment: + type: string + required: true + description: The GitHub deployment environment name +jobs: + undeploy-from-environment: + name: Undeploy ${{ inputs.env-name }} from ${{ inputs.deployment-environment }} + runs-on: ubuntu-latest + environment: ${{ inputs.deployment-environment }} + steps: + - name: Setup SSH + id: ssh + uses: access-nri/actions/.github/actions/setup-ssh@main + with: + private-key: ${{ secrets.SSH_KEY }} + hosts: | + ${{ secrets.HOST }} + ${{ secrets.HOST_DATA }} + + - name: Undeploy + # ssh into deployment environment, create and activate the env, remove all the unneeded environments + id: undeploy + run: | + ssh ${{ secrets.USER}}@${{ secrets.HOST }} -i ${{ steps.ssh.outputs.private-key-path }} /bin/bash <<'EOT' + . ${{ vars.SPACK_CONFIG_LOCATION }}/spack-enable.bash + envs=$(find ${{ vars.SPACK_LOCATION }}/var/spack/environments -type d -name '${{ inputs.env-name }}' -printf '%f ') + + for env in $envs; do + spack env activate $env + spack uninstall --remove --dependents --yes-to-all --all + spack env deactivate $env + spack env rm $env --yes-to-all + done + spack gc --yes-to-all + EOT + + - name: Undeploy Status Notifier + if: always() + run: | + if [[ "${{ steps.undeploy.outcome }}" == "success" ]]; then + echo "::notice::Deployment ${{ inputs.env-name }} was successfully removed from ${{ inputs.deployment-environment }}" + else + echo "::error::Deployment ${{ inputs.env-name }} couldn't be removed from ${{ inputs.deployment-environment}}. Please check manually." + fi From 1fd1b84c72d3de7d87ae7f0a242175412dd16b92 Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Fri, 2 Feb 2024 11:16:39 +1100 Subject: [PATCH 6/9] README.md: Added usage instructions and notes on workflows --- README.md | 87 ++++++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 74 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 91594cb..87748b0 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,102 @@ # build-cd -This repository houses reusable workflows for the building and deployment of ACCESS-NRI models to different environments. +This repository houses reusable workflows for the building and deployment of ACCESS-NRI models to different environments. ## Overview -This repository is broken down into two folders: `config` and `.github/workflows`. +This repository is broken down into two folders: `config` and `.github/workflows`. -`config` contains information on the deployment environments that the models deploy to, which is currently just the name of the deployment target. This is used by the aforementioned deployment workflows to gather secrets and configuration details from the associated GitHub Environment. +`config` contains information on the deployment environments that the models deploy to, which is currently just the name of the deployment target. This is used by the aforementioned deployment workflows to gather secrets and configuration details from the associated GitHub Environment. `.github/workflows` houses validation and reusable deployment workflows that are called by ACCESS-NRI model repositories. Currently, only [ACCESS-NRI/ACCESS-OM2](https://github.com/ACCESS-NRI/access-om2) is supported. -Below is a brief summary of the two pipelines, `deploy-*` and `validate-json`. +Below is a brief summary of the three pipelines, `deploy-*`, `undeploy-*` and `validate-json`. -### deploy-* +### `deploy-*` -This pipeline is responsible for the gathering of configuration information, building and deployment of whatever model repository calls it. It is split into two workflows, as noted below. +#### Inputs -#### deploy-1-setup.yml +| Name | Type | Description | Required | Default | Example | +| ---- | ---- | ----------- | -------- | ------- | ------- | +| `type` | string | The type of deployment - either 'release' or 'prerelease' | true | `release` | `prerelease` | +| `version` | string | The version of the model being deployed | true | N/A | `2024.01.1` | -This workflow obtains the relevant spack and GitHub Environment information, and creates parallelized deployments based on the list of environments. +#### Explanation -#### deploy-2-start.yml +This pipeline is responsible for the gathering of configuration information, building and deployment of whatever model repository calls it. It is split into two workflows. -Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository. +##### `deploy-1-setup.yml` -### validate-json +This workflow obtains the relevant spack and GitHub Environment information, and creates parallelized deployments based on the list of environments. -This workflow is used to validate the `config` folders `*.json` files based on their associated `*.schema.json`. This is used for PR checks on the `build-cd` repo itself. +##### `deploy-2-start.yml` + +Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment. + +### `undeploy-*` + +#### Inputs + +| Name | Type | Description | Required | Default | Example | +| ---- | ---- | ----------- | -------- | ------- | ------- | +| `version-pattern` | string | A wildcard-supported string for version(s) of the model being removed | true | N/A | `2024.01.1-pre*` | + +#### Explanation + +This pipeline is responsible for removing deployed models from a deployment environment. Particular use-cases include removing `prerelease` builds from a deployment environment once a PR is merged. + +##### `undeploy-1-setup.yml` + +This workflow obtains the relevant spack and GitHub Environment information, and creates parallelized jobs removing the given `spack` environments based on the list of deployment environments. + +##### `undeploy-2-start.yml` + +Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment. + +### `validate-json.yml` + +This workflow is used to validate the `config` folders `*.json` files based on their associated `*.schema.json`. This is used for PR checks on the `build-cd` repo itself. + +### `create-deployment-spack.yml` + +This workflow is used to create a version of `spack` on `Gadi`. + +#### Inputs + +| Name | Type | Description | Required | Default | Example | +| ---- | ---- | ----------- | -------- | ------- | ------- | +| `spack-version` | string | A version of `spack` | true | N/A | `0.20` | +| `spack-packages-version` | string | A version of ACCESS-NRI/spack-packages to be bundled with the install of `spack` | true | `main` | `2023.11.12` | +| `spack-config-version` | string | A version of ACCESS-NRI/spack-config to be bundled with the install of `spack` | true | `main` | `2024.01.01` | +| `deployment-location` | true | A path in the deployment environment where Spack should be created. For example, if it is `opt/spack`, spack will be installed under `opt/spack//` | true | N/A | `/opt/spack` | ## Usage -For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, like so: +### Deployment + +For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, as shown below. Don't forget to add required inputs! ```yml deploy: uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main + with: + type: release + version: 1.2.3 secrets: inherit permissions: contents: write ``` + +### Removing Deployment + +For given `spack` environments, we can also remove deployments. For example: + +```yml +remove-prereleases: + uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main + with: + version-pattern: ${{ inputs.model }}-pre* + secrets: inherit +``` + +This will remove every `spack` environment from the deployment target that matches `-pre*`. From 22c0daa654c74ef1d6b40ccc5bb3b636c0158abe Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Mon, 5 Feb 2024 10:36:25 +1100 Subject: [PATCH 7/9] undeploy-1-setup.yml: Renamed deployment job to 'undeployment' --- .github/workflows/undeploy-1-setup.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/undeploy-1-setup.yml b/.github/workflows/undeploy-1-setup.yml index 7f467b8..5a6136b 100644 --- a/.github/workflows/undeploy-1-setup.yml +++ b/.github/workflows/undeploy-1-setup.yml @@ -39,8 +39,8 @@ jobs: run: echo "deployment-environments=$(jq --compact-output '.prerelease-environments' ./config/deployment-environment.json)" >> $GITHUB_OUTPUT - deployment: - name: Deployment + undeployment: + name: Remove Deployment needs: - get-spack-env - get-prerelease-deployment-env From 60811d483d0866a7ae8fbb10d63681dbc7ca343d Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Mon, 5 Feb 2024 12:43:15 +1100 Subject: [PATCH 8/9] Added README.md changes and more debug output --- .github/workflows/undeploy-2-start.yml | 4 +- README.md | 74 +++++++++++++++----------- 2 files changed, 44 insertions(+), 34 deletions(-) diff --git a/.github/workflows/undeploy-2-start.yml b/.github/workflows/undeploy-2-start.yml index 35f6f96..110c623 100644 --- a/.github/workflows/undeploy-2-start.yml +++ b/.github/workflows/undeploy-2-start.yml @@ -46,7 +46,7 @@ jobs: if: always() run: | if [[ "${{ steps.undeploy.outcome }}" == "success" ]]; then - echo "::notice::Deployment ${{ inputs.env-name }} was successfully removed from ${{ inputs.deployment-environment }}" + echo "::notice::Deployment ${{ inputs.env-name }} was successfully removed from ${{ inputs.deployment-environment }}, found at ${{ vars.SPACK_LOCATION }}" else - echo "::error::Deployment ${{ inputs.env-name }} couldn't be removed from ${{ inputs.deployment-environment}}. Please check manually." + echo "::error::Deployment ${{ inputs.env-name }} couldn't be removed from ${{ inputs.deployment-environment}}, found at ${{ vars.SPACK_LOCATION }}. Please check manually." fi diff --git a/README.md b/README.md index 87748b0..39f19cd 100644 --- a/README.md +++ b/README.md @@ -33,8 +33,35 @@ This workflow obtains the relevant spack and GitHub Environment information, and Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment. +#### Usage + +For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, as shown below. Don't forget to add required inputs! + +```yml +deploy: + uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main + with: + version: 1.2.3 + secrets: inherit + permissions: + contents: write +``` + ### `undeploy-*` +For given `spack` environments, we can also remove deployments. For example: + +```yml +remove-prereleases: + uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main + with: + version-pattern: ${{ inputs.model }}-* + secrets: inherit +``` + +This will remove every `spack` environment from the deployment target that matches `-*`. + + #### Inputs | Name | Type | Description | Required | Default | Example | @@ -53,13 +80,27 @@ This workflow obtains the relevant spack and GitHub Environment information, and Using the GitHub Environment, it `ssh`s into the deployment environments `spack` instance, and installs the model associated with the repository that called it. It then copies back relevant metadata and creates a versioned GitHub Release in the caller repository, if it is not a `prerelease` deployment. +#### Usage + +For given `spack` environments, we can also remove deployments. For example: + +```yml +remove-prereleases: + uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main + with: + version-pattern: ${{ inputs.model }}-pre* + secrets: inherit +``` + +This will remove every `spack` environment from the deployment target that matches `-pre*`. + ### `validate-json.yml` This workflow is used to validate the `config` folders `*.json` files based on their associated `*.schema.json`. This is used for PR checks on the `build-cd` repo itself. ### `create-deployment-spack.yml` -This workflow is used to create a version of `spack` on `Gadi`. +This workflow_dispatch-triggered workflow is used to create a version of `spack` on `Gadi`. #### Inputs @@ -69,34 +110,3 @@ This workflow is used to create a version of `spack` on `Gadi`. | `spack-packages-version` | string | A version of ACCESS-NRI/spack-packages to be bundled with the install of `spack` | true | `main` | `2023.11.12` | | `spack-config-version` | string | A version of ACCESS-NRI/spack-config to be bundled with the install of `spack` | true | `main` | `2024.01.01` | | `deployment-location` | true | A path in the deployment environment where Spack should be created. For example, if it is `opt/spack`, spack will be installed under `opt/spack//` | true | N/A | `/opt/spack` | - -## Usage - -### Deployment - -For supported `spack`-installable ACCESS-NRI models, simply call the `deploy-1-setup.yml` reusable workflow from the given repositories workflow file, as shown below. Don't forget to add required inputs! - -```yml -deploy: - uses: access-nri/build-cd/.github/workflows/deploy-1-setup.yml@main - with: - type: release - version: 1.2.3 - secrets: inherit - permissions: - contents: write -``` - -### Removing Deployment - -For given `spack` environments, we can also remove deployments. For example: - -```yml -remove-prereleases: - uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main - with: - version-pattern: ${{ inputs.model }}-pre* - secrets: inherit -``` - -This will remove every `spack` environment from the deployment target that matches `-pre*`. From 79f834113a77bc72c4ceb20d1b29c3970b81753b Mon Sep 17 00:00:00 2001 From: Tommy Gatti Date: Mon, 5 Feb 2024 14:23:51 +1100 Subject: [PATCH 9/9] README.md: Made it explicit that you don't need to use this workflow directly. --- README.md | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 39f19cd..03d826e 100644 --- a/README.md +++ b/README.md @@ -49,18 +49,10 @@ deploy: ### `undeploy-*` -For given `spack` environments, we can also remove deployments. For example: - -```yml -remove-prereleases: - uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main - with: - version-pattern: ${{ inputs.model }}-* - secrets: inherit -``` - -This will remove every `spack` environment from the deployment target that matches `-*`. +For given `spack` environments, we can also remove deployments. +> [!NOTE] +> This workflow is not one that should be used directly. It is used within the automated deployment pipeline to remove prerelease builds of models. #### Inputs @@ -82,8 +74,6 @@ Using the GitHub Environment, it `ssh`s into the deployment environments `spack` #### Usage -For given `spack` environments, we can also remove deployments. For example: - ```yml remove-prereleases: uses: access-nri/build-cd/.github/workflows/undeploy-2-setup.yml@main