Skip to content

Commit d251523

Browse files
committed
Add workflow to define runner name
1 parent cd1791c commit d251523

7 files changed

+88
-14
lines changed

.github/workflows/ipa-image-build.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ env:
3333
KAYOBE_ENVIRONMENT: ci-builder
3434
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
3535
jobs:
36+
runner-preqs:
37+
uses: ./.github/workflows/runs-on-preq.yml
38+
with:
39+
runner_env: ${{ inputs.runner_env }}
3640
ipa-image-build:
3741
name: Build IPA images
3842
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
3943
environment: ${{ inputs.runner_env }}
40-
runs-on: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}
44+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_image_build }}
45+
needs:
46+
- runner-preqs
4147
permissions: {}
4248
steps:
4349
- name: Install Package

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,17 @@ env:
3333
KAYOBE_ENVIRONMENT: ci-builder
3434
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
3535
jobs:
36+
runner-preqs:
37+
uses: ./.github/workflows/runs-on-preq.yml
38+
with:
39+
runner_env: ${{ inputs.runner_env }}
3640
overcloud-host-image-build:
3741
name: Build overcloud host images
3842
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
3943
environment: ${{ inputs.runner_env }}
40-
runs-on: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}
44+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_image_build }}
45+
needs:
46+
- runner-preqs
4147
permissions: {}
4248
steps:
4349
- name: Validate inputs

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,17 @@ on:
3535
env:
3636
ANSIBLE_FORCE_COLOR: True
3737
jobs:
38+
runner-preqs:
39+
uses: ./.github/workflows/runs-on-preq.yml
40+
with:
41+
runner_env: ${{ inputs.runner_env }}
3842
overcloud-host-image-upload:
3943
name: Upload overcloud host images
4044
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
4145
environment: ${{ inputs.runner_env }}
42-
runs-on: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}
46+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_image_build }}
47+
needs:
48+
- runner-preqs
4349
permissions: {}
4450
steps:
4551
- name: Validate inputs

.github/workflows/package-build-ofed.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,17 @@ env:
2929
KAYOBE_ENVIRONMENT: ci-builder
3030
KAYOBE_VAULT_PASSWORD: ${{ secrets.KAYOBE_VAULT_PASSWORD }}
3131
jobs:
32+
runner-preqs:
33+
uses: ./.github/workflows/runs-on-preq.yml
34+
with:
35+
runner_env: ${{ inputs.runner_env }}
3236
overcloud-ofed-packages:
3337
name: Build OFED packages
3438
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
3539
environment: ${{ inputs.runner_env }}
36-
runs-on: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}
40+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_image_build }}
41+
needs:
42+
- runner-preqs
3743
permissions: {}
3844
steps:
3945
- name: Install Package

.github/workflows/runs-on-preq.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
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+
- id: builder-runner
35+
run: echo "runner_name_image_build=${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}" >> $GITHUB_OUTPUT
36+
- name: Set output for container image build runner
37+
run: echo "Setting runner for ${{ inputs.runner_env }} -> ${{ vars.RUNS_ON_TARGET_CONTAINER_IMAGE_BUILDER }}"
38+
- id: container-image-build-runner
39+
run: echo "runner_name_container_image_build=${{ vars.RUNS_ON_TARGET_CONTAINER_IMAGE_BUILDER }}" >> $GITHUB_OUTPUT
40+
- name: Set output for aio runner
41+
run: echo "Setting runner for ${{ inputs.runner_env }} -> ${{ vars.RUNS_ON_TARGET_AIO }}"
42+
- id: aio-runner
43+
run: echo "runner_name_aio=${{ vars.RUNS_ON_TARGET_AIO }}" >> $GITHUB_OUTPUT

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

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ name: All in one
77
on:
88
workflow_call:
99
inputs:
10-
runner:
10+
runner_env:
1111
required: false
1212
type: string
13-
description: 'Runner name'
14-
default: 'arc-skc-aio-runner'
13+
description: 'Runner environment'
14+
default: 'SMS Lab'
1515
kayobe_image:
1616
description: Kayobe container image
1717
type: string
@@ -71,11 +71,18 @@ on:
7171
required: true
7272

7373
jobs:
74+
runner-preqs:
75+
uses: ./.github/workflows/runs-on-preq.yml
76+
with:
77+
runner_env: ${{ inputs.runner_env }}
7478
# NOTE: Runner needs unzip and nodejs packages.
7579
all-in-one:
7680
name: All in one
7781
if: ${{ inputs.if && !cancelled() }}
78-
runs-on: ${{ inputs.runner }}
82+
environment: ${{ inputs.runner_env }}
83+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_aio }}
84+
needs:
85+
- runner-preqs
7986
permissions: {}
8087
env:
8188
KAYOBE_ENVIRONMENT: ci-aio

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@ jobs:
5252
generate-tag:
5353
name: Generate container image tag
5454
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
55-
environment: ${{ inputs.runner_env }}
5655
runs-on: ubuntu-latest
5756
permissions: {}
5857
outputs:
@@ -109,22 +108,23 @@ jobs:
109108
run: |
110109
echo "${{ steps.datetime_tag.outputs.datetime_tag }}"
111110
112-
- name: Verify environment
113-
run : |
114-
echo "Environment variable RUNS_ON_TARGET_IMAGE_BUILDER: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}"
111+
runner-preqs:
112+
uses: ./.github/workflows/runs-on-preq.yml
113+
with:
114+
runner_env: ${{ inputs.runner_env }}
115115

116116
container-image-build:
117117
name: Build Kolla container images
118118
if: github.repository == 'stackhpc/stackhpc-kayobe-config'
119-
environment: ${{ inputs.runner_env }}
120-
runs-on: ${{ vars.RUNS_ON_TARGET_IMAGE_BUILDER }}
119+
runs-on: ${{ needs.runner-preqs.outputs.runner_name_container_image_build }}
121120
timeout-minutes: 720
122121
permissions: {}
123122
strategy:
124123
fail-fast: false
125124
matrix: ${{ fromJson(needs.generate-tag.outputs.matrix) }}
126125
needs:
127126
- generate-tag
127+
- runner-preqs
128128
steps:
129129
- name: Install package dependencies
130130
run: |

0 commit comments

Comments
 (0)