forked from confidential-containers/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
59 lines (51 loc) · 2.11 KB
/
enclave-cc-cicd.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
name: CI/CD | enclave-cc e2e tests
on:
schedule:
- cron: "0 0 * * *"
permissions:
contents: read
jobs:
e2e:
name: operator enclave-cc e2e tests
runs-on: ubuntu-22.04
services:
registry:
image: registry:2
ports:
- 5000:5000
steps:
- uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
with:
driver-opts: network=host
- name: Build and push to local registry
run: |
make docker-build
make docker-push
env:
IMG: localhost:5000/cc-operator:latest
- name: Setup kind cluster
run: |
kind create cluster --image "kindest/node:v1.26.0" -n coco-sgx --config tests/e2e/enclave-cc-kind-config.yaml --wait 120s
kubectl label node coco-sgx-worker node-role.kubernetes.io/worker=
- name: Deploy operator from the local registry
run: |
cd config/default
kustomize edit set image localhost:5000/cc-operator:latest
kubectl apply -k .
sleep 1
kubectl wait --for=jsonpath='{.status.conditions[0].status}'=True deployments/cc-operator-controller-manager -n confidential-containers-system
- name: Install enclave-cc sim
run: |
cd config/samples/enclave-cc/sim
latest_ci_tag=$(curl -s -X GET "https://quay.io/api/v1/repository/confidential-containers/runtime-payload-ci/tag/" | jq -r -n 'first(inputs | .tags[].name | select(test("enclave-cc-SIM-[a-f0-9]{40}")))')
kustomize edit set image quay.io/confidential-containers/runtime-payload=quay.io/confidential-containers/runtime-payload-ci:$latest_ci_tag
echo "Testing Enclave CC using the following CI tag: ${latest_ci_tag}"
kubectl apply -k .
sleep 1
kubectl wait --for=jsonpath='{.status.runtimeClass}'=enclave-cc ccruntime/ccruntime-enclave-cc-sgx-mode-sim --timeout=90s
- name: Deploy sample workload
run: |
kubectl apply -f tests/e2e/enclave-cc-pod-sim.yaml
kubectl wait --for=condition=Ready pod/enclave-cc-pod-sim