Skip to content

Commit b9cf3f4

Browse files
committed
revert to using secret
1 parent aebafa5 commit b9cf3f4

File tree

1 file changed

+6
-39
lines changed

1 file changed

+6
-39
lines changed

.github/workflows/fatimage.yml

Lines changed: 6 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -44,42 +44,9 @@ jobs:
4444
echo "${{ secrets[format('{0}_CLOUDS_YAML', env.CI_CLOUD)] }}" > ~/.config/openstack/clouds.yaml
4545
shell: bash
4646

47-
- name: Create EC2 credentials if not present
48-
id: check_creds
49-
run: |
50-
. venv/bin/activate
51-
# List existing EC2 credentials
52-
existing_creds=$(openstack ec2 credentials list --format json)
53-
54-
# Check if the list is empty
55-
if [ "$(echo "$existing_creds" | jq 'length')" -eq 0 ]; then
56-
echo "No existing EC2 credentials found."
57-
new_creds=$(openstack ec2 credentials create --format json)
58-
access_key=$(echo "$new_creds" | jq -r '.Access')
59-
secret_key=$(echo "$new_creds" | jq -r '.Secret')
60-
echo "Created new EC2 credentials."
61-
else
62-
echo "Existing EC2 credentials found."
63-
access_key=$(echo "$existing_creds" | jq -r '.[0].Access')
64-
secret_key=$(echo "$existing_creds" | jq -r '.[0].Secret')
65-
fi
66-
67-
# Save access and secret keys for the next step
68-
echo "access_key=${access_key}" >> $GITHUB_ENV
69-
echo "secret_key=${secret_key}" >> $GITHUB_ENV
70-
shell: bash
71-
7247
- name: Write s3cmd configuration
7348
run: |
74-
cat <<EOF > ~/.s3cfg
75-
[default]
76-
host_base = https://object.arcus.openstack.hpc.cam.ac.uk
77-
host_bucket = https://object.arcus.openstack.hpc.cam.ac.uk
78-
access_key = ${{ env.access_key }}
79-
secret_key = ${{ env.secret_key }}
80-
use_https = True
81-
signurl_use_https = True
82-
EOF
49+
echo "${{ secrets['ARCUS_S3_CFG'] }}" > ~/.s3cfg
8350
shell: bash
8451

8552
- name: Install s3cmd
@@ -94,8 +61,8 @@ jobs:
9461
echo "TARGET_IMAGE=${TARGET_IMAGE}" >> "$GITHUB_ENV"
9562
echo "target-image-${{ matrix.build }}=${TARGET_IMAGE}" >> "$GITHUB_OUTPUT"
9663
97-
S3_IMAGES=$(s3cmd ls s3://openhpc-images)
98-
64+
S3_IMAGES=$(s3cmd ls s3://openhpc-images-prerelease)
65+
9966
if echo "$S3_IMAGES" | grep -q "$TARGET_IMAGE"; then
10067
echo "Image ${TARGET_IMAGE} is already present in S3."
10168
echo "IMAGE_EXISTS=true" >> $GITHUB_ENV
@@ -116,7 +83,7 @@ jobs:
11683
if: env.IMAGE_EXISTS == 'false'
11784
run: |
11885
echo "Uploading Image: ${{ env.TARGET_IMAGE }} to S3..."
119-
s3cmd put ${{ env.TARGET_IMAGE }}.qcow2 s3://openhpc-images
86+
s3cmd put ${{ env.TARGET_IMAGE }}.qcow2 s3://openhpc-images-prerelease
12087
shell: bash
12188

12289
image_sync:
@@ -168,10 +135,10 @@ jobs:
168135
TARGET_IMAGE=$(jq --arg version "${{ matrix.build }}" -r '.cluster_image[$version]' "${{ env.IMAGE_PATH }}")
169136
echo "TARGET_IMAGE=${TARGET_IMAGE}" >> "$GITHUB_ENV"
170137
171-
- name: Upload latest image if missing
138+
- name: Download latest image if missing
172139
run: |
173140
. venv/bin/activate
174-
bash .github/bin/get-s3-image.sh ${{ env.TARGET_IMAGE }} openhpc-images
141+
bash .github/bin/get-s3-image.sh ${{ env.TARGET_IMAGE }} openhpc-images-prerelease
175142
176143
- name: Cleanup OpenStack Image (on error or cancellation)
177144
if: cancelled()

0 commit comments

Comments
 (0)