Skip to content

Commit 4c868dd

Browse files
authored
Merge pull request #515 from stackhpc/aio-images
Use workflow images in aio ci
2 parents 57bfa82 + aa2e5da commit 4c868dd

File tree

7 files changed

+121
-21
lines changed

7 files changed

+121
-21
lines changed

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

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ on:
2727
description: Neutron ML2 plugin
2828
type: string
2929
required: true
30-
vm_image:
31-
description: Image for the all-in-one VM
30+
vm_image_override:
31+
description: Full name of an image to use instead of the default
3232
type: string
33-
default: bb8c0a34-533f-42fb-a49b-3461e677f3f6
33+
default: ""
3434
vm_interface:
3535
description: Default network interface name
3636
type: string
37-
default: eth0
37+
default: ens3
3838
vm_flavor:
3939
description: Flavor for the all-in-one VM
4040
type: string
@@ -76,6 +76,21 @@ jobs:
7676
with:
7777
submodules: true
7878

79+
- name: Output image tag
80+
id: image_tag
81+
run: |
82+
echo image_tag=$(grep stackhpc_${{ inputs.os_distribution }}_${{ inputs.os_release }}_overcloud_host_image_version etc/kayobe/environments/ci-aio/stackhpc-ci.yml | awk '{print $2}') >> $GITHUB_OUTPUT
83+
84+
# Use the image override if set, otherwise use overcloud-os_distribution-os_release-tag
85+
- name: Output image name
86+
id: image_name
87+
run: |
88+
if [ -z "${{ inputs.vm_image_override }}" ]; then
89+
echo image_name=overcloud-${{ inputs.os_distribution }}-${{ inputs.os_release }}-${{ steps.image_tag.outputs.image_tag }} >> $GITHUB_OUTPUT
90+
else
91+
echo image_name=${{ inputs.vm_image_override }} >> $GITHUB_OUTPUT
92+
fi
93+
7994
- name: Install terraform
8095
uses: hashicorp/setup-terraform@v2
8196

@@ -110,7 +125,7 @@ jobs:
110125
env:
111126
SSH_USERNAME: "${{ inputs.ssh_username }}"
112127
VM_NAME: "skc-ci-aio-${{ inputs.neutron_plugin }}-${{ github.run_id }}"
113-
VM_IMAGE: ${{ inputs.vm_image }}
128+
VM_IMAGE: ${{ steps.image_name.outputs.image_name }}
114129
VM_FLAVOR: ${{ inputs.vm_flavor }}
115130
VM_NETWORK: ${{ inputs.vm_network }}
116131
VM_SUBNET: ${{ inputs.vm_subnet }}
@@ -191,6 +206,16 @@ jobs:
191206
run: |
192207
sudo docker image pull $KAYOBE_IMAGE
193208
209+
- name: Run growroot
210+
run: |
211+
sudo -E docker run -t --rm \
212+
-v $(pwd):/stack/kayobe-automation-env/src/kayobe-config \
213+
-e KAYOBE_ENVIRONMENT -e KAYOBE_VAULT_PASSWORD -e KAYOBE_AUTOMATION_SSH_PRIVATE_KEY \
214+
$KAYOBE_IMAGE \
215+
/stack/kayobe-automation-env/src/kayobe-config/.automation/pipeline/playbook-run.sh '$KAYOBE_CONFIG_PATH/ansible/growroot.yml'
216+
env:
217+
KAYOBE_AUTOMATION_SSH_PRIVATE_KEY: ${{ steps.ssh_key.outputs.ssh_key }}
218+
194219
- name: Host configure
195220
run: |
196221
sudo -E docker run -t --rm \

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

Lines changed: 30 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -75,10 +75,6 @@ jobs:
7575
os_distribution: rocky
7676
os_release: "8"
7777
neutron_plugin: ovs
78-
# NOTE: The current SMS lab Rocky8 image has moved ahead of our release
79-
# train snapshots, causing failures installing some packages.
80-
vm_image: Rocky8-2022-11-08
81-
vm_interface: ens3
8278
OS_CLOUD: sms-lab-release
8379
secrets: inherit
8480
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
@@ -93,10 +89,6 @@ jobs:
9389
os_distribution: rocky
9490
os_release: "8"
9591
neutron_plugin: ovn
96-
# NOTE: The current SMS lab Rocky8 image has moved ahead of our release
97-
# train snapshots, causing failures installing some packages.
98-
vm_image: Rocky8-2022-11-08
99-
vm_interface: ens3
10092
OS_CLOUD: sms-lab-release
10193
secrets: inherit
10294
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
@@ -112,7 +104,6 @@ jobs:
112104
os_release: focal
113105
ssh_username: ubuntu
114106
neutron_plugin: ovs
115-
vm_image: Ubuntu-20.04
116107
OS_CLOUD: sms-lab-release
117108
secrets: inherit
118109
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
@@ -128,7 +119,36 @@ jobs:
128119
os_release: focal
129120
ssh_username: ubuntu
130121
neutron_plugin: ovn
131-
vm_image: Ubuntu-20.04
122+
OS_CLOUD: sms-lab-release
123+
secrets: inherit
124+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
125+
126+
all-in-one-ubuntu-jammy-ovs:
127+
name: aio (Ubuntu Jammy OVS)
128+
needs:
129+
- build-kayobe-image
130+
uses: ./.github/workflows/stackhpc-all-in-one.yml
131+
with:
132+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
133+
os_distribution: ubuntu
134+
os_release: jammy
135+
ssh_username: ubuntu
136+
neutron_plugin: ovs
137+
OS_CLOUD: sms-lab-release
138+
secrets: inherit
139+
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
140+
141+
all-in-one-ubuntu-jammy-ovn:
142+
name: aio (Ubuntu Jammy OVN)
143+
needs:
144+
- build-kayobe-image
145+
uses: ./.github/workflows/stackhpc-all-in-one.yml
146+
with:
147+
kayobe_image: ${{ needs.build-kayobe-image.outputs.kayobe_image }}
148+
os_distribution: ubuntu
149+
os_release: jammy
150+
ssh_username: ubuntu
151+
neutron_plugin: ovn
132152
OS_CLOUD: sms-lab-release
133153
secrets: inherit
134154
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
@@ -144,8 +164,6 @@ jobs:
144164
os_release: "9"
145165
ssh_username: cloud-user
146166
neutron_plugin: ovs
147-
vm_image: Rocky9
148-
vm_interface: ens3
149167
OS_CLOUD: sms-lab-release
150168
secrets: inherit
151169
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
@@ -161,8 +179,6 @@ jobs:
161179
os_release: "9"
162180
ssh_username: cloud-user
163181
neutron_plugin: ovn
164-
vm_image: Rocky9
165-
vm_interface: ens3
166182
OS_CLOUD: sms-lab-release
167183
secrets: inherit
168184
if: github.repository == 'stackhpc/stackhpc-kayobe-config'

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,8 @@
55
# User with which to access the controllers via SSH during bootstrap, in order
66
# to setup the Kayobe user account. Default is {{ os_distribution }}.
77
controller_bootstrap_user: "{{ os_distribution if os_distribution == 'ubuntu' else 'cloud-user' }}"
8+
9+
# Controller lvm configuration. See intentory/group_vars/controllers/lvm.yml
10+
# for the exact configuration.
11+
controller_lvm_groups:
12+
- "{{ stackhpc_lvm_group_rootvg }}"
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
---
2+
# List of extra LVs to include in the rootvg VG.
3+
stackhpc_lvm_group_rootvg_lvs_extra:
4+
- "{{ stackhpc_lvm_lv_docker }}"
5+
6+
###############################################################################
7+
# StackHPC LVM Logical Volume (LV) configuration.
8+
9+
# StackHPC LVM lv_swap LV size.
10+
stackhpc_lvm_lv_swap_size: 500m
11+
12+
# StackHPC LVM lv_root LV size.
13+
stackhpc_lvm_lv_root_size: 2g
14+
15+
# StackHPC LVM lv_tmp LV size.
16+
stackhpc_lvm_lv_tmp_size: 2g
17+
18+
# StackHPC LVM lv_var LV size.
19+
stackhpc_lvm_lv_var_size: 2g
20+
21+
# StackHPC LVM lv_var_tmp LV size.
22+
stackhpc_lvm_lv_var_tmp_size: 2g
23+
24+
# StackHPC LVM lv_log LV size.
25+
stackhpc_lvm_lv_log_size: 2g
26+
27+
# StackHPC LVM lv_audit LV size.
28+
stackhpc_lvm_lv_audit_size: 250m
29+
30+
# StackHPC LVM lv_home LV size.
31+
stackhpc_lvm_lv_home_size: 2g
32+
33+
# StackHPC LVM lv_docker LV size.
34+
stackhpc_lvm_lv_docker_size: 95%FREE

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

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,3 +80,10 @@ stackhpc_docker_registry_password: !vault |
8080
38333133393730633666613965653364316162353337313330346164303631313731646461363461
8181
3963323635373866630a633533376339363734626664333765313665623662613764363038383735
8282
38646138376438643533376161376634653439386230353365316239613430363338
83+
84+
# Overcloud host image tags
85+
stackhpc_centos_8-stream_overcloud_host_image_version: "yoga-20230525T095243"
86+
stackhpc_rocky_8_overcloud_host_image_version: "yoga-20230629T135322"
87+
stackhpc_rocky_9_overcloud_host_image_version: "yoga-20230515T145140"
88+
stackhpc_ubuntu_focal_overcloud_host_image_version: "yoga-20230609T120720"
89+
stackhpc_ubuntu_jammy_overcloud_host_image_version: "yoga-20230609T120720"

etc/kayobe/stackhpc-overcloud-dib.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,21 @@ stackhpc_overcloud_dib_env_vars:
5757
# FIXME: Support templating repo files.
5858
# DIB_YUM_MINIMAL_BOOTSTRAP_REPOS: /path/to/dir/containing/dib-mirror-*.repo
5959
YUM: dnf
60+
# Workaround for stack user home ownership bug
61+
DIB_IMAGE_CACHE: "/tmp/yum"
6062

6163
# StackHPC overcloud DIB image packages.
6264
stackhpc_overcloud_dib_packages:
6365
- "logrotate"
6466
- "net-tools"
6567
- "vim"
68+
- "git"
69+
- "less"
6670
- "{% if os_distribution == 'ubuntu' %}netbase{% endif %}"
6771
- "{% if os_distribution == 'ubuntu' %}iputils-ping{% endif %}"
72+
- "{% if os_distribution == 'ubuntu' %}curl{% endif %}"
73+
- "{% if os_distribution == 'ubuntu' %}apt-utils{% endif %}"
74+
- "{% if os_distribution == 'centos' %}openssh-clients{% endif %}"
6875

6976
# StackHPC overcloud DIB image block device configuration.
7077
# This image layout conforms to the CIS partition benchmarks.

terraform/aio/vm.tf

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ resource "openstack_compute_instance_v2" "kayobe-aio" {
5959
block_device {
6060
uuid = local.image_is_uuid ? var.aio_vm_image: data.openstack_images_image_v2.image[0].id
6161
source_type = "image"
62-
volume_size = 100
62+
volume_size = 35
6363
boot_index = 0
6464
destination_type = "volume"
6565
delete_on_termination = true
@@ -73,8 +73,14 @@ resource "null_resource" "kayobe-aio" {
7373
host = openstack_compute_instance_v2.kayobe-aio.access_ip_v4
7474
user = var.ssh_username
7575
private_key = file("id_rsa")
76+
# Terraform will run the start script from /tmp by default. For the
77+
# current images, /tmp is noexec, so the path must be changed
78+
script_path = "/home/${var.ssh_username}/start.sh"
7679
}
7780

78-
inline = ["echo 'connected!'"]
81+
inline = [
82+
"#!/bin/sh",
83+
"echo 'connected!'"
84+
]
7985
}
8086
}

0 commit comments

Comments
 (0)