Skip to content

Commit

Permalink
[ci] collapse inputs for e2e
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Portnov <[email protected]>
  • Loading branch information
Taior committed Sep 18, 2024
1 parent ae41d28 commit fa2624d
Show file tree
Hide file tree
Showing 21 changed files with 94 additions and 112 deletions.
2 changes: 1 addition & 1 deletion .github/ci_templates/e2e_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ check_e2e_labels:
# <template: e2e_run_job_template>
{!{ $ctx.jobID }!}:
name: "{!{ $ctx.jobName }!}"
if: ${{ github.event.inputs.cri == '{!{ $ctx.cri }!}' && github.event.inputs.k8s_version == '{!{ $ctx.kubernetesVersion }!}' && github.event.inputs.layout == '{!{ $ctx.layout }!}' }}
if: ${{ fromJson(inputs.test_config).cri == '{!{ $ctx.cri }!}' && github.event.inputs.k8s_version == '{!{ $ctx.kubernetesVersion }!}' && github.event.inputs.layout == '{!{ $ctx.layout }!}' }}
env:
PROVIDER: {!{ $ctx.providerName }!}
CRI: {!{ $ctx.criName }!}
Expand Down
16 changes: 9 additions & 7 deletions .github/scripts/js/ci.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,16 +435,19 @@ const setCRIAndVersionsFromInputs = ({ context, core, kubernetesDefaultVersion }
let cri = [defaultCRI];
let ver = [defaultVersion];

if (!!context.payload.inputs.cri) {
const requested_cri = context.payload.inputs.cri.toLowerCase();
let test_config = JSON.parse(context.payload.inputs.test_config)

if (!!test_config.cri) {
const requested_cri = test_config.cri.toLowerCase();
cri = requested_cri.split(',');
}
if (!!context.payload.inputs.ver) {
const requested_ver = context.payload.inputs.ver.replace(/\./g, '_');
if (!!test_config.ver) {
const requested_ver = test_config.ver.replace(/\./g, '_');
ver = requested_ver.split(',');
}

core.info(`workflow_dispatch is release related. e2e inputs: cri='${context.payload.inputs.cri}' and version='${context.payload.inputs.ver}'.`);
core.info(`e2e inputs: '${JSON.stringify(context.payload.inputs)}'`);
core.info(`workflow_dispatch is release related. e2e parsed inputs: cri='${test_config.cri}' and version='${test_config.ver}'.`);

for (const out_cri of cri) {
for (const out_ver of ver) {
Expand Down Expand Up @@ -720,8 +723,7 @@ const detectSlashCommand = ({ comment , context, core}) => {
}

inputs = {
cri: cri.join(','),
ver: ver.join(','),
test_config: JSON.stringify({ cri: cri.join(','), ver: ver.join(','), editions: "FE" }),
}

// Add initial_ref_slug input when e2e command has two args.
Expand Down
8 changes: 3 additions & 5 deletions .github/workflow_templates/e2e.multi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,10 @@ on:
pull_request_head_label:
description: 'Head label of pull request. e.g. my_repo:my_feature_branch'
required: false
cri:
description: 'A comma-separated list of cri to test. Available: Containerd.'
required: false
ver:
description: 'A comma-separated list of versions to test. Available: from 1.24 to 1.28.'
test_config:
description: 'JSON string of parameters of current test'
required: false
default: '{"cri":"Containerd","ver":"1.27","editions":"FE"}'
initial_ref_slug:
description: 'An image tag to install first and then switch to workflow context ref'
required: false
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-abort-aws.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_26:
name: "destroy cluster: AWS, Containerd, Kubernetes 1.26"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down Expand Up @@ -353,7 +353,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_27:
name: "destroy cluster: AWS, Containerd, Kubernetes 1.27"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down Expand Up @@ -631,7 +631,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_28:
name: "destroy cluster: AWS, Containerd, Kubernetes 1.28"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down Expand Up @@ -909,7 +909,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_29:
name: "destroy cluster: AWS, Containerd, Kubernetes 1.29"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down Expand Up @@ -1187,7 +1187,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_30:
name: "destroy cluster: AWS, Containerd, Kubernetes 1.30"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down Expand Up @@ -1465,7 +1465,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_automatic:
name: "destroy cluster: AWS, Containerd, Kubernetes Automatic"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: AWS
CRI: Containerd
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-abort-azure.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_26:
name: "destroy cluster: Azure, Containerd, Kubernetes 1.26"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down Expand Up @@ -357,7 +357,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_27:
name: "destroy cluster: Azure, Containerd, Kubernetes 1.27"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down Expand Up @@ -639,7 +639,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_28:
name: "destroy cluster: Azure, Containerd, Kubernetes 1.28"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down Expand Up @@ -921,7 +921,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_29:
name: "destroy cluster: Azure, Containerd, Kubernetes 1.29"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down Expand Up @@ -1203,7 +1203,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_30:
name: "destroy cluster: Azure, Containerd, Kubernetes 1.30"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down Expand Up @@ -1485,7 +1485,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_automatic:
name: "destroy cluster: Azure, Containerd, Kubernetes Automatic"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: Azure
CRI: Containerd
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-abort-eks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_26:
name: "destroy cluster: EKS, Containerd, Kubernetes 1.26"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down Expand Up @@ -356,7 +356,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_27:
name: "destroy cluster: EKS, Containerd, Kubernetes 1.27"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down Expand Up @@ -637,7 +637,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_28:
name: "destroy cluster: EKS, Containerd, Kubernetes 1.28"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down Expand Up @@ -918,7 +918,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_29:
name: "destroy cluster: EKS, Containerd, Kubernetes 1.29"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down Expand Up @@ -1199,7 +1199,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_30:
name: "destroy cluster: EKS, Containerd, Kubernetes 1.30"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down Expand Up @@ -1480,7 +1480,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_automatic:
name: "destroy cluster: EKS, Containerd, Kubernetes Automatic"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: EKS
CRI: Containerd
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-abort-gcp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_26:
name: "destroy cluster: GCP, Containerd, Kubernetes 1.26"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_27:
name: "destroy cluster: GCP, Containerd, Kubernetes 1.27"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_28:
name: "destroy cluster: GCP, Containerd, Kubernetes 1.28"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down Expand Up @@ -903,7 +903,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_29:
name: "destroy cluster: GCP, Containerd, Kubernetes 1.29"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down Expand Up @@ -1179,7 +1179,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_30:
name: "destroy cluster: GCP, Containerd, Kubernetes 1.30"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down Expand Up @@ -1455,7 +1455,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_automatic:
name: "destroy cluster: GCP, Containerd, Kubernetes Automatic"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'WithoutNAT' }}
env:
PROVIDER: GCP
CRI: Containerd
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/e2e-abort-openstack.yml
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_26:
name: "destroy cluster: OpenStack, Containerd, Kubernetes 1.26"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.26' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down Expand Up @@ -351,7 +351,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_27:
name: "destroy cluster: OpenStack, Containerd, Kubernetes 1.27"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.27' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down Expand Up @@ -627,7 +627,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_28:
name: "destroy cluster: OpenStack, Containerd, Kubernetes 1.28"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.28' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down Expand Up @@ -903,7 +903,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_29:
name: "destroy cluster: OpenStack, Containerd, Kubernetes 1.29"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.29' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down Expand Up @@ -1179,7 +1179,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_1_30:
name: "destroy cluster: OpenStack, Containerd, Kubernetes 1.30"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == '1.30' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down Expand Up @@ -1455,7 +1455,7 @@ jobs:
# <template: e2e_run_job_template>
run_containerd_automatic:
name: "destroy cluster: OpenStack, Containerd, Kubernetes Automatic"
if: ${{ github.event.inputs.cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'Standard' }}
if: ${{ fromJson(inputs.test_config).cri == 'containerd' && github.event.inputs.k8s_version == 'Automatic' && github.event.inputs.layout == 'Standard' }}
env:
PROVIDER: OpenStack
CRI: Containerd
Expand Down
Loading

0 comments on commit fa2624d

Please sign in to comment.