Skip to content

Commit 4259854

Browse files
authored
Merge pull request #951 from stackhpc/2023.1-zed-merge
2023.1: zed merge
2 parents 6ca2eb6 + a37584b commit 4259854

18 files changed

+345
-32
lines changed

.github/workflows/overcloud-host-image-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ jobs:
118118
- name: Install OpenStack client
119119
run: |
120120
source venvs/kayobe/bin/activate &&
121-
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/${{ steps.openstack_release.outputs.openstack_release }}/upper-constraints.txt
121+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
122122
123123
- name: Build a Rocky Linux 9 overcloud host image
124124
id: build_rocky_9

.github/workflows/overcloud-host-image-upload.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ jobs:
8080
- name: Install OpenStack client
8181
run: |
8282
source venvs/kayobe/bin/activate &&
83-
pip install python-openstackclient -c https://opendev.org/openstack/requirements/raw/branch/stable/${{ steps.openstack_release.outputs.openstack_release }}/upper-constraints.txt
83+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
8484
8585
- name: Output Rocky Linux 9 image tag
8686
id: rocky_9_image_tag

.github/workflows/stackhpc-all-in-one.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ on:
3838
vm_flavor:
3939
description: Flavor for the all-in-one VM
4040
type: string
41-
default: en1.large
41+
default: en1.medium
4242
vm_network:
4343
description: Network for the all-in-one VM
4444
type: string
@@ -73,7 +73,7 @@ jobs:
7373
# NOTE: Runner needs unzip and nodejs packages.
7474
all-in-one:
7575
name: All in one
76-
if: inputs.if
76+
if: ${{ inputs.if && !cancelled() }}
7777
runs-on: arc-skc-aio-runner
7878
permissions: {}
7979
env:
@@ -156,6 +156,7 @@ jobs:
156156
aio_vm_network = "${{ env.VM_NETWORK }}"
157157
aio_vm_subnet = "${{ env.VM_SUBNET }}"
158158
aio_vm_volume_size = "${{ env.VM_VOLUME_SIZE }}"
159+
aio_vm_tags = ${{ env.VM_TAGS }}
159160
EOF
160161
working-directory: ${{ github.workspace }}/terraform/aio
161162
env:
@@ -167,6 +168,7 @@ jobs:
167168
VM_SUBNET: ${{ inputs.vm_subnet }}
168169
VM_INTERFACE: ${{ inputs.vm_interface }}
169170
VM_VOLUME_SIZE: ${{ inputs.upgrade && '45' || '35' }}
171+
VM_TAGS: '["skc-ci-aio", "PR=${{ github.event.number }}"]'
170172

171173
- name: Terraform Plan
172174
run: terraform plan
@@ -181,13 +183,15 @@ jobs:
181183
for attempt in $(seq 5); do
182184
if terraform apply -auto-approve; then
183185
echo "Created infrastructure on attempt $attempt"
184-
break
186+
exit 0
185187
fi
186188
echo "Failed to create infrastructure on attempt $attempt"
187189
sleep 10
188190
terraform destroy -auto-approve
189191
sleep 60
190192
done
193+
echo "Failed to create infrastructure after $attempt attempts"
194+
exit 1
191195
working-directory: ${{ github.workspace }}/terraform/aio
192196
env:
193197
OS_CLOUD: ${{ inputs.OS_CLOUD }}

.github/workflows/stackhpc-check-tags.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ env:
2323
jobs:
2424
check-tags:
2525
name: Check container image tags
26-
if: inputs.if
26+
if: ${{ inputs.if && ! cancelled() }}
2727
runs-on: arc-skc-aio-runner
2828
permissions: {}
2929
env:
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
---
2+
name: Clean up stale CI resources
3+
on:
4+
schedule:
5+
# Every 2 hours at quarter past
6+
- cron: '15 0/2 * * *'
7+
8+
jobs:
9+
ci-cleanup:
10+
name: Clean up stale CI resources
11+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
12+
runs-on: ubuntu-latest
13+
permissions: {}
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
with:
18+
path: src/kayobe-config
19+
20+
- name: Setup Python
21+
uses: actions/setup-python@v5
22+
23+
- name: Generate clouds.yaml
24+
run: |
25+
cat << EOF > clouds.yaml
26+
${{ secrets.CLOUDS_YAML }}
27+
EOF
28+
29+
- name: Determine OpenStack release
30+
id: openstack_release
31+
run: |
32+
BRANCH=$(awk -F'=' '/defaultbranch/ {print $2}' src/kayobe-config/.gitreview)
33+
echo "openstack_release=${BRANCH}" | sed "s|stable/||" >> $GITHUB_OUTPUT
34+
35+
- name: Install OpenStack client
36+
run: |
37+
pip install python-openstackclient -c https://releases.openstack.org/constraints/upper/${{ steps.openstack_release.outputs.openstack_release }}
38+
39+
- name: Clean up aio instances over 3 hours old
40+
run: |
41+
result=0
42+
changes_before=$(date -Imin -d -3hours)
43+
for status in ACTIVE BUILD ERROR SHUTOFF; do
44+
for instance in $(openstack server list --tags skc-ci-aio --os-compute-api-version 2.66 --format value --column ID --changes-before $changes_before --status $status); do
45+
echo "Cleaning up $status instance $instance"
46+
openstack server show $instance
47+
if ! openstack server delete $instance; then
48+
echo "Failed to delete $status instance $instance"
49+
result=1
50+
fi
51+
done
52+
done
53+
exit $result
54+
env:
55+
OS_CLOUD: openstack
56+
OS_APPLICATION_CREDENTIAL_ID: ${{ secrets.OS_APPLICATION_CREDENTIAL_ID }}
57+
OS_APPLICATION_CREDENTIAL_SECRET: ${{ secrets.OS_APPLICATION_CREDENTIAL_SECRET }}

.github/workflows/stackhpc-pull-request.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ jobs:
8787
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
8888
if: ${{ needs.check-changes.outputs.check-tags == 'true' }}
8989
secrets: inherit
90-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
90+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
9191

9292
all-in-one-ubuntu-jammy-ovs:
9393
name: aio (Ubuntu Jammy OVS)
@@ -104,7 +104,7 @@ jobs:
104104
OS_CLOUD: openstack
105105
if: ${{ needs.check-changes.outputs.aio == 'true' }}
106106
secrets: inherit
107-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
107+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
108108

109109
all-in-one-ubuntu-jammy-ovn:
110110
name: aio (Ubuntu Jammy OVN)
@@ -121,7 +121,7 @@ jobs:
121121
OS_CLOUD: openstack
122122
if: ${{ needs.check-changes.outputs.aio == 'true' }}
123123
secrets: inherit
124-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
124+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
125125

126126
all-in-one-rocky-9-ovs:
127127
name: aio (Rocky 9 OVS)
@@ -138,7 +138,7 @@ jobs:
138138
OS_CLOUD: openstack
139139
if: ${{ needs.check-changes.outputs.aio == 'true' }}
140140
secrets: inherit
141-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
141+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
142142

143143
all-in-one-rocky-9-ovn:
144144
name: aio (Rocky 9 OVN)
@@ -155,7 +155,7 @@ jobs:
155155
OS_CLOUD: openstack
156156
if: ${{ needs.check-changes.outputs.aio == 'true' }}
157157
secrets: inherit
158-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
158+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
159159

160160
# Test two upgrade scenarios: Ubuntu Jammy OVS and Rocky 9 OVN.
161161

@@ -175,7 +175,7 @@ jobs:
175175
if: ${{ needs.check-changes.outputs.aio == 'true' }}
176176
upgrade: true
177177
secrets: inherit
178-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
178+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
179179

180180
all-in-one-upgrade-rocky-9-ovn:
181181
name: aio upgrade (Rocky 9 OVN)
@@ -193,4 +193,4 @@ jobs:
193193
if: ${{ needs.check-changes.outputs.aio == 'true' }}
194194
upgrade: true
195195
secrets: inherit
196-
if: ${{ ! failure() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}
196+
if: ${{ ! failure() && ! cancelled() && github.repository == 'stackhpc/stackhpc-kayobe-config' }}

etc/kayobe/ansible.cfg

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ bin_ansible_callbacks = True
88
inject_facts_as_vars = False
99
# Add timing information to output
1010
callbacks_enabled = ansible.posix.profile_tasks
11+
# Silence warning about invalid characters found in group names
12+
force_valid_group_names = ignore
1113

1214
[ssh_connection]
1315
pipelining = True

etc/kayobe/ansible/ubuntu-upgrade.yml

Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
# To prevent Ansible role dependency errors, this playbook requires that environment variable
3+
# ANSIBLE_ROLES_PATH is defined and includes '$KAYOBE_PATH/ansible/roles' on the Ansible control host.
4+
- name: Migrate hosts from Ubuntu Focal 20.04 to Jammy 22.04
5+
hosts: overcloud:infra-vms:seed:seed-hypervisor
6+
vars:
7+
ansible_python_interpreter: /usr/bin/python3
8+
tasks:
9+
- name: Assert that hosts are running Ubuntu Focal
10+
assert:
11+
that:
12+
- ansible_facts.distribution == 'Ubuntu'
13+
- ansible_facts.distribution_major_version == '20'
14+
- ansible_facts.distribution_release == 'focal'
15+
- os_distribution == 'ubuntu'
16+
fail_msg: >-
17+
This playbook is only designed for Ubuntu Focal 20.04 hosts. Ensure
18+
that you are limiting it to only run on Focal hosts and
19+
os_distribution is set to ubuntu.
20+
21+
- name: Ensure apt packages are up to date
22+
apt:
23+
update_cache: true
24+
upgrade: yes
25+
become: true
26+
27+
- name: Ensure do-release-upgrade is installed
28+
package:
29+
name: ubuntu-release-upgrader-core
30+
state: latest
31+
become: true
32+
33+
- name: Check whether a reboot is required
34+
stat:
35+
path: /var/run/reboot-required
36+
register: file_status
37+
38+
- name: Reboot to apply updates
39+
reboot:
40+
reboot_timeout: 1200
41+
connect_timeout: 600
42+
become: true
43+
when: file_status.stat.exists
44+
45+
# NOTE: We cannot use apt_repository here because definitions must exist within the standard repos.list
46+
- name: Ensure Jammy repo definitions exist in sources.list
47+
blockinfile:
48+
path: /etc/apt/sources.list
49+
block: |
50+
deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy main restricted universe multiverse
51+
deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-updates main restricted universe multiverse
52+
deb {{ stackhpc_repo_ubuntu_jammy_url }} jammy-backports main restricted universe multiverse
53+
deb {{ stackhpc_repo_ubuntu_jammy_security_url }} jammy-security main restricted universe multiverse
54+
become: true
55+
56+
- name: Do release upgrade
57+
command: do-release-upgrade -f DistUpgradeViewNonInteractive
58+
become: true
59+
60+
- name: Ensure old venvs do not exist
61+
file:
62+
path: "/opt/kayobe/venvs/{{ item }}"
63+
state: absent
64+
loop:
65+
- kayobe
66+
- kolla-ansible
67+
become: true
68+
69+
- name: Update Python and current user facts before re-creating Kayobe venv
70+
ansible.builtin.setup:
71+
filter: "{{ kayobe_ansible_setup_filter }}"
72+
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
73+
74+
- name: Run the Kayobe kayobe-target-venv playbook to ensure kayobe venv exists on remote host
75+
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/kayobe-target-venv.yml"
76+
77+
- name: Run the Kayobe network configuration playbook, to ensure definitions are not lost on reboot
78+
import_playbook: "{{ lookup('ansible.builtin.env', 'VIRTUAL_ENV') }}/share/kayobe/ansible/network.yml"
79+
80+
- name: Reboot and confirm the host is upgraded to Jammy 22.04
81+
hosts: overcloud:infra-vms:seed:seed-hypervisor
82+
vars:
83+
ansible_python_interpreter: /usr/bin/python3
84+
tasks:
85+
- name: Ensure Jammy repo definitions do not exist in sources.list
86+
blockinfile:
87+
path: /etc/apt/sources.list
88+
state: absent
89+
become: true
90+
91+
- name: Reboot and wait
92+
reboot:
93+
reboot_timeout: 1200
94+
connect_timeout: 600
95+
become: true
96+
97+
- name: Update distribution facts
98+
ansible.builtin.setup:
99+
filter: "{{ kayobe_ansible_setup_filter }}"
100+
gather_subset: "{{ kayobe_ansible_setup_gather_subset }}"
101+
102+
- name: Assert that hosts are now using Ubuntu 22
103+
assert:
104+
that:
105+
- ansible_facts.distribution_major_version == '22'
106+
- ansible_facts.distribution_release == 'jammy'
107+
108+
- name: Run the OVN chassis priority fix playbook
109+
import_playbook: "{{ lookup('ansible.builtin.env', 'KAYOBE_CONFIG_PATH') }}/ansible/ovn-fix-chassis-priorities.yml"
110+
when: kolla_enable_ovn

etc/kayobe/environments/ci-aio/kolla/globals.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ openstack_service_workers: "1"
1010
openstack_service_rpc_workers: "1"
1111

1212
# OpenSearch memory tuning
13-
opensearch_heap_size: 1g
13+
opensearch_heap_size: 200m
1414

1515
# Increase Grafana timeout
1616
grafana_start_first_node_retries: 20

etc/kayobe/environments/ci-aio/stackhpc-ci.yml

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
# Docker namespace to use for Kolla images. Default is 'kolla'.
66
kolla_docker_namespace: stackhpc-dev
77

8+
# Disable some services to reduce memory footprint.
9+
kolla_enable_heat: false
10+
811
###############################################################################
912
# Network configuration.
1013

@@ -19,8 +22,14 @@ resolv_is_managed: false
1922
# Build and deploy the development Pulp service repositories.
2023
# Use Ark's package repositories to install packages.
2124
stackhpc_repo_mirror_url: "{{ stackhpc_release_pulp_url }}"
22-
stackhpc_repo_mirror_username: "{{ stackhpc_docker_registry_username }}"
23-
stackhpc_repo_mirror_password: "{{ stackhpc_docker_registry_password }}"
25+
stackhpc_repo_mirror_username: "skc-ci-aio"
26+
stackhpc_repo_mirror_password: !vault |
27+
$ANSIBLE_VAULT;1.1;AES256
28+
31386366383365666135336331663635396237623139306362633933636233613765663731666338
29+
3633633736333936383439623066653663333964343234350a393137383537316164323837386437
30+
36613139323161643766666565643739373037623363636234343965343436653261326238393566
31+
3837336661653962340a316631366463623138623530373133336665376433633437306631383666
32+
30333461333535363433363336663664316634343432633766346564323833346663
2433
2534
# Build against released Pulp repository versions.
2635
stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"
@@ -55,19 +64,11 @@ stackhpc_include_os_minor_version_in_repo_url: true
5564
# Host and port of container registry.
5665
# Push built images to the development Pulp service registry.
5766
stackhpc_docker_registry: "{{ stackhpc_repo_mirror_url | regex_replace('^https?://', '') }}"
58-
59-
# Username and password of container registry.
60-
stackhpc_docker_registry_username: "release-train-ci"
61-
stackhpc_docker_registry_password: !vault |
62-
$ANSIBLE_VAULT;1.1;AES256
63-
38356134376436656165303634626531653836366233383531343439646433376334396438373735
64-
3135643664353934356237376134623235356137383263300a333165386562396134633534376532
65-
34386133383366326639353432386235336132663839333337323739633434613934346462363031
66-
3265323831663964360a643962346231386462323236373963633066393736323234303833363535
67-
3664
67+
stackhpc_docker_registry_username: "{{ stackhpc_repo_mirror_username }}"
68+
stackhpc_docker_registry_password: "{{ stackhpc_repo_mirror_password }}"
6869

6970
# Override Pulp credentials to allow querying container image tags in the
7071
# check-tags.yml custom playbook.
7172
pulp_url: "{{ stackhpc_repo_mirror_url }}"
72-
pulp_username: "{{ stackhpc_docker_registry_username }}"
73-
pulp_password: "{{ stackhpc_docker_registry_password }}"
73+
pulp_username: "{{ stackhpc_repo_mirror_username }}"
74+
pulp_password: "{{ stackhpc_repo_mirror_password }}"

etc/kayobe/environments/ci-builder/stackhpc-ci.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,14 @@ resolv_is_managed: false
4141
# Build against the development Pulp service repositories.
4242
# Use Ark's package repositories to install packages.
4343
stackhpc_repo_mirror_url: "{{ stackhpc_repo_mirror_auth_proxy_url if stackhpc_repo_mirror_auth_proxy_enabled | bool else stackhpc_release_pulp_url }}"
44-
stackhpc_repo_mirror_username: "{{ stackhpc_docker_registry_username }}"
45-
stackhpc_repo_mirror_password: "{{ stackhpc_docker_registry_password }}"
44+
stackhpc_repo_mirror_username: "skc-ci-aio"
45+
stackhpc_repo_mirror_password: !vault |
46+
$ANSIBLE_VAULT;1.1;AES256
47+
31386366383365666135336331663635396237623139306362633933636233613765663731666338
48+
3633633736333936383439623066653663333964343234350a393137383537316164323837386437
49+
36613139323161643766666565643739373037623363636234343965343436653261326238393566
50+
3837336661653962340a316631366463623138623530373133336665376433633437306631383666
51+
30333461333535363433363336663664316634343432633766346564323833346663
4652
4753
# Build against released Pulp repository versions.
4854
stackhpc_repo_grafana_version: "{{ stackhpc_pulp_repo_grafana_version }}"

0 commit comments

Comments
 (0)