-
Notifications
You must be signed in to change notification settings - Fork 40
89 lines (87 loc) · 3.97 KB
/
test.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
name: Linting and deployment test on K3S
on:
push:
branches:
- master
- anvil
pull_request: {}
workflow_dispatch: {}
jobs:
linting:
runs-on: ubuntu-latest
steps:
- name: Install Kubectl
run: curl -LO "https://storage.googleapis.com/kubernetes-release/release/$(curl -s https://storage.googleapis.com/kubernetes-release/release/stable.txt)/bin/linux/amd64/kubectl" && chmod +x ./kubectl && sudo mv ./kubectl /usr/local/bin/kubectl && kubectl version || true
- name: Install Helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Helm dep update for galaxy-deps
run: cd galaxy-deps/ && helm dep update && cd ..
- name: Helm linting for galaxy-deps
run: helm lint galaxy-deps/
- name: Helm dep update for galaxy
run: cd galaxy/ && helm dep update && cd ..
- name: Helm linting for galaxy
run: helm lint galaxy/
test:
runs-on: ubuntu-latest
steps:
- name: Install Helm
run: curl https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 | bash
- uses: actions/checkout@v3
with:
persist-credentials: false
- name: Helm dep update for galaxy-deps
run: cd galaxy-deps/ && helm dep update && cd ..
- name: Helm dep update for galaxy
run: cd galaxy/ && helm dep update && cd ..
- name: Start k8s locally
uses: jupyterhub/action-k3s-helm@v3
with:
k3s-version: v1.30.4+k3s1 # releases: https://github.com/k3s-io/k3s/tags
metrics-enabled: false
traefik-enabled: false
- name: Verify function of k8s, kubectl, and helm
run: |
echo "kubeconfig: $KUBECONFIG"
kubectl version
kubectl get pods --all-namespaces
helm version
helm list
- name: Helm repo add galaxy
run: helm repo add galaxy https://github.com/CloudVE/helm-charts/raw/master
- name: Helm install galaxy-deps
run: time bash -c 'helm install --create-namespace -n "galaxy-deps" "galaxy-deps" ./galaxy-deps --set cvmfs.cvmfscsi.cache.alien.enabled=false --wait --timeout=1200s'
- name: Helm install Galaxy
run: time bash -c 'helm install --create-namespace -n galaxy galaxy ./galaxy --set persistence.accessMode="ReadWriteOnce" --set resources.requests.memory=0Mi,resources.requests.cpu=0m,cvmfs.cvmfscsi.cache.alien.enabled=false --wait --timeout=1200s'
- name: Get events
run: kubectl get events -n galaxy; kubectl get events -n csi-drivers;
if: always()
- name: Get pods, pvc, and pv
run: kubectl get pods -n galaxy; kubectl get pvc -n galaxy; kubectl get pv -n galaxy
if: always()
- name: Print web handler log
run: bash -c "kubectl logs -n galaxy $(kubectl -n galaxy get pods | grep -o '[^ ]*galaxy-web[^ ]*')"
if: always()
- name: Print job handler log
run: bash -c "kubectl logs -n galaxy $(kubectl -n galaxy get pods | grep -o '[^ ]*galaxy-job[^ ]*')"
if: always()
- name: Print workflow handler log
run: bash -c "kubectl logs -n galaxy $(kubectl -n galaxy get pods | grep -o '[^ ]*galaxy-workflow[^ ]*')"
if: always()
- name: Check appVersion
if: always()
run: |
kubectl get svc -n galaxy
kubectl describe svc -n galaxy galaxy-nginx
appVersion=$(cat galaxy/Chart.yaml | grep ^appVersion: | awk '{print $2}' | tr -d '"')
address=$(kubectl get svc -n galaxy galaxy-nginx -o jsonpath="http://{.spec.clusterIP}:{.spec.ports[0].port}/galaxy/api/version")
echo "Address is $address"
apiVersion=$(curl $address | jq -r '"\(.version_major).\(.version_minor)"')
echo "appVersion: $appVersion"
echo "apiVersion: $apiVersion"
if [ "$appVersion" != "$apiVersion" ]; then
exit 1
fi