Skip to content

Commit 667ac6d

Browse files
authored
Merge pull request #164 from IABTechLab/gdm-UID2-5050-e2e
Enhanced E2E pipeline to better support real env testing
2 parents 877d3a2 + 8fbbd9d commit 667ac6d

35 files changed

+484
-733
lines changed

.github/workflows/shared-publish-to-pypi-versioned.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
default: '.'
1717
publish_vulnerabilities:
1818
type: string
19-
default: true
19+
default: "true"
2020

2121
env:
2222
REPO: ${{ github.event.repository.name }}

.github/workflows/shared-run-e2e-tests.yaml

+72-127
Large diffs are not rendered by default.

.github/workflows/shared-validate-image.yaml

-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,6 @@ jobs:
100100
with:
101101
scan_severity: HIGH,CRITICAL
102102
failure_severity: ${{ inputs.failure_severity }}
103-
publish_vulnerabilities: ${{ inputs.publish_vulnerabilities }}
104103
image_ref: ${{ steps.meta.outputs.tags }}
105104
scan_type: image
106105
full_report: 'true'

actions/prepare_aks_metadata/action.yaml

+11-15
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,19 @@ inputs:
55
operator_image_version:
66
description: The uid2-operator image version
77
default: latest
8-
admin_root:
9-
description: The root path for uid2-admin folder
10-
default: uid2-admin
11-
operator_root:
12-
description: The root path for uid2-operator folder
13-
default: uid2-operator
8+
target_environment:
9+
description: The target environment [mock, integ, prod]
10+
required: true
1411
bore_url_core:
1512
description: The bore URL for core service
1613
required: true
1714
bore_url_optout:
1815
description: The bore URL for optout service
1916
required: true
2017
outputs:
21-
output_template_file:
22-
description: The output template file
23-
value: ${{ steps.enclave_artifacts.outputs.OUTPUT_TEMPLATE_FILE }}
18+
template_file:
19+
description: The template file
20+
value: ${{ steps.enclave_artifacts.outputs.template_file }}
2421

2522
runs:
2623
using: "composite"
@@ -30,32 +27,31 @@ runs:
3027
shell: bash
3128
run: |
3229
az --version
33-
30+
3431
- name: Generate AKS enclave deployment artifacts
3532
id: enclave_artifacts
3633
shell: bash
3734
env:
38-
IMAGE_VERSION: ${{ inputs.operator_image_version }}
39-
OPERATOR_ROOT: ${{ inputs.operator_root }}
4035
BORE_URL_CORE: ${{ inputs.bore_url_core }}
4136
BORE_URL_OPTOUT: ${{ inputs.bore_url_optout }}
37+
IMAGE_VERSION: ${{ inputs.operator_image_version }}
38+
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
4239
run: |
4340
bash uid2-shared-actions/scripts/aks/prepare_aks_artifacts.sh
4441
4542
- name: Prepare AKS enclave ID
4643
id: enclave_id
4744
shell: bash
4845
env:
49-
OUTPUT_POLICY_DIGEST_FILE: ${{ steps.enclave_artifacts.outputs.OUTPUT_POLICY_DIGEST_FILE }}
46+
POLICY_DIGEST_FILE: ${{ steps.enclave_artifacts.outputs.policy_digest_file }}
5047
run: |
5148
bash uid2-shared-actions/scripts/aks/prepare_aks_enclave_id.sh
5249
5350
- name: Prepare AKS enclave metadata
5451
id: enclave_metadata
5552
shell: bash
5653
env:
57-
ADMIN_ROOT: ${{ inputs.admin_root }}
58-
ENCLAVE_ID: ${{ steps.enclave_id.outputs.ENCLAVE_ID }}
54+
ENCLAVE_ID: ${{ steps.enclave_id.outputs.enclave_id }}
5955
ENCLAVE_PROTOCOL: azure-cc
6056
run: |
6157
bash uid2-shared-actions/scripts/save_enclave_id_to_admin.sh

actions/prepare_aws_metadata/action.yaml

+18-5
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,41 @@ name: Prepare AWS Metadata
22
description: Prepares the AWS Nitro enclave metadata
33

44
inputs:
5-
admin_root:
6-
description: The root path for uid2-admin folder
7-
default: uid2-admin
5+
identity_scope:
6+
description: The identity scope [UID2, EUID]
7+
required: true
8+
target_environment:
9+
description: The target environment [mock, integ, prod]
10+
required: true
811
aws_pcr0:
912
description: The AWS PCR0
1013
required: true
1114

1215
outputs:
1316
operator_key:
1417
description: The operator key
15-
value: ${{ steps.enclave_metadata.outputs.OPERATOR_KEY }}
18+
value: ${{ steps.operator_key.outputs.operator_key }}
1619

1720
runs:
1821
using: "composite"
1922

2023
steps:
2124
- name: Prepare AWS enclave metadata
2225
id: enclave_metadata
26+
if: ${{ inputs.target_environment == 'mock' }}
2327
shell: bash
2428
env:
25-
ADMIN_ROOT: ${{ inputs.admin_root }}
2629
ENCLAVE_ID: ${{ inputs.aws_pcr0 }}
2730
ENCLAVE_PROTOCOL: aws-nitro
2831
run: |
2932
bash uid2-shared-actions/scripts/save_enclave_id_to_admin.sh
33+
34+
- name: Get operator key
35+
id: operator_key
36+
shell: bash
37+
env:
38+
IDENTITY_SCOPE: ${{ inputs.identity_scope }}
39+
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
40+
ENCLAVE_PROTOCOL: aws-nitro
41+
run: |
42+
bash ./uid2-shared-actions/scripts/get_operator_key.sh

actions/prepare_azure_metadata/action.yaml

+12-12
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ inputs:
55
operator_image_version:
66
description: The uid2-operator image version
77
default: latest
8-
admin_root:
9-
description: The root path for uid2-admin folder
10-
default: uid2-admin
8+
target_environment:
9+
description: The target environment [mock, integ, prod]
10+
required: true
1111
outputs:
12-
output_template_file:
13-
description: The output template file
14-
value: ${{ steps.enclave_artifacts.outputs.OUTPUT_TEMPLATE_FILE }}
15-
output_parameters_file:
16-
description: The output parameters file
17-
value: ${{ steps.enclave_artifacts.outputs.OUTPUT_PARAMETERS_FILE }}
12+
template_file:
13+
description: The template file
14+
value: ${{ steps.enclave_artifacts.outputs.template_file }}
15+
parameters_file:
16+
description: The parameters file
17+
value: ${{ steps.enclave_artifacts.outputs.parameters_file }}
1818

1919
runs:
2020
using: "composite"
@@ -37,16 +37,16 @@ runs:
3737
id: enclave_id
3838
shell: bash
3939
env:
40-
OUTPUT_POLICY_DIGEST_FILE: ${{ steps.enclave_artifacts.outputs.OUTPUT_POLICY_DIGEST_FILE }}
40+
POLICY_DIGEST_FILE: ${{ steps.enclave_artifacts.outputs.policy_digest_file }}
4141
run: |
4242
bash uid2-shared-actions/scripts/azure/prepare_azure_enclave_id.sh
4343
4444
- name: Prepare Azure enclave metadata
4545
id: enclave_metadata
46+
if: ${{ inputs.target_environment == 'mock' }}
4647
shell: bash
4748
env:
48-
ADMIN_ROOT: ${{ inputs.admin_root }}
49-
ENCLAVE_ID: ${{ steps.enclave_id.outputs.ENCLAVE_ID }}
49+
ENCLAVE_ID: ${{ steps.enclave_id.outputs.enclave_id }}
5050
ENCLAVE_PROTOCOL: azure-cc
5151
run: |
5252
bash uid2-shared-actions/scripts/save_enclave_id_to_admin.sh

actions/prepare_eks_metadata/action.yaml

-32
This file was deleted.

actions/prepare_gcp_metadata/action.yaml

+17-7
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ inputs:
55
operator_image_version:
66
description: The uid2-operator image version
77
default: latest
8-
admin_root:
9-
description: The root path for uid2-admin folder
10-
default: uid2-admin
8+
target_environment:
9+
description: The target environment [mock, integ, prod]
10+
required: true
1111
gcp_service_account:
1212
description: The GCP service account
1313
required: true
@@ -21,10 +21,10 @@ inputs:
2121
outputs:
2222
image_hash:
2323
description: The operator image hash
24-
value: ${{ steps.image_digest.outputs.IMAGE_HASH }}
24+
value: ${{ steps.image_digest.outputs.image_hash }}
2525
operator_key:
2626
description: The operator key
27-
value: ${{ steps.enclave_metadata.outputs.OPERATOR_KEY }}
27+
value: ${{ steps.operator_key.outputs.operator_key }}
2828

2929
runs:
3030
using: "composite"
@@ -73,10 +73,20 @@ runs:
7373
7474
- name: Prepare GCP enclave metadata
7575
id: enclave_metadata
76+
if: ${{ inputs.target_environment == 'mock' }}
7677
shell: bash
7778
env:
78-
ADMIN_ROOT: ${{ inputs.admin_root }}
79-
ENCLAVE_ID: ${{ steps.enclave_id.outputs.ENCLAVE_ID }}
79+
ENCLAVE_ID: ${{ steps.enclave_id.outputs.enclave_id }}
8080
ENCLAVE_PROTOCOL: gcp-oidc
8181
run: |
8282
bash uid2-shared-actions/scripts/save_enclave_id_to_admin.sh
83+
84+
- name: Get operator key
85+
id: operator_key
86+
shell: bash
87+
env:
88+
IDENTITY_SCOPE: UID2
89+
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
90+
ENCLAVE_PROTOCOL: gcp-oidc
91+
run: |
92+
bash ./uid2-shared-actions/scripts/get_operator_key.sh

actions/run_e2e_tests/action.yaml

+2-11
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,30 @@ description: Pull uid2-e2e Docker image and run E2E test suite
44
inputs:
55
e2e_network:
66
description: The network to use for the E2E test
7-
type: string
87
default: e2e_default
98
e2e_image_version:
109
description: The version of E2E image
11-
required: false
1210
default: latest
1311
uid2_e2e_identity_scope:
1412
description: Environment variable to run the E2E test
15-
required: false
1613
default: UID2
1714
uid2_e2e_pipeline_operator_type:
1815
description: Environment variable to run the E2E test
19-
required: false
2016
default: PUBLIC
2117
uid2_e2e_pipeline_operator_url:
2218
description: Environment variable to run the E2E test
23-
required: false
2419
default: http://publicoperator:8080
2520
uid2_e2e_pipeline_operator_cloud_provider:
2621
description: Environment variable to run the E2E test
27-
required: false
2822
default: PUBLIC
2923
uid2_e2e_phone_support:
3024
description: Environment variable to run the E2E test
31-
required: false
3225
default: 'true'
3326
uid2_e2e_pipeline_core_url:
34-
description: 'Environment variable for the Core service'
35-
required: false
27+
description: Environment variable for Core service
3628
default: 'http://core:8088'
3729
uid2_e2e_pipeline_optout_url:
38-
description: 'Environment variable for the OptOut service'
39-
required: false
30+
description: Environment variable for OptOut service
4031
default: 'http://optout:8081'
4132

4233
runs:

actions/start_aks_private_operator/action.yaml

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@ name: Start AKS Private Operator
22
description: Spins up an AKS private operator
33

44
inputs:
5-
output_template_file:
6-
description: The output template file
5+
template_file:
6+
description: The template file
77
required: true
88
azure_credentials:
99
description: The Azure credentials
@@ -28,6 +28,6 @@ runs:
2828
id: start_aks
2929
shell: bash
3030
env:
31-
OUTPUT_TEMPLATE_FILE: ${{ inputs.output_template_file }}
31+
TEMPLATE_FILE: ${{ inputs.template_file }}
3232
run: |
3333
bash uid2-shared-actions/scripts/aks/start_aks_enclave.sh

actions/start_aws_private_operator/action.yaml

+4
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,9 @@ inputs:
2020
identity_scope:
2121
description: The identity scope [UID2, EUID]
2222
required: true
23+
target_environment:
24+
description: The target environment [mock, integ, prod]
25+
required: true
2326
operator_key:
2427
description: The operator key
2528
required: true
@@ -64,6 +67,7 @@ runs:
6467
AWS_REGION: ${{ inputs.aws_region }}
6568
AWS_AMI: ${{ inputs.aws_ami }}
6669
IDENTITY_SCOPE: ${{ inputs.identity_scope }}
70+
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
6771
OPERATOR_KEY: ${{ inputs.operator_key }}
6872
run: |
6973
bash uid2-shared-actions/scripts/aws/start_aws_enclave.sh

actions/start_azure_private_operator/action.yaml

+11-7
Original file line numberDiff line numberDiff line change
@@ -8,20 +8,23 @@ inputs:
88
bore_url_optout:
99
description: The bore URL for optout service
1010
required: true
11-
output_template_file:
12-
description: The output template file
11+
template_file:
12+
description: The template file
1313
required: true
14-
output_parameters_file:
15-
description: The output parameters file
14+
parameters_file:
15+
description: The parameters file
1616
required: true
1717
azure_credentials:
1818
description: The Azure credentials
1919
required: true
20+
target_environment:
21+
description: The target environment [mock, integ, prod]
22+
required: true
2023

2124
outputs:
2225
azure_container_group_name:
2326
description: The Azure instance name
24-
value: ${{ steps.start_azure.outputs.AZURE_CONTAINER_GROUP_NAME }}
27+
value: ${{ steps.start_azure.outputs.azure_container_group_name }}
2528
uid2_e2e_pipeline_operator_url:
2629
description: The Azure operator URL
2730
value: ${{ steps.start_azure.outputs.uid2_e2e_pipeline_operator_url }}
@@ -42,7 +45,8 @@ runs:
4245
env:
4346
BORE_URL_CORE: ${{ inputs.bore_url_core }}
4447
BORE_URL_OPTOUT: ${{ inputs.bore_url_optout }}
45-
OUTPUT_TEMPLATE_FILE: ${{ inputs.output_template_file }}
46-
OUTPUT_PARAMETERS_FILE: ${{ inputs.output_parameters_file }}
48+
TEMPLATE_FILE: ${{ inputs.template_file }}
49+
PARAMETERS_FILE: ${{ inputs.parameters_file }}
50+
TARGET_ENVIRONMENT: ${{ inputs.target_environment }}
4751
run: |
4852
bash uid2-shared-actions/scripts/azure/start_azure_enclave.sh

0 commit comments

Comments
 (0)