Skip to content

Commit 3cfb7cc

Browse files
committed
swap CI from terraform to opentofu
1 parent 9ad7119 commit 3cfb7cc

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

.github/workflows/extra.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
8+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
99
- 'ansible/roles/doca/**'
1010
- 'ansible/roles/cuda/**'
1111
- 'ansible/roles/lustre/**'
1212
- '.github/workflows/extra.yml'
1313
pull_request:
1414
paths:
15-
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
15+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
1616
- 'ansible/roles/doca/**'
1717
- 'ansible/roles/cuda/**'
1818
- 'ansible/roles/lustre/**'
@@ -30,7 +30,7 @@ jobs:
3030
matrix: # build RL8, RL9
3131
build:
3232
- image_name: openhpc-extra-RL8
33-
source_image_name_key: RL8 # key into environments/.stackhpc/terraform/cluster_image.auto.tfvars.json
33+
source_image_name_key: RL8 # key into environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
3434
inventory_groups: doca,cuda,lustre
3535
volume_size: 30 # needed for cuda
3636
- image_name: openhpc-extra-RL9
@@ -51,7 +51,7 @@ jobs:
5151
run: |
5252
{
5353
echo 'FAT_IMAGES<<EOF'
54-
cat environments/.stackhpc/terraform/cluster_image.auto.tfvars.json
54+
cat environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
5555
echo EOF
5656
} >> "$GITHUB_ENV"
5757

.github/workflows/s3-image-sync.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
8+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
99
env:
1010
S3_BUCKET: openhpc-images-prerelease
11-
IMAGE_PATH: environments/.stackhpc/terraform/cluster_image.auto.tfvars.json
11+
IMAGE_PATH: environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
1212

1313
jobs:
1414
s3_cleanup:

.github/workflows/stackhpc.yml

+10-10
Original file line numberDiff line numberDiff line change
@@ -84,17 +84,17 @@ jobs:
8484
with:
8585
tofu_version: 1.6.2
8686

87-
- name: Initialise terraform
88-
run: terraform init
89-
working-directory: ${{ github.workspace }}/environments/.stackhpc/terraform
87+
- name: Initialise OpenTofu
88+
run: tofu init
89+
working-directory: ${{ github.workspace }}/environments/.stackhpc/tofu
9090

9191
- name: Write clouds.yaml
9292
run: |
9393
mkdir -p ~/.config/openstack/
9494
echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml
9595
shell: bash
9696

97-
- name: Setup environment-specific inventory/terraform inputs
97+
- name: Setup environment-specific inventory/tofu inputs
9898
run: |
9999
. venv/bin/activate
100100
. environments/.stackhpc/activate
@@ -108,15 +108,15 @@ jobs:
108108
run: |
109109
. venv/bin/activate
110110
. environments/.stackhpc/activate
111-
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
112-
terraform apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
111+
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
112+
tofu apply -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
113113
114114
- name: Delete infrastructure if provisioning failed
115115
run: |
116116
. venv/bin/activate
117117
. environments/.stackhpc/activate
118-
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
119-
terraform destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
118+
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
119+
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
120120
if: failure() && steps.provision_servers.outcome == 'failure'
121121

122122
- name: Configure cluster
@@ -213,8 +213,8 @@ jobs:
213213
run: |
214214
. venv/bin/activate
215215
. environments/.stackhpc/activate
216-
cd $APPLIANCES_ENVIRONMENT_ROOT/terraform
217-
terraform destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
216+
cd $APPLIANCES_ENVIRONMENT_ROOT/tofu
217+
tofu destroy -auto-approve -var-file="${{ env.CI_CLOUD }}.tfvars"
218218
if: ${{ success() || cancelled() }}
219219

220220
# - name: Delete images

.github/workflows/trivyscan.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ on:
55
branches:
66
- main
77
paths:
8-
- 'environments/.stackhpc/terraform/cluster_image.auto.tfvars.json'
8+
- 'environments/.stackhpc/tofu/cluster_image.auto.tfvars.json'
99

1010
jobs:
1111
scan:
@@ -18,7 +18,7 @@ jobs:
1818
matrix:
1919
build: ["RL8", "RL9"]
2020
env:
21-
JSON_PATH: environments/.stackhpc/terraform/cluster_image.auto.tfvars.json
21+
JSON_PATH: environments/.stackhpc/tofu/cluster_image.auto.tfvars.json
2222
OS_CLOUD: openstack
2323
CI_CLOUD: ${{ vars.CI_CLOUD }}
2424

0 commit comments

Comments
 (0)