Skip to content

Commit 1638a88

Browse files
authored
Merge pull request #1563 from IABTechLab/mkc-UID2-4765-aks-workflow-4
Add Azure AKS workflow
2 parents 5323727 + 64377e6 commit 1638a88

File tree

11 files changed

+328
-73
lines changed

11 files changed

+328
-73
lines changed

.github/actions/build_ami/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ runs:
5959
uses: actions/checkout@v4
6060

6161
- name: Get EIF for Release ${{ inputs.operator_release }}
62-
uses: IABTechLab/uid2-operator/.github/actions/download_release_artifact@main
62+
uses: ./.github/actions/download_release_artifact
6363
if: ${{ inputs.operator_release != '' }}
6464
with:
6565
github_token: ${{ inputs.github_token }}

.github/actions/build_eks_docker_image/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ runs:
4747
mkdir ${{ inputs.artifacts_output_dir }} -p
4848
4949
- name: Get EIF for Release ${{ inputs.operator_release }}
50-
uses: IABTechLab/uid2-operator/.github/actions/download_release_artifact@main
50+
uses: ./.github/actions/download_release_artifact
5151
if: ${{ inputs.operator_release != '' }}
5252
with:
5353
github_token: ${{ inputs.github_token }}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: 'Install Azure CLI'
2+
description: 'Install Azure CLI'
3+
runs:
4+
using: 'composite'
5+
steps:
6+
- name: uninstall azure-cli
7+
shell: bash
8+
run: |
9+
sudo apt-get remove -y azure-cli
10+
11+
- name: install azure-cli 2.61.0
12+
shell: bash
13+
run: |
14+
sudo apt-get update
15+
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
16+
sudo mkdir -p /etc/apt/keyrings
17+
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
18+
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
19+
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
20+
AZ_DIST=$(lsb_release -cs)
21+
echo "Types: deb
22+
URIs: https://packages.microsoft.com/repos/azure-cli/
23+
Suites: ${AZ_DIST}
24+
Components: main
25+
Architectures: $(dpkg --print-architecture)
26+
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
27+
sudo apt-get update
28+
sudo apt-get install azure-cli
29+
30+
apt-cache policy azure-cli
31+
# Obtain the currently installed distribution
32+
AZ_DIST=$(lsb_release -cs)
33+
# Store an Azure CLI version of choice
34+
AZ_VER=2.61.0
35+
# Install a specific version
36+
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades

.github/workflows/build-uid2-ami.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ jobs:
4242

4343
- name: Build UID2 Operator AMI
4444
id: buildAMI
45-
uses: IABTechLab/uid2-operator/.github/actions/build_ami@main
45+
uses: ./.github/actions/build_ami
4646
with:
4747
identity_scope: uid2
4848
eif_repo_owner: ${{ env.REPO_OWNER }}
@@ -92,7 +92,7 @@ jobs:
9292
9393
- name: Build EUID Operator AMI
9494
id: buildAMI
95-
uses: IABTechLab/uid2-operator/.github/actions/build_ami@main
95+
uses: ./.github/actions/build_ami
9696
with:
9797
identity_scope: euid
9898
eif_repo_owner: ${{ env.REPO_OWNER }}

.github/workflows/publish-all-operators.yaml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,18 @@ jobs:
169169
pattern: gcp-oidc-enclave-ids-*
170170
path: ./manifests/gcp_oidc_operator
171171

172-
- name: Download Azure manifest
172+
- name: Download Azure CC manifest
173173
uses: actions/download-artifact@v4
174174
with:
175175
pattern: azure-cc-enclave-id-*
176176
path: ./manifests/azure_cc_operator
177177

178+
- name: Download Azure AKS manifest
179+
uses: actions/download-artifact@v4
180+
with:
181+
pattern: azure-aks-enclave-id-*
182+
path: ./manifests/azure_aks_operator
183+
178184
- name: Download EIF manifest
179185
uses: actions/download-artifact@v4
180186
with:
@@ -217,6 +223,7 @@ jobs:
217223
(cd ./deployment/aws-euid-deployment-files-${{ needs.start.outputs.new_version }} && zip -r ../../aws-euid-deployment-files-${{ needs.start.outputs.new_version }}.zip . )
218224
(cd ./deployment/aws-uid2-deployment-files-${{ needs.start.outputs.new_version }} && zip -r ../../aws-uid2-deployment-files-${{ needs.start.outputs.new_version }}.zip . )
219225
(cd ./deployment/azure-cc-deployment-files-${{ needs.start.outputs.new_version }} && zip -r ../../azure-cc-deployment-files-${{ needs.start.outputs.new_version }}.zip . )
226+
(cd ./deployment/azure-aks-deployment-files-${{ needs.start.outputs.new_version }} && zip -r ../../azure-aks-deployment-files-${{ needs.start.outputs.new_version }}.zip . )
220227
(cd ./deployment/gcp-oidc-deployment-files-${{ needs.start.outputs.new_version }} && zip -r ../../gcp-oidc-deployment-files-${{ needs.start.outputs.new_version }}.zip . )
221228
(cd manifests && zip -r ../uid2-operator-release-manifests-${{ needs.start.outputs.new_version }}.zip .)
222229
@@ -230,6 +237,7 @@ jobs:
230237
./aws-euid-deployment-files-${{ needs.start.outputs.new_version }}.zip
231238
./aws-uid2-deployment-files-${{ needs.start.outputs.new_version }}.zip
232239
./azure-cc-deployment-files-${{ needs.start.outputs.new_version }}.zip
240+
./azure-aks-deployment-files-${{ needs.start.outputs.new_version }}.zip
233241
./gcp-oidc-deployment-files-${{ needs.start.outputs.new_version }}.zip
234242
./uid2-operator-release-manifests-${{ needs.start.outputs.new_version }}.zip
235243
notifyFailure:

.github/workflows/publish-aws-eks-nitro-enclave-docker.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,12 @@ jobs:
3636
security-events: write
3737
packages: write
3838
steps:
39+
- name: Checkout
40+
uses: actions/checkout@v4
41+
3942
- name: Build Docker Image for EKS Pod
4043
id: build_docker_image_uid
41-
uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@main
44+
uses: ./.github/actions/build_eks_docker_image
4245
with:
4346
identity_scope: uid2
4447
artifacts_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/uid2
@@ -61,9 +64,12 @@ jobs:
6164
security-events: write
6265
packages: write
6366
steps:
67+
- name: Checkout
68+
uses: actions/checkout@v4
69+
6470
- name: Build Docker Image for EKS Pod
6571
id: build_docker_image_euid
66-
uses: IABTechLab/uid2-operator/.github/actions/build_eks_docker_image@main
72+
uses: ./.github/actions/build_eks_docker_image
6773
with:
6874
identity_scope: euid
6975
artifacts_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/euid

.github/workflows/publish-aws-nitro-eif.yaml

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,12 @@ jobs:
4848
env:
4949
GITHUB_CONTEXT: ${{ toJson(github) }}
5050

51+
- name: Checkout
52+
uses: actions/checkout@v4
53+
5154
- name: Update Operator Version
5255
id: update_version
53-
uses: IABTechLab/uid2-operator/.github/actions/update_operator_version@main
56+
uses: ./.github/actions/update_operator_version
5457
with:
5558
release_type: ${{ inputs.release_type }}
5659
version_number_input: ${{ inputs.version_number_input }}
@@ -68,9 +71,12 @@ jobs:
6871
runs-on: ubuntu-latest
6972
needs: start
7073
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
7177
- name: Build UID2 AWS EIF
7278
id: build_uid2_eif
73-
uses: IABTechLab/uid2-operator/.github/actions/build_aws_eif@main
79+
uses: ./.github/actions/build_aws_eif
7480
with:
7581
identity_scope: uid2
7682
artifacts_base_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/uid2
@@ -104,9 +110,12 @@ jobs:
104110
runs-on: ubuntu-latest
105111
needs: start
106112
steps:
113+
- name: Checkout
114+
uses: actions/checkout@v4
115+
107116
- name: Build EUID AWS EIF
108117
id: build_euid_eif
109-
uses: IABTechLab/uid2-operator/.github/actions/build_aws_eif@main
118+
uses: ./.github/actions/build_aws_eif
110119
with:
111120
identity_scope: euid
112121
artifacts_base_output_dir: ${{ env.ARTIFACTS_BASE_OUTPUT_DIR }}/euid

.github/workflows/publish-azure-cc-enclave-docker.yaml

Lines changed: 69 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,16 @@ jobs:
6969
outputs:
7070
jar_version: ${{ steps.update_version.outputs.new_version }}
7171
image_tag: ${{ steps.update_version.outputs.image_tag }}
72+
is_release: ${{ steps.update_version.outputs.is_release }}
73+
docker_version: ${{ steps.meta.outputs.version }}
74+
tags: ${{ steps.meta.outputs.tags }}
7275
steps:
76+
- name: Checkout
77+
uses: actions/checkout@v4
78+
7379
- name: Update Operator Version
7480
id: update_version
75-
uses: IABTechLab/uid2-operator/.github/actions/update_operator_version@main
81+
uses: ./.github/actions/update_operator_version
7682
with:
7783
release_type: ${{ inputs.release_type }}
7884
version_number_input: ${{ inputs.version_number_input }}
@@ -159,97 +165,98 @@ jobs:
159165
JAR_VERSION=${{ steps.update_version.outputs.new_version }}
160166
IMAGE_VERSION=${{ steps.update_version.outputs.new_version }}
161167
162-
- name: uninstall azure-cli
163-
run: |
164-
sudo apt-get remove -y azure-cli
165-
166-
- name: install azure-cli 2.61.0
167-
run: |
168-
sudo apt-get update
169-
sudo apt-get install apt-transport-https ca-certificates curl gnupg lsb-release
170-
sudo mkdir -p /etc/apt/keyrings
171-
curl -sLS https://packages.microsoft.com/keys/microsoft.asc |
172-
gpg --dearmor | sudo tee /etc/apt/keyrings/microsoft.gpg > /dev/null
173-
sudo chmod go+r /etc/apt/keyrings/microsoft.gpg
174-
AZ_DIST=$(lsb_release -cs)
175-
echo "Types: deb
176-
URIs: https://packages.microsoft.com/repos/azure-cli/
177-
Suites: ${AZ_DIST}
178-
Components: main
179-
Architectures: $(dpkg --print-architecture)
180-
Signed-by: /etc/apt/keyrings/microsoft.gpg" | sudo tee /etc/apt/sources.list.d/azure-cli.sources
181-
sudo apt-get update
182-
sudo apt-get install azure-cli
183-
184-
apt-cache policy azure-cli
185-
# Obtain the currently installed distribution
186-
AZ_DIST=$(lsb_release -cs)
187-
# Store an Azure CLI version of choice
188-
AZ_VER=2.61.0
189-
# Install a specific version
190-
sudo apt-get install azure-cli=${AZ_VER}-1~${AZ_DIST} --allow-downgrades
168+
azureCc:
169+
name: Create Azure CC artifacts
170+
runs-on: ubuntu-latest
171+
permissions: {}
172+
needs: buildImage
173+
steps:
174+
- name: Checkout
175+
uses: actions/checkout@v4
176+
177+
- name: Install Azure CLI
178+
uses: ./.github/actions/install_az_cli
191179

192180
- name: check azure-cli version
193181
run: |
194182
az --version
195183
196184
- name: Generate Azure deployment artifacts
197185
env:
198-
IMAGE: ${{ steps.meta.outputs.tags }}
186+
IMAGE: ${{ needs.buildImage.outputs.tags }}
199187
OUTPUT_DIR: ${{ env.ARTIFACTS_OUTPUT_DIR }}
200188
MANIFEST_DIR: ${{ env.MANIFEST_OUTPUT_DIR }}
201-
VERSION_NUMBER: ${{ steps.update_version.outputs.new_version }}
189+
VERSION_NUMBER: ${{ needs.buildImage.outputs.jar_version }}
202190
run: |
203191
bash ./scripts/azure-cc/deployment/generate-deployment-artifacts.sh
204192
205193
- name: Upload deployment artifacts
206194
uses: actions/upload-artifact@v4
207195
with:
208-
name: azure-cc-deployment-files-${{ steps.update_version.outputs.new_version }}
196+
name: azure-cc-deployment-files-${{ needs.buildImage.outputs.jar_version }}
209197
path: ${{ env.ARTIFACTS_OUTPUT_DIR }}
210198
if-no-files-found: error
211199

212200
- name: Upload manifest
213201
uses: actions/upload-artifact@v4
214202
with:
215-
name: azure-cc-enclave-id-${{ steps.update_version.outputs.new_version }}
203+
name: azure-cc-enclave-id-${{ needs.buildImage.outputs.jar_version }}
216204
path: ${{ env.MANIFEST_OUTPUT_DIR }}
217205
if-no-files-found: error
218206

219-
- name: Generate release archive
220-
if: ${{ inputs.version_number_input == '' && steps.update_version.outputs.is_release == 'true' }}
207+
e2eAzureCc:
208+
name: E2E Azure CC
209+
uses: ./.github/workflows/run-e2e-tests-on-operator.yaml
210+
needs: [buildImage, azureCc]
211+
with:
212+
operator_type: azure
213+
operator_image_version: ${{ needs.buildImage.outputs.image_tag }}
214+
secrets: inherit
215+
216+
azureAks:
217+
name: Create Azure AKS artifacts
218+
runs-on: ubuntu-latest
219+
permissions: {}
220+
needs: buildImage
221+
steps:
222+
- name: Checkout
223+
uses: actions/checkout@v4
224+
225+
- name: Install Azure CLI
226+
uses: ./.github/actions/install_az_cli
227+
228+
- name: check azure-cli version
229+
run: |
230+
az --version
231+
232+
- name: Generate Azure deployment artifacts
233+
env:
234+
IMAGE: ${{ needs.buildImage.outputs.tags }}
235+
OUTPUT_DIR: ${{ env.ARTIFACTS_OUTPUT_DIR }}
236+
MANIFEST_DIR: ${{ env.MANIFEST_OUTPUT_DIR }}
237+
VERSION_NUMBER: ${{ needs.buildImage.outputs.jar_version }}
221238
run: |
222-
zip -j ${{ env.ARTIFACTS_OUTPUT_DIR }}/uid2-operator-deployment-artifacts-${{ steps.meta.outputs.version }}.zip ${{ env.ARTIFACTS_OUTPUT_DIR }}/*
239+
bash ./scripts/azure-aks/deployment/generate-deployment-artifacts.sh
223240
224-
- name: Build changelog
225-
id: github_release
226-
if: ${{ inputs.version_number_input == '' && steps.update_version.outputs.is_release == 'true' }}
227-
uses: mikepenz/release-changelog-builder-action@v4
241+
- name: Upload deployment artifacts
242+
uses: actions/upload-artifact@v4
228243
with:
229-
configurationJson: |
230-
{
231-
"template": "#{{CHANGELOG}}\n## Installation\n```\ndocker pull ${{ steps.meta.outputs.tags }}\n```\n\n## Image reference to deploy: \n```\n${{ steps.update_version.outputs.image_tag }}\n```\n\n## Changelog\n#{{UNCATEGORIZED}}",
232-
"pr_template": " - #{{TITLE}} - ( PR: ##{{NUMBER}} )"
233-
}
234-
env:
235-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
244+
name: azure-aks-deployment-files-${{ needs.buildImage.outputs.jar_version }}
245+
path: ${{ env.ARTIFACTS_OUTPUT_DIR }}
246+
if-no-files-found: error
236247

237-
- name: Create release
238-
if: ${{ inputs.version_number_input == '' && steps.update_version.outputs.is_release == 'true' }}
239-
uses: softprops/action-gh-release@v2
248+
- name: Upload manifest
249+
uses: actions/upload-artifact@v4
240250
with:
241-
name: ${{ steps.update_version.outputs.new_version }}
242-
body: ${{ steps.github_release.outputs.changelog }}
243-
draft: true
244-
files: |
245-
${{ env.ARTIFACTS_OUTPUT_DIR }}/uid2-operator-deployment-artifacts-${{ steps.update_version.outputs.new_version }}.zip
246-
${{ env.MANIFEST_OUTPUT_DIR }}/azure-cc-operator-digest-${{ steps.update_version.outputs.new_version }}.txt
247-
248-
e2e:
249-
name: E2E
251+
name: azure-aks-enclave-id-${{ needs.buildImage.outputs.jar_version }}
252+
path: ${{ env.MANIFEST_OUTPUT_DIR }}
253+
if-no-files-found: error
254+
255+
e2eAzureAks:
256+
name: E2E Azure AKS
250257
uses: ./.github/workflows/run-e2e-tests-on-operator.yaml
251-
needs: buildImage
258+
needs: [buildImage, azureAks]
252259
with:
253-
operator_type: azure
260+
operator_type: aks
254261
operator_image_version: ${{ needs.buildImage.outputs.image_tag }}
255262
secrets: inherit

.github/workflows/publish-gcp-oidc-enclave-docker.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,12 @@ jobs:
7171
jar_version: ${{ steps.update_version.outputs.new_version }}
7272
image_tag: ${{ steps.update_version.outputs.image_tag }}
7373
steps:
74+
- name: Checkout
75+
uses: actions/checkout@v4
76+
7477
- name: Update Operator Version
7578
id: update_version
76-
uses: IABTechLab/uid2-operator/.github/actions/update_operator_version@main
79+
uses: ./.github/actions/update_operator_version
7780
with:
7881
release_type: ${{ inputs.release_type }}
7982
version_number_input: ${{ inputs.version_number_input }}

0 commit comments

Comments
 (0)