-
Notifications
You must be signed in to change notification settings - Fork 0
106 lines (90 loc) · 3.36 KB
/
CI.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
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
name: CI
on:
push:
branches:
- "*"
pull_request:
branches:
- "*"
jobs:
unit:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
cache: "maven"
- name: Run mvn clean verify
run: mvn --batch-mode clean verify -DskipIntegrationTests
integration:
# Run on our custom runner, as the default runner doesn't offer enough resources.
# Attention: paid runner, $0.064 per minute at the time of writing.
# Not usable outside of this repo.
runs-on: LinuxX64_16-cores_64GB
# Set a max timeout of 20 minutes.
# This way, we can control the cost of the runner.
timeout-minutes: 20
# Only run on pull requests to main and on pushes to main.
if: github.event_name == 'pull_request' || github.ref == 'refs/heads/main'
# Run only if the unit-test job is successful
needs: unit
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v3
with:
distribution: "temurin"
java-version: "21"
cache: "maven"
- name: Install Kustomize
run: |
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/\
kustomize/master/hack/install_kustomize.sh" | bash
sudo mv kustomize /usr/local/bin/
kustomize version
- name: Start minikube
uses: medyagh/setup-minikube@master
with:
cpus: 12
memory: 48G
- name: Test cluster connection
run: kubectl get pods -A
- name: Setup Testing Environment
run: |
# Export minikube IP to KUBEFLOW_HOST
export KUBEFLOW_HOST=$(minikube ip)
echo "KUBEFLOW_HOST=$KUBEFLOW_HOST"
# replace issuer in oauth2-proxy config
envsubst < ./src/test/resources/kubeflow-environment/oauth2_proxy.yml > ./src/test/resources/kubeflow-environment/oauth2_proxy2.yml
mv ./src/test/resources/kubeflow-environment/oauth2_proxy2.yml ./src/test/resources/kubeflow-environment/oauth2_proxy.yml
# setup environment
timeout 5m bash -c \
'until \
kustomize build ./src/test/resources/kubeflow-environment \
| kubectl apply -f -; \
do echo "Retrying to apply resources"; sleep 10; done'
- name: Wait for deployments to be ready
run: |
kubectl wait --for=condition=available --timeout=300s \
deployment --all --all-namespaces
# Wait for namespace to appear
timeout 5m bash -c \
'until kubectl get namespace kubeflow; \
do echo "Retrying to get namespace"; sleep 10; done'
# Wait for all deployments again, now that the namespace is there
kubectl wait --for=condition=available --timeout=300s \
deployment --all --all-namespaces
- name: Run mvn clean integration-test
run: |
# Export minikube IP to KUBEFLOW_HOST
export KUBEFLOW_HOST=$(minikube ip)
echo "KUBEFLOW_HOST=$KUBEFLOW_HOST"
mvn --batch-mode clean verify -DskipUnitTests
- name: Print deployment descriptions on failure
if: failure()
run: |
kubectl get deployments -A
kubectl describe deployments -A
kubectl get pods -A
kubectl describe pods -A