From 39eb58b40356709027d4a79823fe431ff6949f41 Mon Sep 17 00:00:00 2001 From: Nils Hanke Date: Fri, 2 Sep 2022 12:09:45 +0200 Subject: [PATCH] E2E: Use default VM machine type when not overriden --- .github/actions/constellation_create/action.yml | 10 ++++++++-- .github/workflows/e2e-test-azure-weekly.yml | 2 +- .github/workflows/e2e-test-azure.yml | 2 +- .github/workflows/e2e-test-gcp-weekly.yml | 1 - .github/workflows/e2e-test-gcp.yml | 1 - .github/workflows/e2e-test-manual.yml | 13 +++++-------- 6 files changed, 15 insertions(+), 14 deletions(-) diff --git a/.github/actions/constellation_create/action.yml b/.github/actions/constellation_create/action.yml index 408ab9e51..80107e841 100644 --- a/.github/actions/constellation_create/action.yml +++ b/.github/actions/constellation_create/action.yml @@ -19,7 +19,7 @@ inputs: required: false machineType: description: "Machine type of VM to spawn." - required: true + required: false coreosImage: description: "CoreOS image to use. The default value 'debug-latest' will select the latest available debug image." required: true @@ -72,7 +72,6 @@ runs: "(.provider | select(. | has(\"gcp\")).gcp.project) = \"constellation-331613\" | (.provider | select(. | has(\"gcp\")).gcp.region) = \"europe-west3\" | (.provider | select(. | has(\"gcp\")).gcp.zone) = \"europe-west3-b\" | - (.provider | select(. | has(\"gcp\")).gcp.instanceType) = \"${{ inputs.machineType }}\" | (.provider | select(. | has(\"gcp\")).gcp.enforcedMeasurements) = [11,12]" \ constellation-conf.yaml @@ -113,6 +112,13 @@ runs: env: CSP: ${{ inputs.cloudProvider }} + - name: Set instanceType + if: ${{ inputs.machineType && inputs.machineType != 'default' }} + shell: bash + run: | + yq eval -i "(.provider | select(. | has(\"azure\")).azure.instanceType) = \"${{ inputs.machineType }}\"" constellation-conf.yaml + yq eval -i "(.provider | select(. | has(\"gcp\")).gcp.instanceType) = \"${{ inputs.machineType }}\"" constellation-conf.yaml + - name: Add debugd firewall rule run: | yq eval -i '(.ingressFirewall) += {"name": "debugd", "description": "debugd default port", "protocol": "tcp", "iprange": "0.0.0.0/0", "fromport": 4000, "toport": 0}' constellation-conf.yaml diff --git a/.github/workflows/e2e-test-azure-weekly.yml b/.github/workflows/e2e-test-azure-weekly.yml index 8c307911d..5a1b20f71 100644 --- a/.github/workflows/e2e-test-azure-weekly.yml +++ b/.github/workflows/e2e-test-azure-weekly.yml @@ -39,7 +39,7 @@ jobs: controlNodesCount: "1" autoscale: "false" cloudProvider: "azure" - machineType: "Standard_DC4as_v5" + azure_credentials: ${{ secrets.AZURE_E2E_CREDENTIALS }} sonobuoyTestSuiteCmd: '--plugin e2e --plugin-env e2e.E2E_FOCUS="\[Conformance\]" --plugin-env e2e.E2E_SKIP="for service with type clusterIP|HostPort validates that there is no conflict between pods with same hostPort but different hostIP and protocol" --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-plugin.yaml --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-master-plugin.yaml' kubernetesVersion: ${{ matrix.version }} azureClientSecret: ${{ secrets.AZURE_E2E_CLIENT_SECRET }} diff --git a/.github/workflows/e2e-test-azure.yml b/.github/workflows/e2e-test-azure.yml index 69ad8af5d..ed0702402 100644 --- a/.github/workflows/e2e-test-azure.yml +++ b/.github/workflows/e2e-test-azure.yml @@ -34,7 +34,7 @@ jobs: controlNodesCount: "1" autoscale: "false" cloudProvider: "azure" - machineType: "Standard_DC4as_v5" + azure_credentials: ${{ secrets.AZURE_E2E_CREDENTIALS }} azureClientSecret: ${{ secrets.AZURE_E2E_CLIENT_SECRET }} azureResourceGroup: ${{ steps.az_resource_group_gen.outputs.res_group_name }} # TODO: Remove E2E_SKIP once AB#2174 is resolved diff --git a/.github/workflows/e2e-test-gcp-weekly.yml b/.github/workflows/e2e-test-gcp-weekly.yml index 873f683fc..34fdcf8e2 100644 --- a/.github/workflows/e2e-test-gcp-weekly.yml +++ b/.github/workflows/e2e-test-gcp-weekly.yml @@ -25,7 +25,6 @@ jobs: controlNodesCount: "1" autoscale: "false" cloudProvider: "gcp" - machineType: "n2d-standard-4" gcp_service_account_json: ${{ secrets.GCP_SERVICE_ACCOUNT }} gcpClusterServiceAccountKey: ${{ secrets.GCP_CLUSTER_SERVICE_ACCOUNT }} sonobuoyTestSuiteCmd: '--plugin e2e --plugin-env e2e.E2E_FOCUS="\[Conformance\]" --plugin-env e2e.E2E_SKIP="for service with type clusterIP|HostPort validates that there is no conflict between pods with same hostPort but different hostIP and protocol" --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-plugin.yaml --plugin https://raw.githubusercontent.com/vmware-tanzu/sonobuoy-plugins/master/cis-benchmarks/kube-bench-master-plugin.yaml' diff --git a/.github/workflows/e2e-test-gcp.yml b/.github/workflows/e2e-test-gcp.yml index 1cd82c4f3..5706f92da 100644 --- a/.github/workflows/e2e-test-gcp.yml +++ b/.github/workflows/e2e-test-gcp.yml @@ -20,7 +20,6 @@ jobs: controlNodesCount: "1" autoscale: "false" cloudProvider: "gcp" - machineType: "n2d-standard-4" gcp_service_account_json: ${{ secrets.GCP_SERVICE_ACCOUNT }} gcpClusterServiceAccountKey: ${{ secrets.GCP_CLUSTER_SERVICE_ACCOUNT }} # TODO: Remove E2E_SKIP once AB#2174 is resolved diff --git a/.github/workflows/e2e-test-manual.yml b/.github/workflows/e2e-test-manual.yml index 6b9f1c4e5..e248b7dca 100644 --- a/.github/workflows/e2e-test-manual.yml +++ b/.github/workflows/e2e-test-manual.yml @@ -24,14 +24,6 @@ on: - "azure" default: "gcp" required: true - machineType: - description: "VM machine type. Make sure it matches selected cloud provider!" - type: choice - options: - - "n2d-standard-4" # GCP - - "Standard_DC4as_v5" # Azure - default: "n2d-standard-4" - required: true sonobuoyTestSuiteCmd: description: "Which tests should be run? Check README for guidance!" default: "--mode quick" @@ -49,6 +41,11 @@ on: type: boolean default: true required: false + machineType: + description: "Override VM machine type. Leave as 'default' or empty to use the default VM type for the selected cloud provider." + type: string + default: "default" + required: false jobs: e2e-test-manual: