82
82
run : |
83
83
wget https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
84
84
sudo dpkg -i ./minikube_latest_amd64.deb
85
+
85
86
- name : Start minikube and wait until CoreDNS is available
86
87
run : |
87
88
minikube start --driver=docker
@@ -131,6 +132,7 @@ jobs:
131
132
echo "Unexpected lsmod output - the module should not be loaded"
132
133
exit 1
133
134
fi
135
+
134
136
- name : Add an ooto-ci Module that contains a valid mapping
135
137
run : |
136
138
sed -e "s/KVER_CHANGEME/$(uname -r)/g" \
@@ -139,6 +141,7 @@ jobs:
139
141
ci/module-ooto-ci.template.yaml | tee module-ooto-ci.yaml
140
142
141
143
kubectl apply -f module-ooto-ci.yaml
144
+
142
145
- name : Check that the module gets loaded on the node
143
146
run : |
144
147
until minikube ssh -- lsmod | grep ooto_ci_a; do
@@ -199,6 +202,7 @@ jobs:
199
202
run : |
200
203
wget https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
201
204
sudo dpkg -i ./minikube_latest_amd64.deb
205
+
202
206
- name : Start minikube and wait until CoreDNS is available
203
207
run : |
204
208
minikube start --driver=docker -n 2
@@ -332,3 +336,138 @@ jobs:
332
336
- name : Get all operator logs
333
337
run : kubectl logs deployment.apps/oot-operator-controller-manager -n oot-operator-system
334
338
if : ${{ always() }}
339
+
340
+ in-cluster-build :
341
+ runs-on : ubuntu-latest
342
+
343
+ name : In-cluster build
344
+
345
+ needs : [build-operator-image, build-drivercontainer-image]
346
+
347
+ steps :
348
+ - name : Checkout
349
+ uses : actions/checkout@v2
350
+
351
+ - name : Download and install minikube
352
+ run : |
353
+ wget https://storage.googleapis.com/minikube/releases/latest/minikube_latest_amd64.deb
354
+ sudo dpkg -i ./minikube_latest_amd64.deb
355
+
356
+ - name : Start minikube and wait until CoreDNS is available
357
+ run : |
358
+ minikube start --driver=docker --addons registry,registry-aliases
359
+ kubectl wait --for=condition=available deployment coredns -n kube-system
360
+
361
+ kubectl apply -f ci/registry-nodeport.yaml
362
+
363
+ - name : Install skopeo
364
+ run : |
365
+ sudo apt -y update
366
+ sudo apt -y install skopeo
367
+
368
+ - name : Download container images
369
+ uses : actions/download-artifact@v3
370
+ with :
371
+ name : ci-images
372
+
373
+ - name : Import DriverContainer base into the internal-registry
374
+ run : |
375
+ MINIKUBE_REGISTRY_EXT="$(minikube service registry-nodeport -n kube-system --format '{{.IP}}:{{.Port}}' --url)"
376
+ skopeo copy --dest-tls-verify=false docker-archive:ooto-kmod_local.tar docker://${MINIKUBE_REGISTRY_EXT}/ooto-base:local
377
+
378
+ - name : Import the OOTO image into minikube
379
+ run : minikube image load ooto_local.tar
380
+
381
+ - uses : actions/setup-go@v2
382
+ with :
383
+ go-version : 1.17.6
384
+
385
+ - name : Deploy OOTO
386
+ run : make deploy
387
+ env :
388
+ KUSTOMIZE_CONFIG_DEFAULT : ci/install-ci
389
+
390
+ - name : Wait until the OOTO Deployment is Available
391
+ run : kubectl wait --for condition=Available deployments.apps -n oot-operator-system oot-operator-controller-manager
392
+ timeout-minutes : 1
393
+
394
+ - name : Describe the Deployment / pods and get their YAML if that failed
395
+ run : |
396
+ kubectl describe deployments.apps -n oot-operator-system oot-operator-controller-manager
397
+ kubectl get -o yaml deployments.apps -n oot-operator-system oot-operator-controller-manager
398
+
399
+ kubectl describe pod -n oot-operator-system
400
+ kubectl get -o yaml pod -n oot-operator-system
401
+ if : ${{ failure() }}
402
+
403
+ - name : Add an ooto-ci Module that contains a valid mapping
404
+ run : |
405
+ sed -e "s/KVER_CHANGEME/$(uname -r)/g" ci/module-ooto-ci-build.template.yaml | tee module-ooto-ci.yaml
406
+
407
+ kubectl apply -f module-ooto-ci.yaml
408
+
409
+ - name : Wait for the job to be created
410
+ run : |
411
+ until kubectl get job -l oot.node.kubernetes.io/module.name | grep ooto; do
412
+ sleep 3
413
+ done
414
+ timeout-minutes : 1
415
+
416
+ - name : Wait for Job completion
417
+ run : kubectl wait --for condition=complete job -l oot.node.kubernetes.io/module.name --timeout=-1s
418
+ timeout-minutes : 2
419
+
420
+ - name : Collect job logs
421
+ run : |
422
+ JOB_NAME=$(kubectl get jobs.batch -l oot.node.kubernetes.io/module.name --template='{{ (index .items 0).metadata.name }}')
423
+ kubectl logs jobs.batch/${JOB_NAME}
424
+ if : ${{ always() }}
425
+
426
+ - name : Check that the module gets loaded on the node
427
+ run : |
428
+ until minikube ssh -- lsmod | grep ooto_ci_a; do
429
+ sleep 3
430
+ done
431
+ timeout-minutes : 1
432
+
433
+ - name : Remove the Module
434
+ run : kubectl delete -f module-ooto-ci.yaml
435
+
436
+ - name : Check that the module gets unloaded from the node
437
+ run : |
438
+ until ! minikube ssh -- lsmod | grep ooto_ci_a; do
439
+ sleep 3
440
+ done
441
+ timeout-minutes : 1
442
+
443
+ - name : Get all resources in the oot-operator-system namespace
444
+ run : kubectl get all -n oot-operator-system
445
+ if : ${{ always() }}
446
+
447
+ - name : Get all resources in the default namespace
448
+ run : kubectl get all
449
+ if : ${{ always() }}
450
+
451
+ - name : Describe nodes
452
+ run : kubectl describe node
453
+ if : ${{ always() }}
454
+
455
+ - name : Describe Jobs
456
+ run : kubectl describe job
457
+ if : ${{ always() }}
458
+
459
+ - name : Describe DaemonSets
460
+ run : kubectl describe daemonset -l oot.node.kubernetes.io/module.name
461
+ if : ${{ always() }}
462
+
463
+ - name : Describe Pods
464
+ run : kubectl describe pod -l oot.node.kubernetes.io/module.name
465
+ if : ${{ always() }}
466
+
467
+ - name : Collect dmesg
468
+ run : sudo dmesg
469
+ if : ${{ always() }}
470
+
471
+ - name : Get all operator logs
472
+ run : kubectl logs deployment.apps/oot-operator-controller-manager -n oot-operator-system
473
+ if : ${{ always() }}
0 commit comments