Skip to content

Commit 9b53117

Browse files
authored
Kolla image build for SMS & Leafcloud runners
1 parent aff46ec commit 9b53117

File tree

4 files changed

+72
-1
lines changed

4 files changed

+72
-1
lines changed

.github/workflows/runner-selector.yml

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
name: Create output for `runs-on` variable
3+
4+
on:
5+
workflow_call:
6+
inputs:
7+
runner_env:
8+
description: 'The environment input from caller workflow'
9+
default: 'SMS Lab'
10+
required: True
11+
type: string
12+
outputs:
13+
runner_name_image_build:
14+
description: "Image builder runner name"
15+
value: ${{ jobs.define_runner.outputs.image-build-runner }}
16+
runner_name_container_image_build:
17+
description: "Container image build runner name"
18+
value: ${{ jobs.define_runner.outputs.container-image-build-runner }}
19+
runner_name_aio:
20+
description: "AiO runner name"
21+
value: ${{ jobs.define_runner.outputs.aio-runner }}
22+
23+
jobs:
24+
define_runner:
25+
environment: ${{ inputs.runner_env }}
26+
runs-on: ubuntu-latest
27+
outputs:
28+
image-build-runner: ${{ steps.builder-runner.outputs.runner_name_image_build }}
29+
container-image-build-runner: ${{ steps.container-image-build-runner.outputs.runner_name_container_image_build }}
30+
aio-runner: ${{ steps.aio-runner.outputs.runner_name_aio }}
31+
steps:
32+
- name: Set output for image builder runner
33+
run: echo "Setting runner for ${{ inputs.runner_env }} -> ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}"
34+
35+
- id: builder-runner
36+
run: echo "runner_name_image_build=${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}" >> $GITHUB_OUTPUT
37+
38+
- name: Set output for container image build runner
39+
run: echo "Setting runner for ${{ inputs.runner_env }} -> ${{ vars.RUNS_ON_TARGET_CONTAINER_IMAGE_BUILDER }}"
40+
41+
- id: container-image-build-runner
42+
run: echo "runner_name_container_image_build=${{ vars.RUNS_ON_TARGET_CONTAINER_IMAGE_BUILDER }}" >> $GITHUB_OUTPUT
43+
44+
- name: Set output for aio runner
45+
run: echo "Setting runner for ${{ inputs.runner_env }} -> ${{ vars.RUNS_ON_TARGET_AIO }}"
46+
47+
- id: aio-runner
48+
run: echo "runner_name_aio=${{ vars.RUNS_ON_TARGET_AIO }}" >> $GITHUB_OUTPUT

.github/workflows/stackhpc-container-image-build.yml

+14-1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ on:
3838
type: boolean
3939
required: false
4040
default: false
41+
runner_env:
42+
description: Which cloud to run on?
43+
type: choice
44+
default: SMS Lab
45+
options:
46+
- SMS Lab
47+
- Leafcloud
4148

4249
env:
4350
ANSIBLE_FORCE_COLOR: True
@@ -101,17 +108,23 @@ jobs:
101108
run: |
102109
echo "${{ steps.datetime_tag.outputs.datetime_tag }}"
103110
111+
runner-selection:
112+
uses: ./.github/workflows/runner-selector.yml
113+
with:
114+
runner_env: ${{ inputs.runner_env }}
115+
104116
container-image-build:
105117
name: Build Kolla container images
106118
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
107-
runs-on: arc-skc-container-image-builder-runner
119+
runs-on: ${{ needs.runner-selection.outputs.runner_name_container_image_build }}
108120
timeout-minutes: 720
109121
permissions: {}
110122
strategy:
111123
fail-fast: false
112124
matrix: ${{ fromJson(needs.generate-tag.outputs.matrix) }}
113125
needs:
114126
- generate-tag
127+
- runner-selection
115128
steps:
116129
- name: Install package dependencies
117130
run: |

etc/kayobe/ansible/pulp-artifact-upload.yml

+9
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,15 @@
1919
patterns: "{{ file_regex }}"
2020
register: found_files
2121

22+
- name: Install pip packages
23+
ansible.builtin.pip:
24+
name:
25+
- pyopenssl
26+
- ndg-httpsclient
27+
- pyasn1
28+
- urllib3
29+
state: present
30+
2231
- name: Upload an artifact
2332
pulp.squeezer.artifact:
2433
pulp_url: "{{ remote_pulp_url }}"

terraform/aio/vm.tf

+1
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ resource "openstack_compute_instance_v2" "kayobe-aio" {
6262
flavor_name = var.aio_vm_flavor
6363
config_drive = true
6464
user_data = templatefile("templates/userdata.cfg.tpl", {ssh_public_key = file(var.ssh_public_key)})
65+
security_groups = ["kayobe-runner"]
6566
network {
6667
name = var.aio_vm_network
6768
}

0 commit comments

Comments
 (0)