Skip to content

Commit c4770b2

Browse files
committed
Hide sensitive output from slurm-infra playbook
1 parent 3677cf5 commit c4770b2

File tree

2 files changed

+17
-11
lines changed

2 files changed

+17
-11
lines changed

.github/workflows/build-image-deploy.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,17 +30,17 @@ jobs:
3030
uses: actions/checkout@v3
3131
with:
3232
submodules: true
33-
33+
3434
- name: Install ansible etc
3535
run: dev/setup-env.sh
36-
36+
3737
- name: Write clouds.yaml
3838
run: |
3939
echo "${CLOUDS_YAML}" > ${OS_CLIENT_CONFIG_FILE}
4040
shell: bash
4141
env:
4242
CLOUDS_YAML: ${{ secrets.CLOUDS_YAML }}
43-
43+
4444
- name: Build OHPC image
4545
id: build
4646
run: |
@@ -54,7 +54,7 @@ jobs:
5454
echo "CLUSTER_IMAGE=$(cat cluster_image_uuid.txt)" >> $GITHUB_OUTPUT
5555
env:
5656
PACKER_LOG_PATH: ${{ github.workspace }}/packer-build.log
57-
57+
5858
- name: Remove image build infra
5959
run: |
6060
source venv/bin/activate
@@ -65,7 +65,7 @@ jobs:
6565
-e image_build_cluster_id="image-build-${GITHUB_SHA::7}" \
6666
image-build.yml
6767
if: always()
68-
68+
6969
- name: Deploy a cluster based on the new OPHC image
7070
id: deploy
7171
run: |
@@ -76,8 +76,10 @@ jobs:
7676
-e cluster_image=${{ steps.build.outputs.CLUSTER_IMAGE }} \
7777
-e cluster_name="caas-ci-${GITHUB_SHA::7}" \
7878
slurm-infra.yml
79+
env:
80+
SLURM_INFRA_HIDE_DEBUG_OUTPUT: True
7981
if: success()
80-
82+
8183
- name: Remove cluster based on the new OHPC image
8284
run: |
8385
source venv/bin/activate
@@ -88,10 +90,10 @@ jobs:
8890
-e cluster_state=absent \
8991
-e cluster_name="caas-ci-${GITHUB_SHA::7}" \
9092
slurm-infra.yml
91-
if: |
93+
if: |
9294
( success() || failure() || cancelled() ) &&
9395
steps.build.outcome == 'success'
94-
96+
9597
- name: Delete built image after testing
9698
run: |
9799
source venv/bin/activate
@@ -100,11 +102,11 @@ jobs:
100102
-e cluster_image=${{ steps.build.outputs.CLUSTER_IMAGE }} \
101103
-e '{"cluster_image_delete": true}' \
102104
image-build/image-delete-or-promote.yml
103-
if: |
105+
if: |
104106
( success() || failure() || cancelled() ) &&
105107
steps.build.outcome == 'success' &&
106108
github.event_name == 'pull_request'
107-
109+
108110
- name: Promote built image from Private to Community after testing
109111
run: |
110112
source venv/bin/activate
@@ -119,7 +121,7 @@ jobs:
119121
steps.deploy.outcome == 'success' &&
120122
(( github.event_name == 'workflow_dispatch' && inputs.promote_community == true )
121123
|| github.event_name == 'push' )
122-
124+
123125
- name: Upload packer build log artifact
124126
uses: actions/upload-artifact@v3
125127
with:

slurm-infra.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,8 +123,12 @@
123123

124124
# Write the outputs as the final task
125125
- hosts: localhost
126+
vars:
127+
hide_debug_outputs: "{{ lookup('ansible.builtin.env', 'SLURM_INFRA_HIDE_DEBUG_OUTPUT', default=false) | bool }}"
126128
tasks:
127129
- debug: var=outputs
130+
when:
131+
- not hide_debug_outputs
128132
vars:
129133
# Ansible has a fit when there are two 'hostvars' evaluations in a resolution chain,
130134
# so we have to repeat logic here unfortunately

0 commit comments

Comments
 (0)