-
Notifications
You must be signed in to change notification settings - Fork 68
112 lines (110 loc) · 3.96 KB
/
testing.yml
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
---
name: Test on KinD
on:
pull_request:
types: [ready_for_review, review_requested, opened, reopened, synchronize]
paths:
- 'src/**'
jobs:
integration-test:
runs-on: ubuntu-latest
steps:
- name: Clone Datashim
uses: actions/checkout@v2
- name: Build components
shell: bash
run: |
cd build-tools
./build_components.sh
- name: Make Datashim manifests
run: make manifests
- name: Update manifests to use local images
run: "sed -i 's/Always/IfNotPresent/g' release-tools/manifests/dlf.yaml"
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.9.0
- name: Install and configure MinIO
run: |
kubectl create -f ci/minio.yaml
kubectl wait --for=condition=ready pod/minio --timeout=1m
kubectl create -f ci/configure-minio.yaml
kubectl wait --for=condition=complete job/configure-minio --timeout=2m
- name: Create S3 Secret
run: |
kubectl create secret generic s3-secret \
--from-literal=accessKeyID=ACCESS_KEY \
--from-literal=secretAccessKey=SECRET_KEY
- name: Import built images in KinD Cluster
run: |
kind load docker-image -n chart-testing quay.io/datashim-io/dataset-operator:latest
kind load docker-image -n chart-testing quay.io/datashim-io/generate-keys:latest
- name: Install Datashim
run: make deployment
- name: Wait for Datashim
run: |
kubectl wait --for=condition=ready -n dlf pod -l name=dataset-operator --timeout=2m || (kubectl get all -n dlf && exit 1)
- name: Create sample Dataset
run: |
cat <<EOF | kubectl apply -f -
apiVersion: datashim.io/v1alpha1
kind: Dataset
metadata:
name: example-dataset
spec:
local:
type: "COS"
secret-name: "s3-secret"
endpoint: "http://minio.default.svc:9000"
bucket: "first.bucket"
EOF
- name: Write to Dataset
run: |
cat <<EOF | kubectl apply -f -
apiVersion: batch/v1
kind: Job
metadata:
name: ds-write
spec:
template:
spec:
volumes:
- name: "example-dataset"
persistentVolumeClaim:
claimName: "example-dataset"
containers:
- command: ["/bin/sh"]
args: ["-c", "echo 'Some file contents' > /mnt/datashim/test.txt"]
image: busybox
name: busybox
volumeMounts:
- mountPath: "/mnt/datashim"
name: "example-dataset"
restartPolicy: Never
backoffLimit: 1
EOF
kubectl wait --for=condition=complete job/ds-write --timeout=2m || (kubectl get all -n dlf && kubectl describe job ds-write && kubectl logs -n dlf deployment/dataset-operator -c dataset-operator && kubectl describe -n dlf svc/webhook-server && exit 1)
- name: Read from Dataset
run: |
cat <<EOF | kubectl apply -f -
apiVersion: batch/v1
kind: Job
metadata:
name: ds-read
spec:
template:
spec:
volumes:
- name: "example-dataset"
persistentVolumeClaim:
claimName: "example-dataset"
containers:
- command: ["/bin/sh"]
args: ["-c", "cat /mnt/datashim/test.txt"]
image: busybox
name: busybox
volumeMounts:
- mountPath: "/mnt/datashim"
name: "example-dataset"
restartPolicy: Never
backoffLimit: 1
EOF
kubectl wait --for=condition=complete job/ds-read --timeout=2m