Skip to content

Commit 078b949

Browse files
authored
Merge pull request #12 from stackhpc/2024.9.1-sync
2024.9.1 sync
2 parents 034f76c + f790632 commit 078b949

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

61 files changed

+762
-320
lines changed

.github-deploy-prod.yml.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,4 +50,4 @@ jobs:
5050
./bin/ensure-venv
5151
source ./bin/activate ${{ inputs.environment }}
5252
ansible-galaxy install -fr ./requirements.yml
53-
ansible-playbook stackhpc.azimuth_ops.provision
53+
ansible-playbook azimuth_cloud.azimuth_ops.provision

.github-deploy-staging.yml.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,4 @@ jobs:
3737
./bin/ensure-venv
3838
source ./bin/activate ${{ env.azimuth-config-env-name }}
3939
ansible-galaxy install -fr ./requirements.yml
40-
ansible-playbook stackhpc.azimuth_ops.provision
40+
ansible-playbook azimuth_cloud.azimuth_ops.provision

.github-upgrade-check.yml.sample

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
# This workflow compares a downstream azimuth-config repository for a specific site with the upstream
2+
# stackhpc/azimuth-config repository to check whether there is a new upstream version available. If a
3+
# newer tag is found in the upstream repository then a pull request is created to the downstream repo
4+
# in order to merge in the changes from the new upstream release.
5+
6+
# To use this workflow in a downstream azimuth-config repository simply copy it into .github/workflows
7+
# and give it an appropriate name, e.g.
8+
# cp .github-upgrade-check.yml.sample .github/workflows/upgrade-check.yml
9+
10+
name: Check for upstream updates
11+
on:
12+
schedule:
13+
- cron: "0 9 * * *"
14+
workflow_dispatch:
15+
jobs:
16+
check_for_update:
17+
runs-on: ubuntu-latest
18+
permissions:
19+
contents: write
20+
pull-requests: write
21+
steps:
22+
23+
- name: Checkout the config repo
24+
uses: actions/checkout@v4
25+
with:
26+
fetch-depth: 0
27+
fetch-tags: true
28+
29+
# Based on equivalent GitLab CI job
30+
- name: Check for new release
31+
shell: bash
32+
run: |
33+
set -xe
34+
35+
# Install dependency
36+
apt update && apt install -y git-crypt
37+
38+
# Tell git who we are for commits
39+
git config user.email "${{ github.actor }}[email protected]"
40+
git config user.name "${{ github.actor }} CI"
41+
42+
# Create the merge branch and write vars to .mergeenv file
43+
./bin/create-merge-branch
44+
45+
- name: Set release tag output
46+
id: release_tag
47+
if: ${{ hashFiles('.mergeenv') }}
48+
run: source .mergeenv && echo value=$RELEASE_TAG >> $GITHUB_OUTPUT
49+
50+
- name: Set branch name output
51+
id: branch_name
52+
if: ${{ hashFiles('.mergeenv') }}
53+
run: source .mergeenv && echo value=$BRANCH_NAME >> $GITHUB_OUTPUT
54+
55+
- name: Remove tmp file
56+
run: rm .mergeenv
57+
if: ${{ hashFiles('.mergeenv') }}
58+
59+
- name: Create Pull Request
60+
if: ${{ steps.release_tag.outputs.value }}
61+
uses: peter-evans/create-pull-request@v6
62+
with:
63+
base: main
64+
branch: ${{ steps.branch_name.outputs.value }}
65+
title: "Upgrade Azimuth to ${{ steps.release_tag.outputs.value }}"
66+
body: This PR was automatically generated by GitHub Actions.
67+
commit-message: "Upgrade Azimuth to ${{ steps.release_tag.outputs.value }}"
68+
delete-branch: true

.github/actions/destroy/action.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ runs:
99
set -e
1010
source ./ci.env
1111
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
12-
ansible-playbook stackhpc.azimuth_ops.destroy \
12+
ansible-playbook azimuth_cloud.azimuth_ops.destroy \
1313
-e @extra-vars.yml \
1414
-e force_destroy=true \
1515
-e capi_cluster_volumes_policy=delete
@@ -50,7 +50,7 @@ runs:
5050
if: ${{ always() }}
5151

5252
- name: Release S3 lock
53-
uses: stackhpc/github-actions/s3-lock@master
53+
uses: azimuth-cloud/github-actions/s3-lock@master
5454
with:
5555
host: ${{ steps.s3-lock-config.outputs.host }}
5656
access-key: ${{ steps.s3-lock-config.outputs.access-key }}

.github/actions/provision/action.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,4 @@ runs:
1010
set -e
1111
source ./ci.env
1212
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
13-
ansible-playbook stackhpc.azimuth_ops.provision -e @extra-vars.yml
14-
env:
15-
ANSIBLE_CALLBACKS_ENABLED: ansible.posix.profile_tasks
13+
ansible-playbook azimuth_cloud.azimuth_ops.provision -e @extra-vars.yml

.github/actions/release-notes/release-notes.py

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
"path": "roles/azimuth_identity_operator/defaults/main.yml",
3939
"version_key": "azimuth_identity_operator_chart_version",
4040
},
41+
{
42+
"name": "azimuth-schedule-operator",
43+
"path": "roles/azimuth_schedule_operator/defaults/main.yml",
44+
"version_key": "azimuth_schedule_operator_chart_version",
45+
},
4146
{
4247
"name": "zenith",
4348
"path": "roles/zenith/defaults/main.yml",
@@ -61,20 +66,30 @@
6166
{
6267
"name": "caas-workstation",
6368
"path": "roles/azimuth_caas_operator/defaults/main.yml",
64-
"version_key": "azimuth_caas_stackhpc_workstation_git_version",
69+
"version_key": [
70+
"azimuth_caas_workstation_default_git_version",
71+
"azimuth_caas_stackhpc_workstation_git_version",
72+
],
6573
},
6674
{
6775
"name": "caas-repo2docker",
6876
"path": "roles/azimuth_caas_operator/defaults/main.yml",
69-
"version_key": "azimuth_caas_stackhpc_repo2docker_git_version",
77+
"version_key": [
78+
"azimuth_caas_repo2docker_default_git_version",
79+
"azimuth_caas_stackhpc_repo2docker_git_version",
80+
],
7081
},
7182
{
7283
"name": "caas-r-studio-server",
7384
"path": "roles/azimuth_caas_operator/defaults/main.yml",
74-
"version_key": "azimuth_caas_stackhpc_rstudio_git_version",
85+
"version_key": [
86+
"azimuth_caas_rstudio_default_git_version",
87+
"azimuth_caas_stackhpc_rstudio_git_version",
88+
],
7589
},
7690
{
7791
"name": "ansible-slurm-appliance",
92+
"org": "stackhpc",
7893
"path": "roles/azimuth_caas_operator/defaults/main.yml",
7994
"version_key": "azimuth_caas_stackhpc_slurm_appliance_git_version",
8095
},
@@ -174,24 +189,31 @@ def fetch_component_version_for_ops_tag(session, tag, component):
174189
Returns the version of the specified component that is used in the specified azimuth-ops tag.
175190
"""
176191
response = session.get(
177-
f"{API_URL}/repos/stackhpc/ansible-collection-azimuth-ops/contents/{component['path']}",
192+
f"{API_URL}/repos/azimuth-cloud/ansible-collection-azimuth-ops/contents/{component['path']}",
178193
params = { "ref": tag },
179194
headers = { "Content-Type": "application/vnd.github.raw+json" }
180195
)
181196
response.raise_for_status()
182197
content = base64.b64decode(response.json()["content"])
183-
return yaml.safe_load(content)[component["version_key"]]
198+
data = yaml.safe_load(content)
199+
# In order to allow version keys to change between azimuth-ops versions, we support
200+
# specifying a list of keys which we try in order
201+
if isinstance(component["version_key"], list):
202+
version_keys = component["version_key"]
203+
else:
204+
version_keys = [component["version_key"]]
205+
return next(data[key] for key in version_keys if key in data)
184206

185207

186-
def release_notes_for_component(session, name, from_version, to_version):
208+
def release_notes_for_component(session, name, org, from_version, to_version):
187209
"""
188210
Produces the release notes for a component between the specified versions.
189211
"""
190212
print(f"[INFO] collecting release notes for {name}")
191213
release_notes = []
192214
for release in fetch_releases(
193215
session,
194-
f"stackhpc/{name}",
216+
f"{org}/{name}",
195217
min = from_version,
196218
inclusive_min = False,
197219
max = to_version,
@@ -228,11 +250,14 @@ def main():
228250
parser.add_argument(
229251
"--repo",
230252
help = "The config repository to target.",
231-
default = "stackhpc/azimuth-config"
253+
default = "azimuth-cloud/azimuth-config"
232254
)
233255
parser.add_argument("tag", help = "The tag to generate release notes for.")
234256
args = parser.parse_args()
235257

258+
# Make sure that the YAML SafeLoader respects Ansible's !unsafe tag
259+
yaml.SafeLoader.add_constructor("!unsafe", yaml.SafeLoader.construct_scalar)
260+
236261
session = github_session(args.token)
237262

238263
print(f"[INFO] fetching release for tag - {args.tag}")
@@ -267,6 +292,7 @@ def main():
267292
release_notes_for_component(
268293
session,
269294
"ansible-collection-azimuth-ops",
295+
"azimuth-cloud",
270296
previous_ops_tag,
271297
current_ops_tag
272298
)
@@ -290,6 +316,7 @@ def main():
290316
release_notes_for_component(
291317
session,
292318
component['name'],
319+
component.get('org', 'azimuth-cloud'),
293320
component_vn_previous,
294321
component_vn_current
295322
)

.github/actions/setup/action.yml

Lines changed: 29 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ inputs:
44
repository:
55
description: The repository to use for the Azimuth configuration.
66
required: true
7-
default: stackhpc/azimuth-config
7+
default: azimuth-cloud/azimuth-config
88
ref:
99
description: The ref to use for the Azimuth configuration.
1010
required: true
@@ -75,7 +75,7 @@ runs:
7575
REQUIREMENTS_CONTENT: |
7676
---
7777
collections:
78-
- name: https://github.com/stackhpc/ansible-collection-azimuth-ops.git
78+
- name: https://github.com/azimuth-cloud/ansible-collection-azimuth-ops.git
7979
type: git
8080
version: ${{ inputs.azimuth-ops-version }}
8181
if: ${{ inputs.azimuth-ops-version != '' }}
@@ -134,7 +134,7 @@ runs:
134134
echo "bucket=${CI_S3_LOCK_BUCKET}" >> "$GITHUB_OUTPUT"
135135
136136
- name: Acquire S3 lock
137-
uses: stackhpc/github-actions/s3-lock@master
137+
uses: azimuth-cloud/github-actions/s3-lock@master
138138
with:
139139
host: ${{ steps.s3-lock-config.outputs.host }}
140140
access-key: ${{ steps.s3-lock-config.outputs.access-key }}
@@ -153,30 +153,43 @@ runs:
153153
ansible_var() {
154154
ANSIBLE_LOAD_CALLBACK_PLUGINS=true \
155155
ANSIBLE_STDOUT_CALLBACK=json \
156+
ANSIBLE_JSON_INDENT=0 \
156157
ansible -m debug -a "var=$1" -e @extra-vars.yml all | \
157-
jq -r ".plays[0].tasks[0].hosts.localhost.$1"
158+
jq -r -R "fromjson? | .plays[0].tasks[0].hosts.localhost.$1"
158159
}
159160
160161
EXTNET_ID="$(ansible_var infra_external_network_id)"
161162
INSTALL_MODE="$(ansible_var install_mode)"
162163
163-
INGRESS_IP="$(
164-
openstack floating ip create $EXTNET_ID \
165-
--description "ingress IP for $AZIMUTH_ENVIRONMENT" \
166-
--format value \
167-
--column floating_ip_address
168-
)"
164+
until \
165+
INGRESS_IP="$(
166+
openstack floating ip create $EXTNET_ID \
167+
--description "ingress IP for $AZIMUTH_ENVIRONMENT" \
168+
--format value \
169+
--column floating_ip_address
170+
)"
171+
do
172+
echo "waiting for ingress IP to become available"
173+
sleep 60
174+
done
175+
echo "assigned $INGRESS_IP for ingress"
169176
cat >> ci.env <<EOF
170177
export INGRESS_IP="$INGRESS_IP"
171178
EOF
172179
173180
if [ "$INSTALL_MODE" = "ha" ]; then
174-
ZENITH_SSHD_IP="$(
175-
openstack floating ip create $EXTNET_ID \
176-
--description "Zenith SSHD IP for $AZIMUTH_ENVIRONMENT" \
177-
--format value \
178-
--column floating_ip_address
179-
)"
181+
until \
182+
ZENITH_SSHD_IP="$(
183+
openstack floating ip create $EXTNET_ID \
184+
--description "Zenith SSHD IP for $AZIMUTH_ENVIRONMENT" \
185+
--format value \
186+
--column floating_ip_address
187+
)"
188+
do
189+
echo "waiting for Zenith SSHD IP to become available"
190+
sleep 60
191+
done
192+
echo "assigned $ZENITH_SSHD_IP for Zenith SSHD"
180193
cat >> ci.env <<EOF
181194
export ZENITH_SSHD_IP="$ZENITH_SSHD_IP"
182195
EOF

.github/actions/test/action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ runs:
2828
set -e
2929
source ./ci.env
3030
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
31-
ansible-playbook stackhpc.azimuth_ops.generate_tests -e @extra-vars.yml
31+
ansible-playbook azimuth_cloud.azimuth_ops.generate_tests -e @extra-vars.yml
3232
3333
- name: Run test suite
3434
shell: bash

.github/environments/arcus-ha/ansible.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
inventory = ../../../environments/base/inventory,../../../environments/ha/inventory,../../../environments/demo/inventory,../common/inventory,../arcus/inventory,./inventory
33
roles_path = ../../../.ansible/roles
44
collections_path = ../../../.ansible/collections
5+
stdout_callback = yaml
6+
bin_ansible_callbacks = True
7+
callbacks_enabled = ansible.posix.profile_tasks
58

9+
# Disable host key checking as hosts are dynamically replaced
610
host_key_checking = False
711

812
[ssh_connection]
13+
pipelining = True
14+
ssh_extra_args = -o ControlPersist=1h
915
retries = 3

.github/environments/arcus/ansible.cfg

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
inventory = ../../../environments/base/inventory,../../../environments/singlenode/inventory,../../../environments/demo/inventory,../common/inventory,./inventory
33
roles_path = ../../../.ansible/roles
44
collections_path = ../../../.ansible/collections
5+
stdout_callback = yaml
6+
bin_ansible_callbacks = True
7+
callbacks_enabled = ansible.posix.profile_tasks
58

9+
# Disable host key checking as hosts are dynamically replaced
610
host_key_checking = False
711

812
[ssh_connection]
13+
pipelining = True
14+
ssh_extra_args = -o ControlPersist=1h
915
retries = 3

0 commit comments

Comments
 (0)