Skip to content

Commit 642ed97

Browse files
committed
add ORAS end of life annotation and cleanup
1 parent dc975d4 commit 642ed97

13 files changed

+67
-53
lines changed

.github/workflows/_cleanup.yml

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -86,27 +86,31 @@ jobs:
8686
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
8787
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
8888

89+
- name: Set Azure Registry
90+
run: |
91+
echo "AZURE_REG_NAME=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}" >> $GITHUB_ENV
92+
93+
- name: Log in to Azure Container Registry
94+
run: az acr login --name $AZURE_REG_NAME
95+
8996
- name: Cleanup Hello World ACI Images
9097
if: ${{ inputs.test-name == 'hello-world-aci' }}
9198
run: |
9299
# adding || true so that it doesn't fail if the image doesn't exist (i.e. helloworld didn't run)
93-
az acr login --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}
94-
az acr repository delete --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }} --image private/${{ github.actor }}/acc/samples/aci/helloworld:${{ github.sha }} --yes || true
100+
az acr repository delete --name $AZURE_REG_NAME --image private/${{ github.actor }}/acc/samples/aci/helloworld:${{ github.sha }} --yes || true
95101
96102
- name: Cleanup Hello World AKS Images
97103
if: ${{ inputs.test-name == 'hello-world-aks' }}
98104
run: |
99105
# adding || true so that it doesn't fail if the image doesn't exist (i.e. helloworld didn't run)
100-
az acr login --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}
101-
az acr repository delete --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }} --image private/${{ github.actor }}/acc/samples/aks/helloworld:${{ github.sha }} --yes || true
106+
az acr repository delete --name $AZURE_REG_NAME --image private/${{ github.actor }}/acc/samples/aks/helloworld:${{ github.sha }} --yes || true
102107
103108
- name: Cleanup Kafka Images
104109
if: ${{ inputs.test-name == 'kafka' }}
105110
run: |
106111
# adding || true so that it doesn't fail if the image doesn't exist (i.e. kafka didn't run)
107-
az acr login --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}
108-
az acr repository delete --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }} --image private/${{ github.actor }}/acc/samples/kafka/consumer:${{ github.sha }} --yes || true
109-
az acr repository delete --name ${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }} --image private/${{ github.actor }}/acc/samples/kafka/producer:${{ github.sha }} --yes || true
112+
az acr repository delete --name $AZURE_REG_NAME --image private/${{ github.actor }}/acc/samples/kafka/consumer:${{ github.sha }} --yes || true
113+
az acr repository delete --name $AZURE_REG_NAME --image private/${{ github.actor }}/acc/samples/kafka/producer:${{ github.sha }} --yes || true
110114
111115
cleanup-cluster:
112116
name: Clean Up Cluster

.github/workflows/_deploy_aci.yml

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
type: string
1010
helloworld-image:
1111
description: "Hello World ACI Image"
12-
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.9"
12+
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.10"
1313
required: true
1414
type: string
1515
debug:
@@ -25,7 +25,7 @@ on:
2525
type: string
2626
helloworld-image:
2727
description: "Hello World ACI Image"
28-
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.9"
28+
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.10"
2929
required: true
3030
type: string
3131
debug:
@@ -52,15 +52,13 @@ jobs:
5252
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
5353
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5454

55-
- name: Login to Public Azure Container Registry
56-
if: github.event_name != 'pull_request'
55+
- name: Set Azure Registry
5756
run: |
58-
az acr login --name ${{ secrets.AZURE_REGISTRY_NAME }}
57+
echo "AZURE_REG_NAME=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}" >> $GITHUB_ENV
58+
echo "AZURE_REG_URL=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_URL || secrets.AZURE_REGISTRY_URL }}" >> $GITHUB_ENV
5959
60-
- name: Login to Test Azure Container Registry
61-
if: github.event_name == 'pull_request'
62-
run: |
63-
az acr login --name ${{ secrets.TEST_AZURE_REGISTRY_NAME }}
60+
- name: Log in to Azure Container Registry
61+
run: az acr login --name $AZURE_REG_NAME
6462

6563
- name: Install Dependencies
6664
id: install-dependencies
@@ -78,9 +76,9 @@ jobs:
7876
run: |
7977
# check if official image
8078
if [[ "${{ inputs.helloworld-image }}" == *"mcr.microsoft.com"* ]]; then
81-
echo HELLO_WORLD_IMAGE='${{ inputs.helloworld-image }}' >> $GITHUB_ENV
79+
echo "HELLO_WORLD_IMAGE=${{ inputs.helloworld-image }}" >> $GITHUB_ENV
8280
else
83-
echo HELLO_WORLD_IMAGE='${{ (github.event_name != 'pull_request' && secrets.AZURE_REGISTRY_URL) || secrets.TEST_AZURE_REGISTRY_URL }}'/'${{ inputs.helloworld-image }}' >> $GITHUB_ENV
81+
echo "HELLO_WORLD_IMAGE=$AZURE_REG_URL/${{ inputs.helloworld-image }}" >> $GITHUB_ENV
8482
fi
8583
8684
- name: Substitute Environment Variables

.github/workflows/_deploy_helloworld_aks_test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,13 @@ jobs:
3131
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
3232
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
3333

34-
- name: Log in to Public Azure Container Registry
35-
if: github.event_name != 'pull_request'
36-
run: az acr login --name ${{ secrets.AZURE_REGISTRY_NAME }}
34+
- name: Set Azure Registry
35+
run: |
36+
echo "AZURE_REG_NAME=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}" >> $GITHUB_ENV
37+
echo "AZURE_REG_URL=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_URL || secrets.AZURE_REGISTRY_URL }}" >> $GITHUB_ENV
3738
38-
- name: Log in to Test Azure Container Registry
39-
if: github.event_name == 'pull_request'
40-
run: az acr login --name ${{ secrets.TEST_AZURE_REGISTRY_NAME }}
39+
- name: Log in to Azure Container Registry
40+
run: az acr login --name $AZURE_REG_NAME
4141

4242
- name: Install Dependencies
4343
id: install-dependencies
@@ -60,9 +60,9 @@ jobs:
6060
run: |
6161
# check if official image
6262
if [[ "${{ inputs.helloworld-image }}" == *"mcr.microsoft.com"* ]]; then
63-
echo HELLO_WORLD_IMAGE='${{ inputs.helloworld-image }}' >> $GITHUB_ENV
63+
echo "HELLO_WORLD_IMAGE=${{ inputs.helloworld-image }}" >> $GITHUB_ENV
6464
else
65-
echo HELLO_WORLD_IMAGE='${{ (github.event_name != 'pull_request' && secrets.AZURE_REGISTRY_URL) || secrets.TEST_AZURE_REGISTRY_URL }}'/'${{ inputs.helloworld-image }}' >> $GITHUB_ENV
65+
echo "HELLO_WORLD_IMAGE=$AZURE_REG_URL/${{ inputs.helloworld-image }}" >> $GITHUB_ENV
6666
fi
6767
6868
- name: Substitute Environment Variables

.github/workflows/_deploy_kafka_test.yml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -42,13 +42,13 @@ jobs:
4242
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
4343
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
4444

45-
- name: Log in to Public Azure Container Registry
46-
if: github.event_name != 'pull_request'
47-
run: az acr login --name ${{ secrets.AZURE_REGISTRY_NAME }}
45+
- name: Set Azure Registry
46+
run: |
47+
echo "AZURE_REG_NAME=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_NAME || secrets.AZURE_REGISTRY_NAME }}" >> $GITHUB_ENV
48+
echo "AZURE_REG_URL=${{ github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_URL || secrets.AZURE_REGISTRY_URL }}" >> $GITHUB_ENV
4849
49-
- name: Log in to Test Azure Container Registry
50-
if: github.event_name == 'pull_request'
51-
run: az acr login --name ${{ secrets.TEST_AZURE_REGISTRY_NAME }}
50+
- name: Log in to Azure Container Registry
51+
run: az acr login --name $AZURE_REG_NAME
5252

5353
- name: Install Dependencies
5454
id: install-dependencies
@@ -74,8 +74,8 @@ jobs:
7474
CLUSTER_NAME: ${{ inputs.cluster-name }}
7575
RESOURCE_GROUP: ${{ vars.RESOURCE_GROUP }}
7676
SIDECAR_IMAGE: ${{ inputs.key-release-image }}
77-
CONSUMER_IMAGE: ${{ (github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_URL) || secrets.AZURE_REGISTRY_URL }}/${{ inputs.consumer-image }}
78-
PRODUCER_IMAGE: ${{ (github.event_name == 'pull_request' && secrets.TEST_AZURE_REGISTRY_URL) || secrets.AZURE_REGISTRY_URL }}/${{ inputs.producer-image }}
77+
CONSUMER_IMAGE: ${{ env.AZURE_REG_URL }}/${{ inputs.consumer-image }}
78+
PRODUCER_IMAGE: ${{ env.AZURE_REG_URL }}/${{ inputs.producer-image }}
7979
id: run-workload
8080
run: |
8181
az aks get-credentials --name $CLUSTER_NAME --resource-group $RESOURCE_GROUP --overwrite-existing

.github/workflows/_push_image.yml

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -44,20 +44,23 @@ jobs:
4444
with:
4545
version: v0.18.0
4646

47+
- name: Download ORAS CLI
48+
uses: oras-project/setup-oras@v1
49+
4750
- name: Log into Azure
4851
uses: azure/login@v2
4952
with:
5053
client-id: ${{ secrets.AZURE_CLIENT_ID }}
5154
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
5255
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
5356

54-
- name: Log in to Public Azure Container Registry
55-
if: ${{ inputs.repo_type == 'public' }}
56-
run: az acr login --name ${{ secrets.AZURE_REGISTRY_NAME }}
57+
- name: Set Azure Registry
58+
run: |
59+
echo "AZURE_REG_NAME=${{ inputs.repo_type == 'public' && secrets.AZURE_REGISTRY_NAME || inputs.repo_type == 'private' && secrets.TEST_AZURE_REGISTRY_NAME }}" >> $GITHUB_ENV
60+
echo "AZURE_REG_URL=${{ inputs.repo_type == 'public' && secrets.AZURE_REGISTRY_URL || inputs.repo_type == 'private' && secrets.TEST_AZURE_REGISTRY_URL }}" >> $GITHUB_ENV
5761
58-
- name: Log in to Test Azure Container Registry
59-
if: ${{ inputs.repo_type == 'private' }}
60-
run: az acr login --name ${{ secrets.TEST_AZURE_REGISTRY_NAME }}
62+
- name: Log in to Azure Container Registry
63+
run: az acr login --name $AZURE_REG_NAME
6164

6265
- name: Build and Push Docker Image
6366
uses: docker/build-push-action@v5
@@ -66,11 +69,20 @@ jobs:
6669
context: ${{ inputs.docker_context }}
6770
file: ${{ inputs.dockerfile_path }}/Dockerfile
6871
push: true
69-
tags: ${{ inputs.repo_type == 'public' && secrets.AZURE_REGISTRY_URL || inputs.repo_type == 'private' && secrets.TEST_AZURE_REGISTRY_URL }}/${{ inputs.image }}:${{inputs.tag}}
72+
tags: ${{ env.AZURE_REG_URL }}/${{ inputs.image }}:${{ inputs.tag }}
7073

7174
- name: Generate Artifact Attestation
7275
uses: actions/attest-build-provenance@v1
7376
with:
74-
subject-name: ${{ inputs.repo_type == 'public' && secrets.AZURE_REGISTRY_URL || inputs.repo_type == 'private' && secrets.TEST_AZURE_REGISTRY_URL }}/${{ inputs.image }}
77+
subject-name: ${{ env.AZURE_REG_URL }}/${{ inputs.image }}
7578
subject-digest: '${{steps.build-image.outputs.digest}}'
76-
push-to-registry: true
79+
push-to-registry: true
80+
81+
- name: Add End of Life Annotation
82+
run: |
83+
#get EOL date one month from now
84+
EOL_DATE=$(date -u -d "+1 month" +"%Y-%m-%dT%H:%M:%SZ")
85+
86+
oras attach --artifact-type "application/vnd.microsoft.artifact.lifecycle" \
87+
--annotation "vnd.microsoft.artifact.lifecycle.end-of-life.date=$EOL_DATE" \
88+
$AZURE_REG_URL/${{ inputs.image }}@${{steps.build-image.outputs.digest}}

.github/workflows/helloworld_aci_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
inputs:
1515
helloworld-image:
1616
description: "Hello World ACI Image"
17-
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.9"
17+
default: "mcr.microsoft.com/acc/samples/aci/helloworld:2.10"
1818
required: true
1919
type: string
2020
debug:

.github/workflows/helloworld_aks_test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ on:
1414
inputs:
1515
helloworld-image:
1616
description: "Hello World AKS Image"
17-
default: "mcr.microsoft.com/acc/samples/aks/helloworld:1.7"
17+
default: "mcr.microsoft.com/acc/samples/aks/helloworld:1.8"
1818
required: true
1919
type: string
2020
debug:

.github/workflows/kafka_demo_test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,12 @@ on:
2828
type: string
2929
consumer-image:
3030
description: "Consumer Image"
31-
default: "public/acc/samples/kafka/consumer:2.0"
31+
default: "public/acc/samples/kafka/consumer:3.0"
3232
required: true
3333
type: string
3434
producer-image:
3535
description: "Producer Image"
36-
default: "public/acc/samples/kafka/producer:2.0"
36+
default: "public/acc/samples/kafka/producer:3.0"
3737
required: true
3838
type: string
3939
merge_group:

hello-world/ACI/app/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ WORKDIR /app
1212

1313
# copy all files from this folder to working directory (ignores files in .dockerignore)
1414
ARG BUILD_DIR=~/confidential-container-demos/hello-world/ACI/app
15-
COPY --from=build ${BUILD_DIR}/Dockerfile ${BUILD_DIR}/main.py ${BUILD_DIR}/verbose-report /app/
15+
COPY --from=build ${BUILD_DIR}/. /app/
1616

1717
RUN chmod +x verbose-report
1818

hello-world/ACI/arm-template.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"image": {
2020
"type": "string",
21-
"defaultValue": "mcr.microsoft.com/acc/samples/aci/helloworld:2.9",
21+
"defaultValue": "mcr.microsoft.com/acc/samples/aci/helloworld:2.10",
2222
"metadata": {
2323
"description": "Container image to deploy. Should be of the form repoName/imagename:tag for images stored in public Docker Hub, or a fully qualified URI for other registries. Images from private registries require additional registry credentials."
2424
}

hello-world/AKS/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ This sample is a basic Python application used to demonstrate Confidential Pods
66

77
![Hello World Hardware Report](./media/hello-world-cc.png)
88

9-
The container is hosted publicly on [Azure Container Registry](mcr.microsoft.com/acc/samples/aks/helloworld:1.7).
9+
The container is hosted publicly on [Azure Container Registry](mcr.microsoft.com/acc/samples/aks/helloworld:1.8).
1010

1111
## Getting Started
1212

hello-world/AKS/helloworld.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ metadata:
77
name: helloworld
88
spec:
99
containers:
10-
- image: "mcr.microsoft.com/acc/samples/aks/helloworld:1.7"
10+
- image: "mcr.microsoft.com/acc/samples/aks/helloworld:1.8"
1111
command:
1212
- python3
1313
- main.py

kafka/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ NOTE: Only the subscription owner can setup role access for AKV/mHSM, so if you
159159

160160
```bash
161161
export SIDECAR_IMAGE="mcr.microsoft.com/aci/2.10"
162-
export CONSUMER_IMAGE="mcr.microsoft.com/acc/samples/kafka/consumer:2.0"
162+
export CONSUMER_IMAGE="mcr.microsoft.com/acc/samples/kafka/consumer:3.0"
163163
SIDECAR_IMAGE=$(echo $SIDECAR_IMAGE | sed 's/\//\\\//g')
164164
CONSUMER_IMAGE=$(echo $CONSUMER_IMAGE | sed 's/\//\\\//g')
165165
export LOG_FILE="log.txt"
@@ -214,7 +214,7 @@ az keyvault key list --vault-name <Name of AKV> -o table | grep kafka-demo-pipel
214214
#### Generate Producer Pod YAML Files (Only If Using Azure Event Hub Resource)
215215

216216
```bash
217-
export PRODUCER_IMAGE="mcr.microsoft.com/acc/samples/kafka/producer:2.0"
217+
export PRODUCER_IMAGE="mcr.microsoft.com/acc/samples/kafka/producer:3.0"
218218
PRODUCER_IMAGE=$(echo $PRODUCER_IMAGE | sed 's/\//\\\//g')
219219
sed -i 's/$EVENTHUB_NAMESPACE/'"$EVENTHUB_NAMESPACE"'/g; s/$EVENTHUB/'"$EVENTHUB"'/g; s/$LOG_FILE/'"$LOG_FILE"'/g; s/$PRODUCER_IMAGE/'"$PRODUCER_IMAGE"'/g ' producer/producer.yaml
220220

0 commit comments

Comments
 (0)