forked from ucbrise/clipper
-
Notifications
You must be signed in to change notification settings - Fork 2
/
.travis.yml
45 lines (39 loc) · 2.17 KB
/
.travis.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
# Maintainer: Simon Mo <xmo@berkeley.edu>
# - Clipper use Travis CI to run its Kubernetes test.
# - We will spin up minikube and start a docker registry at localhost:5000
# - Once all environment is ready, it will run shipyard to generate the Makefile
# - Travis will wait for all docker images related to k8s test to finish building
# - Then travis will run the test sequentially with retry-once logic.
# Travis will start the build in a VM when sudo is required
sudo: required
language: python
env:
matrix:
# This will make sure .minikube config resides in current user folder
- CHANGE_MINIKUBE_NONE_USER=true
before_script:
# Download kubectl and minikube
- curl -Lo kubectl https://storage.googleapis.com/kubernetes-release/release/v1.9.0/bin/linux/amd64/kubectl
&& chmod +x kubectl && sudo mv kubectl /usr/local/bin/
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/v0.25.2/minikube-linux-amd64
&& chmod +x minikube && sudo mv minikube /usr/local/bin/
# Setup minikube and docker registry
- sudo minikube start --vm-driver=none --kubernetes-version=v1.9.0 --insecure-registry localhost:5000
- docker run -d -p 5000:5000 --restart=always registry:2
- minikube update-context
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
until kubectl get nodes -o jsonpath="$JSONPATH" 2>&1 | grep -q "Ready=True"; do
sleep 1; done
- kubectl cluster-info
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
until kubectl -n kube-system get pods -lcomponent=kube-addon-manager -o jsonpath="$JSONPATH"
2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-addon-manager to
be available"; kubectl get pods --all-namespaces; done
- JSONPATH='{range .items[*]}{@.metadata.name}:{range @.status.conditions[*]}{@.type}={@.status};{end}{end}';
until kubectl -n kube-system get pods -lk8s-app=kube-dns -o jsonpath="$JSONPATH"
2>&1 | grep -q "Ready=True"; do sleep 1;echo "waiting for kube-dns to be available";
kubectl get pods --all-namespaces; done
script:
- cd clipper_admin; pip install -q -e .; cd ..
- bash ./bin/shipyard.sh
- bash ./bin/run_travis.sh