This repository has been archived by the owner on May 4, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
116 lines (106 loc) · 4.86 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
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
113
114
115
116
# Config file for automatic testing at travis-ci.org
env:
global:
- docker_url=registry.hub.docker.com
- docker_repository=mlbench
jobs:
include:
- stage: test
language: python
python:
- 3.4
- 3.5
- 3.6
# Command to install dependencies, e.g. pip install -r requirements.txt --use-mirrors
install:
- pip install -U tox-travis
- pip install -r requirements_dev.txt
# Command to run tests, e.g. python setup.py test
script:
- tox
- stage: build docker
language: bash
sudo: required
services:
- docker
install: true
before_script: echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin ${docker_url}
script:
- docker build -f compose/master/Dockerfile -t ${docker_url}/${docker_repository}/mlbench_master:travis-ci-test .
- docker pull mlbench/mlbench_worker:mlbench-worker-base && docker build -f compose/worker/Dockerfile -t ${docker_url}/${docker_repository}/mlbench_worker:travis-ci-test .
- stage: test kubernetes
language: bash
sudo: required
env:
- CNI_PLUGIN=weave
before_install:
# install Minikube + kubectl
- curl -Lo minikube https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
- chmod +x minikube
- sudo cp minikube /usr/local/bin/
- rm minikube
- curl -Lo kubectl 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 cp kubectl /usr/local/bin/
- rm kubectl
- minikube start --vm-driver=none
install:
# install helm
- curl https://raw.githubusercontent.com/kubernetes/helm/master/scripts/get > get_helm.sh
- chmod 700 get_helm.sh
- ./get_helm.sh
script:
- |
helm template \
--set master.image.repository=${docker_url}/${docker_repository}/mlbench-master \
--set master.image.tag=travis-ci-test \
--set worker.image.repository=${docker_url}/${docker_repository}/mlbench-worker \
--set worker.image.tag=travis-ci-test \
--set worker.imagePullSecret=regcred \
--set master.imagePullSecret=regcred \
--set limits.cpu=1000m \
--set limits.worker=1 \
--set worker.replicaCount=1 \
--set limits.bandwidth=100 \
--set limits.gpu=0 \
--name travis-test \
charts/mlbench/ | ./kubectl apply --v=5 --validate --dry-run -f -
- stage: deploy develop
if: branch = develop
language: bash
services: docker
before_install:
- echo "$DOCKER_PASSWORD" | docker login --username "$DOCKER_USERNAME" --password-stdin ${docker_url}
before_script:
- docker pull ${docker_repository}/mlbench_master:travis-ci-test
- docker pull ${docker_repository}/mlbench_worker:travis-ci-test
- docker tag ${docker_repository}/mlbench_master:travis-ci-test ${docker_url}/${docker_repository}/mlbench_master:develop
- docker tag ${docker_repository}/mlbench_worker:travis-ci-test ${docker_url}/${docker_repository}/mlbench_worker:develop
script:
- docker push ${docker_url}/${docker_repository}/mlbench_master:develop
- docker push ${docker_url}/${docker_repository}/mlbench_worker:develop
- stage: deploy
if: branch = master
language: bash
services: docker
before_install:
- export MASTER_VERSION=$(awk '$1 == "version:" { print $2; exit }' charts/mlbench/Chart.yaml)
- echo "$DOCKER_PASSWORD" | docker login -u "$DOCKER_USERNAME" --password-stdin ${docker_url}
before_script:
- docker pull ${docker_repository}/mlbench_master:travis-ci-test
- docker pull ${docker_repository}/mlbench_worker:travis-ci-test
- docker tag ${docker_repository}/mlbench_master:travis-ci-test ${docker_url}/${docker_repository}/mlbench_master:latest
- docker tag ${docker_repository}/mlbench_worker:travis-ci-test ${docker_url}/${docker_repository}/mlbench_worker:latest
- docker tag ${docker_repository}/mlbench_master:travis-ci-test ${docker_url}/${docker_repository}/mlbench_master:${MASTER_VERSION}
- docker tag ${docker_repository}/mlbench_worker:travis-ci-test ${docker_url}/${docker_repository}/mlbench_worker:${MASTER_VERSION}
script:
- docker push ${docker_url}/${docker_repository}/mlbench_master:latest
- docker push ${docker_url}/${docker_repository}/mlbench_master:${MASTER_VERSION}
- docker push ${docker_url}/${docker_repository}/mlbench_worker:latest
- docker push ${docker_url}/${docker_repository}/mlbench_worker:${MASTER_VERSION}
stages:
- test
- build docker
- test helm
- deploy develop
- deploy