-
Notifications
You must be signed in to change notification settings - Fork 114
/
.travis.yml
129 lines (120 loc) · 4.98 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
117
118
119
120
121
122
123
124
125
126
127
128
129
language: minimal
dist: bionic
addons:
apt:
packages:
- docker-ce
- python3-pip
- python3-setuptools
- clang-format
install:
- docker version
stages:
- precommit
- tests
cache:
directories:
- $HOME/.keras/datasets
# https://pre-commit.com/#travis-ci-example
- $HOME/.cache
# Cache $HOME/go, which bound mount to /root/go of dev container.
- $HOME/go
jobs:
include:
- stage: test
name: "Pre-commit and Tests"
script:
- set -e
# Build dev Docker images.
- export BASE_IMAGE=tensorflow/tensorflow:2.1.0-py3
# Travis CI VM runs Ubuntu Bionic with Docker 18.06 which doesn't
# support docker pull --quiet.
- bash scripts/travis/build_images.sh
# Run pre-commit checks.
- docker run --rm -it
-v $TRAVIS_BUILD_DIR:/work -w /work
-v $HOME/.cache:/root/.cache
elasticdl:dev
bash -c "make -f elasticdl/Makefile && pre-commit run -a"
# Run a minikube cluster
- bash scripts/travis/start_minikube.sh
# Run unit tests not related to ODPS
# TODO(qijun) cache Go
- docker run --rm -it --net=host
-v $HOME/.cache:/root/.cache
-v $HOME/.keras/datasets:/root/.keras/datasets
-v $HOME/.kube:/root/.kube
-v $HOME/.minikube:/home/$USER/.minikube
-v $PWD:/work -w /work
elasticdl:dev_allreduce
bash -c "K8S_TESTS=True scripts/build_and_test.sh"
# Report code coverage to https://codecov.io
- bash <(curl -s https://codecov.io/bash)
# Run unit tests related to ODPS (skipped for pull requests from forks)
- |
if [ "$ODPS_ACCESS_ID" == "" ] || [ "$ODPS_ACCESS_KEY" == "" ]; then
echo "Skip ODPS related unit tests since either ODPS_ACCESS_ID " \
"or ODPS_ACCESS_KEY is not set"
else
docker run --rm -it \
-e MAXCOMPUTE_PROJECT=$MAXCOMPUTE_PROJECT \
-e MAXCOMPUTE_AK=$ODPS_ACCESS_ID \
-e MAXCOMPUTE_SK=$ODPS_ACCESS_KEY \
-v $PWD:/elasticdl -w /elasticdl elasticdl:dev bash \
-c "make -f elasticdl/Makefile && K8S_TESTS=False \
pytest elasticdl/python/tests/*odps_* \
elasticdl/python/tests/data_reader_test.py"
fi
# Run integration tests
- kubectl apply -f elasticdl/manifests/elasticdl-rbac.yaml
- docker build --target ci -t elasticdl:ci
-f elasticdl/docker/Dockerfile.ci
--build-arg BASE_IMAGE=elasticdl:dev_allreduce .
- mkdir -p data && docker run --rm -it --net=host
-v $HOME/.cache:/root/.cache
-v $HOME/.keras/datasets:/root/.keras/datasets
-v $HOME/.kube:/root/.kube
-v $HOME/.minikube:/home/$USER/.minikube
-v $PWD:/work -w /work
elasticdl:dev bash -c "scripts/travis/gen_dataset.sh data"
- |
# TODO Restore evaluate and predict integration tests
JOB_TYPES=(
odps
train
allreduce
#evaluate
#predict
)
for JOB_TYPE in "${JOB_TYPES[@]}"; do
bash scripts/travis/run_job.sh $JOB_TYPE $PWD/data
done
# Only build on this list of branches
branches:
only:
- develop
- "/branch-\\d+\\.\\d+(\\.\\d+)?(-\\S*)?$/"
env:
global:
# Secure tokens for ODPS-related environment variables
- secure: "kr79IltMhuW+pmmdP0KBMY87+iePGBGiaOUYTZhxx3zW3a1t2xK5wJnxJvrOwgB\
ipqxLvIQnYUu20Lwfo0I2bwPRVvZAExb1vFBDQgzCaXEj+DHanE0XR1nivMzUcI3iHiBNRo5\
GalAUuiCzc/8fTxwcd0az8uxbWgPsTGkE0b8Y4epmLfsBn87rfc/lq6zWV9Q/dogBtiSZSS+\
bWR+U1/KopoY2hQE9hDVlZwlh/5gqbt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