mirror of
https://github.com/edgelesssys/constellation.git
synced 2025-09-23 14:34:57 -04:00
ci: combine node count inputs into one (#2084)
Signed-off-by: Daniel Weiße <dw@edgeless.systems>
This commit is contained in:
parent
4f1ed669d4
commit
484b6c5c24
1 changed files with 50 additions and 47 deletions
97
.github/workflows/e2e-test-manual.yml
vendored
97
.github/workflows/e2e-test-manual.yml
vendored
|
@ -3,14 +3,10 @@ name: e2e test manual
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
||||||
workerNodesCount:
|
nodeCount:
|
||||||
description: "Number of worker nodes to spawn."
|
description: "Number of nodes to use in the cluster. Given in format `<control-plane nodes>:<worker nodes>`."
|
||||||
default: "2"
|
default: "3:2"
|
||||||
required: true
|
type: string
|
||||||
controlNodesCount:
|
|
||||||
description: "Number of control-plane nodes to spawn."
|
|
||||||
default: "3"
|
|
||||||
required: true
|
|
||||||
cloudProvider:
|
cloudProvider:
|
||||||
description: "Which cloud provider to use."
|
description: "Which cloud provider to use."
|
||||||
type: choice
|
type: choice
|
||||||
|
@ -50,8 +46,13 @@ on:
|
||||||
type: boolean
|
type: boolean
|
||||||
default: false
|
default: false
|
||||||
required: false
|
required: false
|
||||||
cliImageVersion:
|
cliVersion:
|
||||||
description: "Version of a released CLI to download:Full name of OS image (CSP independent image version UID). Leave empty for latest debug image on main."
|
description: "Version of a released CLI to download. Leave empty to build the CLI from the checked out ref."
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
required: false
|
||||||
|
imageVersion:
|
||||||
|
description: "Full name of OS image (CSP independent image version UID). Leave empty for latest debug image on main."
|
||||||
type: string
|
type: string
|
||||||
default: ""
|
default: ""
|
||||||
required: false
|
required: false
|
||||||
|
@ -67,14 +68,10 @@ on:
|
||||||
required: false
|
required: false
|
||||||
workflow_call:
|
workflow_call:
|
||||||
inputs:
|
inputs:
|
||||||
workerNodesCount:
|
nodeCount:
|
||||||
description: "Number of worker nodes to spawn."
|
description: "Number of nodes to use in the cluster. Given in format `<control-plane nodes>:<worker nodes>`."
|
||||||
type: number
|
default: "3:2"
|
||||||
required: true
|
type: string
|
||||||
controlNodesCount:
|
|
||||||
description: "Number of control-plane nodes to spawn."
|
|
||||||
type: number
|
|
||||||
required: true
|
|
||||||
cloudProvider:
|
cloudProvider:
|
||||||
description: "Which cloud provider to use."
|
description: "Which cloud provider to use."
|
||||||
type: string
|
type: string
|
||||||
|
@ -95,10 +92,16 @@ on:
|
||||||
description: "Keep measurements embedded in the CLI."
|
description: "Keep measurements embedded in the CLI."
|
||||||
type: boolean
|
type: boolean
|
||||||
required: true
|
required: true
|
||||||
cliImageVersion:
|
cliVersion:
|
||||||
description: "Version of a released CLI to download and full name of OS image (CSP independent image version UID). Leave empty for latest debug image on main. Must be in the form of 'cliVersion:image'."
|
description: "Version of a released CLI to download. Leave empty to build the CLI from the checked out ref."
|
||||||
type: string
|
type: string
|
||||||
required: true
|
default: ""
|
||||||
|
required: false
|
||||||
|
imageVersion:
|
||||||
|
description: "Full name of OS image (CSP independent image version UID). Leave empty for latest debug image on main."
|
||||||
|
type: string
|
||||||
|
default: ""
|
||||||
|
required: false
|
||||||
machineType:
|
machineType:
|
||||||
description: "Override VM machine type. Leave as 'default' or empty to use the default VM type for the selected cloud provider."
|
description: "Override VM machine type. Leave as 'default' or empty to use the default VM type for the selected cloud provider."
|
||||||
type: string
|
type: string
|
||||||
|
@ -109,35 +112,35 @@ on:
|
||||||
required: true
|
required: true
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
split-cliImageVersion:
|
split-nodeCount:
|
||||||
name: Split cliImageVersion
|
name: Split nodeCount
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
outputs:
|
outputs:
|
||||||
image: ${{ steps.split-cliImageVersion.outputs.image }}
|
workerNodes: ${{ steps.split-nodeCount.outputs.workerNodes }}
|
||||||
cliVersion: ${{ steps.split-cliImageVersion.outputs.cliVersion }}
|
controlPlaneNodes: ${{ steps.split-nodeCount.outputs.controlPlaneNodes }}
|
||||||
steps:
|
steps:
|
||||||
- name: Split cliImageVersion
|
- name: Split nodeCount
|
||||||
id: split-cliImageVersion
|
id: split-nodeCount
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ -z "${{ inputs.cliImageVersion }}" ]]; then
|
nodeCount="${{ inputs.nodeCount }}"
|
||||||
echo "Using latest debug image from main."
|
workerNodes="${nodeCount##*:}"
|
||||||
exit 0
|
controlPlaneNodes="${nodeCount%%:*}"
|
||||||
|
|
||||||
|
if [[ -z "${workerNodes}" ]] || [[ -z "{controlPlaneNodes}" ]]; then
|
||||||
|
echo "Invalid nodeCount input: '${nodeCount}'."
|
||||||
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
cliImageVersion="${{ inputs.cliImageVersion }}"
|
echo "workerNodes=${workerNodes}" | tee -a "$GITHUB_OUTPUT"
|
||||||
image="${cliImageVersion##*:}"
|
echo "controlPlaneNodes=${controlPlaneNodes}" | tee -a "$GITHUB_OUTPUT"
|
||||||
cliVersion="${cliImageVersion%%:*}"
|
|
||||||
echo "image=${image}" | tee -a "$GITHUB_OUTPUT"
|
|
||||||
echo "cliVersion=${cliVersion}" | tee -a "$GITHUB_OUTPUT"
|
|
||||||
|
|
||||||
find-latest-image:
|
find-latest-image:
|
||||||
name: Select image
|
name: Select image
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
needs: [split-cliImageVersion]
|
|
||||||
permissions:
|
permissions:
|
||||||
id-token: write
|
id-token: write
|
||||||
contents: read
|
contents: read
|
||||||
|
@ -149,27 +152,27 @@ jobs:
|
||||||
id: check-input
|
id: check-input
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
if [[ -z "${{ needs.split-cliImageVersion.outputs.image }}" ]]; then
|
if [[ -z "${{ inputs.imageVersion }}" ]]; then
|
||||||
echo "Using latest debug image from main."
|
echo "Using latest debug image from main."
|
||||||
exit 0
|
exit 0
|
||||||
else
|
else
|
||||||
echo "image=${{ needs.split-cliImageVersion.outputs.image }}" | tee -a "$GITHUB_OUTPUT"
|
echo "image=${{ inputs.imageVersion }}" | tee -a "$GITHUB_OUTPUT"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Checkout head
|
- name: Checkout head
|
||||||
if: needs.split-cliImageVersion.outputs.image == '' && inputs.git-ref == 'head'
|
if: inputs.imageVersion == '' && inputs.git-ref == 'head'
|
||||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
with:
|
with:
|
||||||
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
||||||
|
|
||||||
- name: Checkout ref
|
- name: Checkout ref
|
||||||
if: needs.split-cliImageVersion.outputs.image == '' && inputs.git-ref != 'head'
|
if: inputs.imageVersion == '' && inputs.git-ref != 'head'
|
||||||
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a9 # v3.5.3
|
||||||
with:
|
with:
|
||||||
ref: ${{ inputs.git-ref }}
|
ref: ${{ inputs.git-ref }}
|
||||||
|
|
||||||
- name: Login to AWS
|
- name: Login to AWS
|
||||||
if: needs.split-cliImageVersion.outputs.image == ''
|
if: inputs.imageVersion == ''
|
||||||
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
|
uses: aws-actions/configure-aws-credentials@5fd3084fc36e372ff1fff382a39b10d03659f355 # v2.2.0
|
||||||
with:
|
with:
|
||||||
role-to-assume: arn:aws:iam::795746500882:role/GithubConstellationVersionsAPIRead
|
role-to-assume: arn:aws:iam::795746500882:role/GithubConstellationVersionsAPIRead
|
||||||
|
@ -177,7 +180,7 @@ jobs:
|
||||||
|
|
||||||
- name: Find latest image
|
- name: Find latest image
|
||||||
id: find-latest-image
|
id: find-latest-image
|
||||||
if: needs.split-cliImageVersion.outputs.image == ''
|
if: inputs.imageVersion == ''
|
||||||
uses: ./.github/actions/versionsapi
|
uses: ./.github/actions/versionsapi
|
||||||
with:
|
with:
|
||||||
command: latest
|
command: latest
|
||||||
|
@ -188,7 +191,7 @@ jobs:
|
||||||
id: isDebugImage
|
id: isDebugImage
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
case "${{ needs.split-cliImageVersion.outputs.image }}" in
|
case "${{ inputs.imageVersion }}" in
|
||||||
"")
|
"")
|
||||||
echo "isDebugImage=true" | tee -a "$GITHUB_OUTPUT"
|
echo "isDebugImage=true" | tee -a "$GITHUB_OUTPUT"
|
||||||
;;
|
;;
|
||||||
|
@ -207,7 +210,7 @@ jobs:
|
||||||
checks: write
|
checks: write
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
needs: [find-latest-image, split-cliImageVersion]
|
needs: [find-latest-image, split-nodeCount]
|
||||||
if: always() && !cancelled()
|
if: always() && !cancelled()
|
||||||
steps:
|
steps:
|
||||||
- name: Install basic tools (macOS)
|
- name: Install basic tools (macOS)
|
||||||
|
@ -235,8 +238,8 @@ jobs:
|
||||||
id: e2e_test
|
id: e2e_test
|
||||||
uses: ./.github/actions/e2e_test
|
uses: ./.github/actions/e2e_test
|
||||||
with:
|
with:
|
||||||
workerNodesCount: ${{ inputs.workerNodesCount }}
|
workerNodesCount: ${{ needs.split-nodeCount.outputs.workerNodes }}
|
||||||
controlNodesCount: ${{ inputs.controlNodesCount }}
|
controlNodesCount: ${{ needs.split-nodeCount.outputs.controlPlaneNodes }}
|
||||||
cloudProvider: ${{ inputs.cloudProvider }}
|
cloudProvider: ${{ inputs.cloudProvider }}
|
||||||
machineType: ${{ inputs.machineType }}
|
machineType: ${{ inputs.machineType }}
|
||||||
gcpProject: ${{ secrets.GCP_E2E_PROJECT }}
|
gcpProject: ${{ secrets.GCP_E2E_PROJECT }}
|
||||||
|
@ -250,7 +253,7 @@ jobs:
|
||||||
awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }}
|
awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }}
|
||||||
awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }}
|
awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }}
|
||||||
osImage: ${{ needs.find-latest-image.outputs.image }}
|
osImage: ${{ needs.find-latest-image.outputs.image }}
|
||||||
cliVersion: ${{ needs.split-cliImageVersion.outputs.cliVersion }}
|
cliVersion: ${{ inputs.cliVersion }}
|
||||||
isDebugImage: ${{ needs.find-latest-image.outputs.isDebugImage }}
|
isDebugImage: ${{ needs.find-latest-image.outputs.isDebugImage }}
|
||||||
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
||||||
azureClusterCreateCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
|
azureClusterCreateCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue