Skip to content

Commit add00be

Browse files
author
scrungus
committed
Merge remote-tracking branch 'upstream/devel'
2 parents dcf4399 + eb6bd08 commit add00be

Some content is hidden

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

60 files changed

+1668
-404
lines changed

.github/actions/destroy/action.yml

Lines changed: 44 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,48 @@ runs:
1818
set -eo pipefail
1919
source ci.env
2020
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
21-
FIP_ID="$(openstack floating ip list --tags "$AZIMUTH_ENVIRONMENT" -f json | jq -r '.[0].ID // ""')"
22-
[ -n "$FIP_ID" ] && openstack floating ip delete $FIP_ID
23-
env:
24-
INGRESS_IP: ${{ steps.ingress-ip.outputs.ip-address }}
21+
if [ -n "$INGRESS_IP" ]; then
22+
openstack floating ip delete $INGRESS_IP
23+
fi
24+
if: ${{ always() }}
25+
26+
- name: Configure S3 lock
27+
id: s3-lock-config
28+
shell: bash
29+
run: |
30+
set -e
31+
source ci.env
32+
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
33+
if [ -z "$CI_S3_LOCK_HOST" ]; then
34+
echo "CI_S3_LOCK_HOST not set - no lock will be used"
35+
exit
36+
elif [ -z "$CI_S3_LOCK_BUCKET" ]; then
37+
echo "CI_S3_LOCK_BUCKET is required when using the lock" >&2
38+
exit 1
39+
fi
40+
echo "host=${CI_S3_LOCK_HOST}" >> "$GITHUB_OUTPUT"
41+
echo "access-key=${CI_S3_LOCK_ACCESS_KEY}" >> "$GITHUB_OUTPUT"
42+
echo "secret-key=${CI_S3_LOCK_SECRET_KEY}" >> "$GITHUB_OUTPUT"
43+
echo "bucket=${CI_S3_LOCK_BUCKET}" >> "$GITHUB_OUTPUT"
44+
if: ${{ always() }}
45+
46+
- name: Release S3 lock
47+
uses: stackhpc/github-actions/s3-lock@master
48+
with:
49+
host: ${{ steps.s3-lock-config.outputs.host }}
50+
access-key: ${{ steps.s3-lock-config.outputs.access-key }}
51+
secret-key: ${{ steps.s3-lock-config.outputs.secret-key }}
52+
bucket: ${{ steps.s3-lock-config.outputs.bucket }}
53+
action: release
54+
if: ${{ steps.s3-lock-config.outputs.host != '' && always() }}
55+
56+
- name: Delete S3 credential
57+
shell: bash
58+
run: |
59+
set -e
60+
source ./ci.env
61+
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
62+
if [ -n "$CI_S3_LOCK_ACCESS_KEY" ]; then
63+
openstack ec2 credentials delete $CI_S3_LOCK_ACCESS_KEY
64+
fi
2565
if: ${{ always() }}

.github/actions/provision/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,5 @@ runs:
1111
source ./ci.env
1212
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
1313
ansible-playbook stackhpc.azimuth_ops.provision -e @extra-vars.yml
14+
env:
15+
ANSIBLE_CALLBACKS_ENABLED: ansible.posix.profile_tasks

.github/actions/setup/action.yml

Lines changed: 56 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,18 @@ inputs:
99
description: The ref to use for the Azimuth configuration.
1010
required: true
1111
default: devel
12-
config-environment:
13-
description: The config environment to use.
12+
target-cloud:
13+
description: |-
14+
The name of the cloud to target.
15+
This is used as both the name of the cloud with the clouds.yaml
16+
and to determine the config environment to use.
17+
Currently, arcus and leafcloud are supported.
1418
required: true
15-
default: ci
19+
default: arcus
20+
install-mode:
21+
description: The install mode to use. Either singlenode or ha.
22+
required: true
23+
default: singlenode
1624
azimuth-ops-version:
1725
description: >
1826
The azimuth-ops version to use. If not given, the default version is used.
@@ -26,21 +34,12 @@ inputs:
2634
os-clouds:
2735
description: The contents of the clouds.yaml to use.
2836
required: true
29-
os-cloud-name:
30-
description: The name of the cloud within the clouds.yaml to use.
31-
required: true
32-
default: openstack
3337
environment-prefix:
3438
description: >
3539
The environment prefix to use. The run ID will be appended to this,
3640
separated by a hyphen.
3741
required: true
3842
default: ci
39-
allocate-ingress-ip:
40-
description: >
41-
Indicates whether a floating IP should be allocated for ingress.
42-
required: true
43-
default: "yes"
4443
runs:
4544
using: composite
4645
steps:
@@ -63,9 +62,9 @@ runs:
6362
run: cat > ./ci.env <<< "$CI_ENV"
6463
env:
6564
CI_ENV: |
66-
export OS_CLOUD="${{ inputs.os-cloud-name }}"
65+
export OS_CLOUD="${{ inputs.target-cloud }}"
6766
export OS_CLIENT_CONFIG_FILE="$PWD/clouds.yaml"
68-
export AZIMUTH_CONFIG_ENVIRONMENT=${{ inputs.config-environment }}
67+
export AZIMUTH_CONFIG_ENVIRONMENT=${{ inputs.target-cloud }}${{ inputs.install-mode == 'ha' && '-ha' || '' }}
6968
export AZIMUTH_ENVIRONMENT="${{ inputs.environment-prefix }}-${{ github.run_id }}"
7069
export ANSIBLE_FORCE_COLOR=true
7170
@@ -108,32 +107,61 @@ runs:
108107
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
109108
ansible-galaxy install -f -r requirements.yml
110109
110+
# Generate and append the S3 credential to the CI environment file
111+
- name: Configure S3 lock
112+
id: s3-lock-config
113+
shell: bash
114+
run: |
115+
set -e
116+
source ci.env
117+
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
118+
if [ -z "$CI_S3_LOCK_HOST" ]; then
119+
echo "CI_S3_LOCK_HOST not set - no lock will be used"
120+
exit
121+
elif [ -z "$CI_S3_LOCK_BUCKET" ]; then
122+
echo "CI_S3_LOCK_BUCKET is required when using the lock" >&2
123+
exit 1
124+
fi
125+
CI_S3_LOCK_ACCESS_KEY="$(openstack ec2 credentials create -f value -c access)"
126+
CI_S3_LOCK_SECRET_KEY="$(openstack ec2 credentials show -f value -c secret $CI_S3_LOCK_ACCESS_KEY)"
127+
cat >> ci.env <<EOF
128+
export CI_S3_LOCK_ACCESS_KEY="$CI_S3_LOCK_ACCESS_KEY"
129+
export CI_S3_LOCK_SECRET_KEY="$CI_S3_LOCK_SECRET_KEY"
130+
EOF
131+
echo "host=${CI_S3_LOCK_HOST}" >> "$GITHUB_OUTPUT"
132+
echo "access-key=${CI_S3_LOCK_ACCESS_KEY}" >> "$GITHUB_OUTPUT"
133+
echo "secret-key=${CI_S3_LOCK_SECRET_KEY}" >> "$GITHUB_OUTPUT"
134+
echo "bucket=${CI_S3_LOCK_BUCKET}" >> "$GITHUB_OUTPUT"
135+
136+
- name: Acquire S3 lock
137+
uses: stackhpc/github-actions/s3-lock@master
138+
with:
139+
host: ${{ steps.s3-lock-config.outputs.host }}
140+
access-key: ${{ steps.s3-lock-config.outputs.access-key }}
141+
secret-key: ${{ steps.s3-lock-config.outputs.secret-key }}
142+
bucket: ${{ steps.s3-lock-config.outputs.bucket }}
143+
action: acquire
144+
if: ${{ steps.s3-lock-config.outputs.host != '' }}
145+
111146
- name: Allocate floating IP for ingress
112147
shell: bash
113148
run: |
114149
set -eo pipefail
115150
source ci.env
116151
source ./bin/activate "$AZIMUTH_CONFIG_ENVIRONMENT" "$AZIMUTH_ENVIRONMENT"
117-
ansible_variable() {
118-
ansible -m debug -a "var=$1" -e @extra-vars.yml all |
119-
jq -r ".plays[0].tasks[0].hosts.localhost.$1"
120-
}
121-
INSTALL_MODE="$(ansible_variable install_mode)"
122-
EXTNET_ID="$(ansible_variable infra_external_network_id)"
152+
EXTNET_ID="$(
153+
ansible -m debug -a "var=infra_external_network_id" -e @extra-vars.yml all |
154+
jq -r ".plays[0].tasks[0].hosts.localhost.infra_external_network_id"
155+
)"
123156
IP_ADDRESS="$(
124157
openstack floating ip create $EXTNET_ID \
125158
--description "ingress IP for $AZIMUTH_ENVIRONMENT" \
126-
--tag "$AZIMUTH_ENVIRONMENT" \
127159
--format value \
128160
--column floating_ip_address
129161
)"
130-
VAR_NAME="$([ "$INSTALL_MODE" = "ha" ] && echo "capi_cluster_addons_ingress_load_balancer_ip" || echo "infra_fixed_floatingip")"
131-
echo "$VAR_NAME: $IP_ADDRESS" >> extra-vars.yml
162+
cat >> ci.env <<EOF
163+
export INGRESS_IP="$IP_ADDRESS"
164+
EOF
132165
env:
133166
ANSIBLE_LOAD_CALLBACK_PLUGINS: "true"
134167
ANSIBLE_STDOUT_CALLBACK: json
135-
if: ${{ inputs.allocate-ingress-ip == 'yes' }}
136-
137-
- name: Output extra-vars.yml for debugging
138-
shell: bash
139-
run: cat extra-vars.yml
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[defaults]
2+
inventory = ../../../environments/base/inventory,../../../environments/ha/inventory,../../../environments/demo/inventory,../common/inventory,../arcus/inventory,./inventory
3+
roles_path = ../../../.ansible/roles
4+
collections_path = ../../../.ansible/collections
5+
6+
host_key_checking = False
7+
8+
[ssh_connection]
9+
retries = 3

.github/environments/arcus-ha/env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CI_S3_LOCK_HOST="object.arcus.openstack.hpc.cam.ac.uk"
2+
CI_S3_LOCK_BUCKET="azimuth-ci"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Unset the network ID so that a network + router are provisioned
2+
infra_network_id:
3+
4+
# Unset the infra IP so we can use the ingress IP for the ingress controller
5+
infra_fixed_floatingip:
6+
capi_cluster_addons_ingress_load_balancer_ip: "{{ lookup('env', 'INGRESS_IP') }}"
7+
8+
# Flavor auto-detection picks the wrong flavors on Arcus, so override them
9+
# The flavor to use for the seed VM (vm.ska.cpu.general.small)
10+
infra_flavor_id: c8b72062-5d52-4590-9d7a-68a670b44442
11+
# The flavor to use for the control plane nodes
12+
capi_cluster_control_plane_flavor: vm.ska.cpu.general.small
13+
# The flavor to use for worker nodes
14+
capi_cluster_worker_flavor: vm.ska.cpu.general.small
15+
16+
# Although this is a "HA" test, what we are really testing is the spawning
17+
# of the CAPI cluster and deployment of Azimuth onto that
18+
# We have also preferred to use 3 small workers rather than 1 or 2 eighth workers,
19+
# as they are more likely to fit in the gaps between other workloads
20+
# So one control plane node and two workers is sufficient for that
21+
capi_cluster_control_plane_count: 1
22+
capi_cluster_worker_count: 3
23+
24+
# Use a single replica for Consul
25+
# The risk of failed upgrades is too great, and it is going away soon
26+
consul_server_replicas: 1
27+
28+
# Enable Velero just to check that installation works
29+
velero_enabled: true
30+
velero_s3_url: https://required-but-not-used.com
31+
velero_bucket_name: not-used
32+
velero_backup_schedule_enabled: true
33+
velero_backup_schedule_name: default
34+
velero_backup_schedule_timings: "0 0 * * *"
35+
velero_backup_schedule_ttl: "168h"
36+
velero_aws_access_key_id: required-but-not-used
37+
velero_aws_secret_access_key : required-but-not-used
File renamed without changes.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[defaults]
2+
inventory = ../../../environments/base/inventory,../../../environments/singlenode/inventory,../../../environments/demo/inventory,../common/inventory,./inventory
3+
roles_path = ../../../.ansible/roles
4+
collections_path = ../../../.ansible/collections
5+
6+
host_key_checking = False
7+
8+
[ssh_connection]
9+
retries = 3

.github/environments/arcus/env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
CI_S3_LOCK_HOST="object.arcus.openstack.hpc.cam.ac.uk"
2+
CI_S3_LOCK_BUCKET="azimuth-ci"

environments/ci/inventory/group_vars/all/variables.yml renamed to .github/environments/arcus/inventory/group_vars/all/variables.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,12 @@ infra_external_network_id: "{{ lookup('pipe', 'openstack network show CUDN-Inter
44
# Use the pre-existing portal-internal network so that we don't need to steal a router
55
infra_network_id: "{{ lookup('pipe', 'openstack network show portal-internal -f value -c id') }}"
66

7+
# The ingress IP comes from an environment variable
8+
infra_fixed_floatingip: "{{ lookup('env', 'INGRESS_IP') }}"
9+
710
# Flavor auto-detection picks the wrong flavors on Arcus, so override them
811
# The flavor to use for the Azimuth AIO VM (vm.ska.cpu.general.eighth)
912
infra_flavor_id: 5f9def81-c93f-4c1f-a521-3b810061ff6c
10-
# The flavors to use for the Slurm login and control nodes
11-
# TODO(mkjpryor) remove these once azimuth-ops has been updated
12-
azimuth_caas_stackhpc_slurm_appliance_login_flavor_name: vm.ska.cpu.general.small
13-
azimuth_caas_stackhpc_slurm_appliance_control_flavor_name: "{{ azimuth_caas_stackhpc_slurm_appliance_login_flavor_name }}"
1413
# The flavor to use for the workstation test case (vm.ska.cpu.general.small)
1514
generate_tests_caas_test_case_workstation_param_cluster_flavor: c8b72062-5d52-4590-9d7a-68a670b44442
1615
# The flavor to use for the repo2docker test case

0 commit comments

Comments
 (0)