2023-03-21 04:18:14 -04:00
|
|
|
name: e2e test manual
|
2022-05-03 05:15:53 -04:00
|
|
|
|
|
|
|
on:
|
|
|
|
workflow_dispatch:
|
|
|
|
inputs:
|
2023-07-17 07:45:53 -04:00
|
|
|
nodeCount:
|
|
|
|
description: "Number of nodes to use in the cluster. Given in format `<control-plane nodes>:<worker nodes>`."
|
|
|
|
default: "3:2"
|
|
|
|
type: string
|
2024-01-25 09:32:19 -05:00
|
|
|
attestationVariant:
|
|
|
|
description: "Which attestation variant to use."
|
2022-05-03 05:15:53 -04:00
|
|
|
type: choice
|
|
|
|
options:
|
2024-01-25 09:32:19 -05:00
|
|
|
- "gcp-sev-es"
|
2024-04-16 12:13:47 -04:00
|
|
|
- "gcp-sev-snp"
|
2024-01-25 09:32:19 -05:00
|
|
|
- "azure-sev-snp"
|
|
|
|
- "azure-tdx"
|
|
|
|
- "aws-sev-snp"
|
|
|
|
default: "azure-sev-snp"
|
2022-05-03 05:15:53 -04:00
|
|
|
required: true
|
2023-01-11 08:27:18 -05:00
|
|
|
runner:
|
|
|
|
description: "Architecture of the runner that executes the CLI"
|
|
|
|
type: choice
|
|
|
|
options:
|
|
|
|
- "ubuntu-22.04"
|
|
|
|
- "macos-12"
|
|
|
|
default: "ubuntu-22.04"
|
2022-10-24 12:47:03 -04:00
|
|
|
test:
|
|
|
|
description: "The test to run."
|
|
|
|
type: choice
|
|
|
|
options:
|
2022-10-28 05:01:31 -04:00
|
|
|
- "sonobuoy quick"
|
2022-10-24 12:47:03 -04:00
|
|
|
- "sonobuoy full"
|
|
|
|
- "autoscaling"
|
2022-12-21 04:49:21 -05:00
|
|
|
- "lb"
|
2023-02-28 05:21:26 -05:00
|
|
|
- "perf-bench"
|
2023-01-09 02:54:41 -05:00
|
|
|
- "verify"
|
2023-01-19 04:41:07 -05:00
|
|
|
- "recover"
|
2023-09-15 11:21:42 -04:00
|
|
|
- "malicious join"
|
2023-10-12 07:27:02 -04:00
|
|
|
- "s3proxy"
|
2022-10-28 09:51:43 -04:00
|
|
|
- "nop"
|
2022-05-03 05:15:53 -04:00
|
|
|
required: true
|
2022-08-09 04:02:15 -04:00
|
|
|
kubernetesVersion:
|
|
|
|
description: "Kubernetes version to create the cluster from."
|
2024-01-08 10:53:12 -05:00
|
|
|
default: "1.28"
|
2022-08-09 04:02:15 -04:00
|
|
|
required: true
|
2023-07-17 07:45:53 -04:00
|
|
|
cliVersion:
|
|
|
|
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."
|
2022-11-23 03:41:42 -05:00
|
|
|
type: string
|
2022-12-09 05:51:38 -05:00
|
|
|
default: ""
|
|
|
|
required: false
|
2022-09-02 06:09:45 -04:00
|
|
|
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
|
2023-08-10 06:53:40 -04:00
|
|
|
regionZone:
|
|
|
|
description: "Region or zone to create the cluster in. Leave empty for default region/zone."
|
|
|
|
type: string
|
2022-12-20 07:19:12 -05:00
|
|
|
git-ref:
|
|
|
|
description: "Git ref to checkout."
|
|
|
|
type: string
|
|
|
|
default: "head"
|
|
|
|
required: false
|
2023-01-06 05:49:55 -05:00
|
|
|
workflow_call:
|
|
|
|
inputs:
|
2023-07-17 07:45:53 -04:00
|
|
|
nodeCount:
|
|
|
|
description: "Number of nodes to use in the cluster. Given in format `<control-plane nodes>:<worker nodes>`."
|
|
|
|
default: "3:2"
|
|
|
|
type: string
|
2024-01-25 09:32:19 -05:00
|
|
|
attestationVariant:
|
|
|
|
description: "Which attestation variant to use."
|
2023-01-06 05:49:55 -05:00
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
runner:
|
|
|
|
description: "Architecture of the runner that executes the CLI"
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
test:
|
|
|
|
description: "The test to run."
|
|
|
|
type: string
|
|
|
|
required: true
|
|
|
|
kubernetesVersion:
|
|
|
|
description: "Kubernetes version to create the cluster from."
|
|
|
|
type: string
|
|
|
|
required: true
|
2023-07-17 07:45:53 -04:00
|
|
|
cliVersion:
|
|
|
|
description: "Version of a released CLI to download. Leave empty to build the CLI from the checked out ref."
|
2023-01-06 05:49:55 -05:00
|
|
|
type: string
|
2023-07-17 07:45:53 -04:00
|
|
|
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
|
2023-01-06 05:49:55 -05:00
|
|
|
machineType:
|
|
|
|
description: "Override VM machine type. Leave as 'default' or empty to use the default VM type for the selected cloud provider."
|
|
|
|
type: string
|
|
|
|
required: true
|
2023-08-10 06:53:40 -04:00
|
|
|
regionZone:
|
|
|
|
description: "Region or zone to create the cluster in. Leave empty for default region/zone."
|
|
|
|
type: string
|
2023-01-06 05:49:55 -05:00
|
|
|
git-ref:
|
|
|
|
description: "Git ref to checkout."
|
|
|
|
type: string
|
|
|
|
required: true
|
2023-11-03 11:27:28 -04:00
|
|
|
internalLoadBalancer:
|
|
|
|
description: "Enable internal load balancer for the cluster."
|
|
|
|
type: boolean
|
|
|
|
default: false
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation:
|
2024-02-01 09:05:07 -05:00
|
|
|
description: "How to create infrastructure for the e2e test. One of [cli, terraform]."
|
2023-12-15 04:37:29 -05:00
|
|
|
type: string
|
|
|
|
default: "cli"
|
2023-12-08 08:40:31 -05:00
|
|
|
marketplaceImageVersion:
|
|
|
|
description: "Marketplace image version to use."
|
|
|
|
type: string
|
|
|
|
force:
|
|
|
|
description: "Use the force-flag when applying to ignore version mismatches."
|
|
|
|
type: boolean
|
2022-08-09 09:29:39 -04:00
|
|
|
|
2022-05-03 05:15:53 -04:00
|
|
|
jobs:
|
2024-01-25 09:32:19 -05:00
|
|
|
generate-input-parameters:
|
|
|
|
name: Generate input parameters
|
2023-03-31 06:41:32 -04:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
|
|
|
outputs:
|
2023-07-17 07:45:53 -04:00
|
|
|
workerNodes: ${{ steps.split-nodeCount.outputs.workerNodes }}
|
|
|
|
controlPlaneNodes: ${{ steps.split-nodeCount.outputs.controlPlaneNodes }}
|
2024-01-25 09:32:19 -05:00
|
|
|
cloudProvider: ${{ steps.split-attestationVariant.outputs.cloudProvider }}
|
2023-03-31 06:41:32 -04:00
|
|
|
steps:
|
2023-07-17 07:45:53 -04:00
|
|
|
- name: Split nodeCount
|
|
|
|
id: split-nodeCount
|
2023-03-31 06:41:32 -04:00
|
|
|
shell: bash
|
|
|
|
run: |
|
2023-07-17 07:45:53 -04:00
|
|
|
nodeCount="${{ inputs.nodeCount }}"
|
|
|
|
workerNodes="${nodeCount##*:}"
|
|
|
|
controlPlaneNodes="${nodeCount%%:*}"
|
|
|
|
|
|
|
|
if [[ -z "${workerNodes}" ]] || [[ -z "{controlPlaneNodes}" ]]; then
|
|
|
|
echo "Invalid nodeCount input: '${nodeCount}'."
|
|
|
|
exit 1
|
2023-03-31 06:41:32 -04:00
|
|
|
fi
|
|
|
|
|
2023-07-17 07:45:53 -04:00
|
|
|
echo "workerNodes=${workerNodes}" | tee -a "$GITHUB_OUTPUT"
|
|
|
|
echo "controlPlaneNodes=${controlPlaneNodes}" | tee -a "$GITHUB_OUTPUT"
|
2023-03-31 06:41:32 -04:00
|
|
|
|
2024-01-25 09:32:19 -05:00
|
|
|
- name: Split attestationVariant
|
|
|
|
id: split-attestationVariant
|
|
|
|
shell: bash
|
|
|
|
run: |
|
|
|
|
attestationVariant="${{ inputs.attestationVariant }}"
|
|
|
|
cloudProvider="${attestationVariant%%-*}"
|
|
|
|
|
|
|
|
echo "cloudProvider=${cloudProvider}" | tee -a "$GITHUB_OUTPUT"
|
|
|
|
|
2022-12-01 07:25:30 -05:00
|
|
|
find-latest-image:
|
2022-12-09 05:51:38 -05:00
|
|
|
name: Select image
|
2022-12-01 07:25:30 -05:00
|
|
|
runs-on: ubuntu-22.04
|
|
|
|
permissions:
|
|
|
|
id-token: write
|
|
|
|
contents: read
|
|
|
|
outputs:
|
2023-11-13 12:46:20 -05:00
|
|
|
image: ${{ steps.find-latest-image.outputs.image }}
|
|
|
|
isDebugImage: ${{ steps.find-latest-image.outputs.isDebugImage }}
|
2022-12-01 07:25:30 -05:00
|
|
|
steps:
|
2023-11-14 04:33:59 -05:00
|
|
|
- name: Checkout head
|
|
|
|
if: inputs.git-ref == 'head'
|
2023-12-20 10:10:35 -05:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-11-14 04:33:59 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
|
|
|
|
|
|
|
- name: Checkout ref
|
|
|
|
if: inputs.git-ref != 'head'
|
2023-12-20 10:10:35 -05:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2023-11-14 04:33:59 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ inputs.git-ref }}
|
2023-11-14 07:25:52 -05:00
|
|
|
|
2023-11-13 12:46:20 -05:00
|
|
|
- name: Get Latest Image
|
2022-12-01 07:25:30 -05:00
|
|
|
id: find-latest-image
|
2023-11-13 12:46:20 -05:00
|
|
|
uses: ./.github/actions/find_latest_image
|
2022-12-01 07:25:30 -05:00
|
|
|
with:
|
2023-11-13 12:46:20 -05:00
|
|
|
git-ref: ${{ inputs.git-ref }}
|
|
|
|
imageVersion: ${{ inputs.imageVersion }}
|
2022-12-09 05:51:38 -05:00
|
|
|
ref: main
|
|
|
|
stream: debug
|
2022-12-01 07:25:30 -05:00
|
|
|
|
2023-01-11 08:27:18 -05:00
|
|
|
e2e-test-manual:
|
|
|
|
runs-on: ${{ inputs.runner }}
|
2022-11-08 10:43:17 -05:00
|
|
|
permissions:
|
|
|
|
id-token: write
|
2023-03-17 10:36:29 -04:00
|
|
|
checks: write
|
2022-11-08 10:43:17 -05:00
|
|
|
contents: read
|
2023-04-04 04:16:04 -04:00
|
|
|
packages: write
|
2024-04-26 06:06:01 -04:00
|
|
|
actions: write
|
2024-01-25 09:32:19 -05:00
|
|
|
needs: [find-latest-image, generate-input-parameters]
|
2023-03-20 06:04:44 -04:00
|
|
|
if: always() && !cancelled()
|
2022-05-03 05:15:53 -04:00
|
|
|
steps:
|
2023-03-20 06:04:44 -04:00
|
|
|
- name: Install basic tools (macOS)
|
2023-01-11 08:27:18 -05:00
|
|
|
if: runner.os == 'macOS'
|
|
|
|
shell: bash
|
2023-03-21 06:31:55 -04:00
|
|
|
run: brew install coreutils kubectl bash terraform
|
2023-01-11 08:27:18 -05:00
|
|
|
|
2022-12-20 07:19:12 -05:00
|
|
|
- name: Checkout head
|
|
|
|
if: inputs.git-ref == 'head'
|
2023-12-20 10:10:35 -05:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-10-24 12:47:03 -04:00
|
|
|
with:
|
2022-12-19 09:21:28 -05:00
|
|
|
ref: ${{ !github.event.pull_request.head.repo.fork && github.head_ref || '' }}
|
2023-01-18 04:15:58 -05:00
|
|
|
|
2022-12-20 07:19:12 -05:00
|
|
|
- name: Checkout ref
|
|
|
|
if: inputs.git-ref != 'head'
|
2023-12-20 10:10:35 -05:00
|
|
|
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
|
2022-12-20 07:19:12 -05:00
|
|
|
with:
|
|
|
|
ref: ${{ inputs.git-ref }}
|
2022-09-02 06:43:04 -04:00
|
|
|
|
2023-01-11 08:27:18 -05:00
|
|
|
- name: Set up gcloud CLI (macOS)
|
2024-01-26 09:41:15 -05:00
|
|
|
if: needs.generate-input-parameters.outputs.cloudProvider == 'gcp' && runner.os == 'macOS'
|
2024-02-21 09:29:06 -05:00
|
|
|
uses: google-github-actions/setup-gcloud@98ddc00a17442e89a24bbf282954a3b65ce6d200 # v2.1.0
|
2023-01-11 08:27:18 -05:00
|
|
|
|
2022-06-30 05:27:23 -04:00
|
|
|
- name: Run manual E2E test
|
2022-11-09 04:28:34 -05:00
|
|
|
id: e2e_test
|
2022-06-30 05:27:23 -04:00
|
|
|
uses: ./.github/actions/e2e_test
|
|
|
|
with:
|
2024-01-25 09:32:19 -05:00
|
|
|
workerNodesCount: ${{ needs.generate-input-parameters.outputs.workerNodes }}
|
|
|
|
controlNodesCount: ${{ needs.generate-input-parameters.outputs.controlPlaneNodes }}
|
|
|
|
cloudProvider: ${{ needs.generate-input-parameters.outputs.cloudProvider }}
|
|
|
|
attestationVariant: ${{ inputs.attestationVariant }}
|
2023-01-06 05:49:55 -05:00
|
|
|
machineType: ${{ inputs.machineType }}
|
2023-08-10 06:53:40 -04:00
|
|
|
regionZone: ${{ inputs.regionZone }}
|
2023-11-28 04:54:58 -05:00
|
|
|
gcpProject: constellation-e2e
|
2023-11-27 07:04:41 -05:00
|
|
|
gcpClusterCreateServiceAccount: "infrastructure-e2e@constellation-e2e.iam.gserviceaccount.com"
|
|
|
|
gcpIAMCreateServiceAccount: "iam-e2e@constellation-e2e.iam.gserviceaccount.com"
|
2023-01-06 05:49:55 -05:00
|
|
|
test: ${{ inputs.test }}
|
|
|
|
kubernetesVersion: ${{ inputs.kubernetesVersion }}
|
2023-03-01 10:46:23 -05:00
|
|
|
awsOpenSearchDomain: ${{ secrets.AWS_OPENSEARCH_DOMAIN }}
|
|
|
|
awsOpenSearchUsers: ${{ secrets.AWS_OPENSEARCH_USER }}
|
|
|
|
awsOpenSearchPwd: ${{ secrets.AWS_OPENSEARCH_PWD }}
|
2022-12-01 07:25:30 -05:00
|
|
|
osImage: ${{ needs.find-latest-image.outputs.image }}
|
2023-07-17 07:45:53 -04:00
|
|
|
cliVersion: ${{ inputs.cliVersion }}
|
2023-01-11 08:27:18 -05:00
|
|
|
isDebugImage: ${{ needs.find-latest-image.outputs.isDebugImage }}
|
2023-03-20 11:05:08 -04:00
|
|
|
buildBuddyApiKey: ${{ secrets.BUILDBUDDY_ORG_API_KEY }}
|
2023-04-12 07:24:13 -04:00
|
|
|
azureClusterCreateCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
|
|
|
|
azureIAMCreateCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
2023-04-04 04:16:04 -04:00
|
|
|
registry: ghcr.io
|
|
|
|
githubToken: ${{ secrets.GITHUB_TOKEN }}
|
2023-08-09 12:58:46 -04:00
|
|
|
cosignPassword: ${{ secrets.COSIGN_PASSWORD }}
|
|
|
|
cosignPrivateKey: ${{ secrets.COSIGN_PRIVATE_KEY }}
|
2023-08-04 03:43:32 -04:00
|
|
|
fetchMeasurements: ${{ contains(needs.find-latest-image.outputs.image, '/stream/stable/') }}
|
2023-11-03 11:27:28 -04:00
|
|
|
internalLoadBalancer: ${{ inputs.internalLoadBalancer }}
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation: ${{ inputs.clusterCreation }}
|
2023-10-12 07:27:02 -04:00
|
|
|
s3AccessKey: ${{ secrets.AWS_ACCESS_KEY_ID_S3PROXY }}
|
|
|
|
s3SecretKey: ${{ secrets.AWS_SECRET_ACCESS_KEY_S3PROXY }}
|
2023-12-08 08:40:31 -05:00
|
|
|
marketplaceImageVersion: ${{ inputs.marketplaceImageVersion }}
|
|
|
|
force: ${{ inputs.force }}
|
2023-12-21 13:28:18 -05:00
|
|
|
encryptionSecret: ${{ secrets.ARTIFACT_ENCRYPT_PASSWD }}
|
2022-09-02 06:40:22 -04:00
|
|
|
|
|
|
|
- name: Always terminate cluster
|
|
|
|
if: always()
|
|
|
|
uses: ./.github/actions/constellation_destroy
|
2022-11-09 04:28:34 -05:00
|
|
|
with:
|
|
|
|
kubeconfig: ${{ steps.e2e_test.outputs.kubeconfig }}
|
2023-12-15 04:37:29 -05:00
|
|
|
clusterCreation: ${{ inputs.clusterCreation }}
|
2024-01-25 09:32:19 -05:00
|
|
|
cloudProvider: ${{ needs.generate-input-parameters.outputs.cloudProvider }}
|
2023-11-14 07:25:52 -05:00
|
|
|
azureClusterDeleteCredentials: ${{ secrets.AZURE_E2E_CLUSTER_CREDENTIALS }}
|
2023-11-28 04:54:58 -05:00
|
|
|
gcpClusterDeleteServiceAccount: "infrastructure-e2e@constellation-e2e.iam.gserviceaccount.com"
|
2022-09-02 06:40:22 -04:00
|
|
|
|
2023-02-21 06:47:14 -05:00
|
|
|
- name: Always delete IAM configuration
|
2023-04-12 07:24:13 -04:00
|
|
|
if: always()
|
2023-02-21 06:47:14 -05:00
|
|
|
uses: ./.github/actions/constellation_iam_destroy
|
2023-04-12 07:24:13 -04:00
|
|
|
with:
|
2024-01-25 09:32:19 -05:00
|
|
|
cloudProvider: ${{ needs.generate-input-parameters.outputs.cloudProvider }}
|
2023-04-12 07:24:13 -04:00
|
|
|
azureCredentials: ${{ secrets.AZURE_E2E_IAM_CREDENTIALS }}
|
2023-11-27 07:04:41 -05:00
|
|
|
gcpServiceAccount: "iam-e2e@constellation-e2e.iam.gserviceaccount.com"
|
2024-04-26 06:06:01 -04:00
|
|
|
|
|
|
|
- name: Update tfstate
|
|
|
|
if: always()
|
|
|
|
env:
|
|
|
|
GH_TOKEN: ${{ github.token }}
|
|
|
|
uses: ./.github/actions/update_tfstate
|
|
|
|
with:
|
|
|
|
name: terraform-state-${{ steps.e2e_test.outputs.namePrefix }}
|
|
|
|
runID: ${{ github.run_id }}
|
|
|
|
encryptionSecret: ${{ secrets.ARTIFACT_ENCRYPT_PASSWD }}
|