forked from facebookresearch/PyTorch-BigGraph
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.yml
120 lines (116 loc) · 3.4 KB
/
config.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
version: 2.1
executors:
default_executor:
docker:
- image: circleci/python:3.6
working_directory: ~/PyTorch-BigGraph
commands:
# Need this because env vars added to the executors aren't expanded/interpolated.
# This means that both `~` and `$HOME` would be treated as literals.
export_env_vars:
steps:
- run:
name: Export environment variables
command: |
echo 'export PYTHONUSERBASE=~/local_python' >> $BASH_ENV
cached_checkout:
steps:
- restore_cache:
keys:
- source-v1-{{ .Branch }}-{{ .Revision }}
- source-v1-{{ .Branch }}-
- source-v1-
- checkout
- save_cache:
key: source-v1-{{ .Branch }}-{{ .Revision }}
paths:
- .git
install_dependencies:
parameters:
requirements_file:
type: string
summary_file:
type: string
steps:
- restore_cache:
keys:
- local-python-v1-{{ .Branch }}-
- local-python-v1-
- run:
name: Set up local Python environment
command: |
pip install --user --requirement << parameters.requirements_file >> --upgrade --upgrade-strategy eager --progress-bar off
pip freeze --user > << parameters.summary_file >>
- save_cache:
key: local-python-v1-{{ .Branch }}-{{ checksum "<< parameters.summary_file >>" }}
paths:
- ~/local_python
load_installed_dependencies:
parameters:
summary_file:
type: string
steps:
- restore_cache:
keys:
- local-python-v1-{{ .Branch }}-{{ checksum "<< parameters.summary_file >>" }}
- local-python-v1-{{ .Branch }}-
- local-python-v1-
- run:
name: Set up local Python environment
command: |
pip install --user --requirement << parameters.summary_file >> --progress-bar off
jobs:
build-install:
executor: default_executor
steps:
- export_env_vars
- cached_checkout
- install_dependencies:
requirements_file: requirements.txt
summary_file: ~/pip_freeze.txt
- run:
name: Install PyTorch-BigGraph
command: |
python3 -m venv --system-site-packages ~/venv
. ~/venv/bin/activate
python3 setup.py install
- persist_to_workspace:
root: "~"
paths:
- pip_freeze.txt
- venv
- persist_to_workspace:
root: tests
paths:
- "*.py"
test:
executor: default_executor
steps:
- export_env_vars
- attach_workspace:
at: "~"
- load_installed_dependencies:
summary_file: ~/pip_freeze.txt
- attach_workspace:
at: tests
- run:
name: Test all the things!
command: |
. ~/venv/bin/activate
python3 tests/bucket_scheduling_tests.py
python3 tests/distributed_tests.py
python3 tests/fileio_tests.py
python3 tests/functional_tests.py
python3 tests/model_tests.py
python3 tests/schema_tests.py
python3 tests/stats_tests.py
python3 tests/train_tests.py
python3 tests/util_tests.py
workflows:
version: 2
build-install-test:
jobs:
- build-install
- test:
requires:
- build-install