-
-
Notifications
You must be signed in to change notification settings - Fork 17
133 lines (113 loc) · 3.85 KB
/
simkube_e2e.yml
File metadata and controls
133 lines (113 loc) · 3.85 KB
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
---
name: simkube end-to-end test
on: # yamllint disable-line rule:truthy
workflow_dispatch:
push:
branches:
- "main"
paths-ignore:
- "docs/**"
- "examples/**"
- ".cargo/**"
- ".config/**"
- ".github/**"
- ".markdownlint.yaml"
- ".markdownlintignore"
- ".pre-commit-config.yaml"
- ".rustfmt.toml"
- ".yamllint"
- "*.md"
- "deny.toml"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
IN_CI: "true"
permissions: {}
jobs:
launch-runner:
runs-on: ubuntu-latest
steps:
- name: Setup SimKube GitHub Action runner
uses: acrlabs/simkube-ci-action/actions/launch-runner@f597bcc52b7bd9ae050dcfa5f3c273e4c69f3a88
with:
ami-id: ami-03e5877b8398d4577 # TODO: make this dynamic / latest AMI
instance-type: m6a.large
aws-region: us-west-2
subnet-id: subnet-0cd4625c825e73e61
security-group-ids: sg-0fd593b495c5e0ffd
simkube-runner-pat: ${{ secrets.SIMKUBE_RUNNER_PAT }}
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
simkube-e2e-test:
needs: launch-runner
runs-on: [self-hosted, simkube, ephemeral]
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
submodules: recursive
persist-credentials: false
- name: Setup Builder
uses: ./.github/actions/setup-builder
- name: Add .local/bin to PATH
run: echo "/home/ubuntu/.local/bin" >> $GITHUB_PATH
- name: Build
run: make build image run
- name: Wait for cluster rollout
shell: bash
run: |
set -euo pipefail
echo "Waiting for simkube deployments..."
for d in $(kubectl get deploy -n simkube -o name); do
echo "Waiting for $d"
kubectl rollout status $d -n simkube --timeout=120s
done
echo "All deployments rolled out"
- name: Verify simkube images are from local registry
shell: bash
run: |
set -euo pipefail
PODS=(
sk-ctrl
sk-tracer
)
for POD in "${PODS[@]}"; do
echo "Inspecting pod: $POD..."
POD_NAME=$(kubectl get pod \
--field-selector=status.phase=Running \
-l app.kubernetes.io/name="$POD" \
-n simkube \
-o jsonpath='{.items[0].metadata.name}')
IMAGE_ID=$(kubectl get pod "$POD_NAME" \
-n simkube \
-o jsonpath='{.status.containerStatuses[0].imageID}')
echo "Pod: $POD_NAME"
echo "Image ID: $IMAGE_ID"
if ! echo "$IMAGE_ID" | grep -q "localhost:5000"; then
echo "❌ Image NOT from local registry"
exit 1
fi
echo "✅ $POD image is from local registry"
done
- name: Get driver image
id: get_driver_image
shell: bash
run: |
set -euo pipefail
if [[ ! -f .build/sk-driver-image ]]; then
echo "❌ Missing .build/sk-driver-image"
exit 1
fi
IMAGE=$(cat .build/sk-driver-image)
if [[ "$IMAGE" != localhost:5000/* ]]; then
echo "❌ Driver image is not from local registry: $IMAGE"
exit 1
fi
echo "Driver image: $IMAGE"
echo "driver_image=$IMAGE" >> "$GITHUB_OUTPUT"
- name: Run simulation
uses: acrlabs/simkube-ci-action/actions/run-simulation@f597bcc52b7bd9ae050dcfa5f3c273e4c69f3a88
with:
simulation-name: test-cronjob-sim
trace-path: examples/traces/cronjob.sktrace
driver-image: ${{ steps.get_driver_image.outputs.driver_image }}