-
Notifications
You must be signed in to change notification settings - Fork 500
243 lines (238 loc) · 10.2 KB
/
install_and_test.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
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
name: Install and test
on:
pull_request: {}
push:
branches:
- main
tags: [ "v*" ]
schedule:
- cron: "0 5 * * *"
#this is 9PM PST
jobs:
pre-commit:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/[email protected]
with:
python-version: '3.9.16'
- name: install dependencies
run: |-
pip install -U pip setuptools pre-commit
# Install the hooks now so that they'll be cached
pre-commit install-hooks
- name: Check Code Style using pre-commit
run: |-
SKIP=eslint pre-commit run --show-diff-on-failure --all-files
python_lint:
runs-on: ubuntu-latest
steps:
- uses: actions/[email protected]
- name: Setup python
uses: actions/[email protected]
with:
python-version: '3.9.16'
- name: setup
run: |-
pip install black==23.1.0 --progress-bar off
pip install "isort[pyproject]" numpy --progress-bar off
pip install mypy==0.991 types-mock types-Pillow types-tqdm types-PyYAML --progress-bar off
pip install -r habitat-lab/requirements.txt --progress-bar off
- name: run black
run: |-
black --version
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(notebooks|nb_python)' habitat-lab/. habitat-baselines/. examples/. test/. --diff
black --exclude '/(\.eggs|\.git|\.hg|\.mypy_cache|\.nox|\.tox|\.venv|_build|buck-out|build|dist)|examples/tutorials/(notebooks|nb_python)' habitat-lab/. habitat-baselines/. examples/. test/. --check
- name: run isort
run: |-
isort --version
isort habitat-lab/. habitat-baselines/. examples/. test/. --diff
isort habitat-lab/. habitat-baselines/. examples/. test/. --check-only
- name: run mypy
run: |-
mypy --version
mypy --exclude="^docs/|setup.py$"
install_and_test_lab_ubuntu:
runs-on: 4-core-ubuntu-gpu-t4
env:
PYPI_LAB_UPLOAD_TOKEN: ${{ secrets.PYPI_LAB_UPLOAD_TOKEN }}
defaults:
run:
shell: bash -el {0}
steps:
- uses: actions/[email protected]
with:
path: "./habitat-lab"
- uses: "./habitat-lab/.github/actions/install_ubuntu_deps"
- uses: "./habitat-lab/.github/actions/install_ubuntu_gpu_deps"
- name: Build, install habitat-sim
run: |-
#give cmake ownership to the runner for installation
sudo chown runner -R /opt/cmake312/
#activate conda env
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
#install habitat-sim
if [ ! -d ./habitat-sim ]
then
git clone https://github.com/facebookresearch/habitat-sim.git --recursive
fi
cd habitat-sim
pip install -r requirements.txt --progress-bar off
git submodule update --init --recursive --jobs 8
python -u setup.py install --headless --with-cuda --bullet
- name: Download test data
run: |
# Disable clone protection for git lfs
export GIT_CLONE_PROTECTION_ACTIVE=false
git --version
git-lfs --version
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda init
source ~/.bashrc
conda activate habitat
conda install -y gitpython git-lfs
cd habitat-sim
git lfs install
python src_python/habitat_sim/utils/datasets_download.py --uids ci_test_assets franka_panda hab_spot_arm hab3_bench_assets hab2_bench_assets habitat_humanoids ycb rearrange_dataset_v2 --no-replace --no-prune
ls -la data/scene_datasets/habitat-test-scenes/
- name: Run sim benchmark
run: |-
#give cmake ownership to the runner for installation
sudo chown runner -R /opt/cmake312/
#activate conda env
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-sim
python examples/example.py --scene data/scene_datasets/habitat-test-scenes/van-gogh-room.glb --silent
- name: Install lab, baselines, and hitl packages
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
ln -s ../habitat-sim/data data
pip install -e habitat-lab
pip install -e habitat-baselines
pip install -e habitat-hitl
- name: Run lab tests
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
export PYTHONPATH=.:$PYTHONPATH
export MULTI_PROC_OFFSET=0 && export MAGNUM_LOG=quiet && export HABITAT_SIM_LOG=quiet
python -m pytest test/ --cov-report=xml --cov-report term --cov=./
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
#Uploading test coverage for Python code
./codecov -f coverage.xml -cF Python
- name: Run hitl tests
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
export PYTHONPATH=.:$PYTHONPATH
export MULTI_PROC_OFFSET=0 && export MAGNUM_LOG=quiet && export HABITAT_SIM_LOG=quiet
export GIT_CLONE_PROTECTION_ACTIVE=false
python -m habitat_sim.utils.datasets_download --uids hab3-episodes hab3_bench_assets habitat_humanoids hab_spot_arm ycb --data-path data/ --no-replace --no-prune
python -m pytest habitat-hitl/test
- name: Run baselines tests
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
export PYTHONPATH=.:$PYTHONPATH
export MULTI_PROC_OFFSET=0 && export MAGNUM_LOG=quiet && export HABITAT_SIM_LOG=quiet
# This is a flag that enables test_baseline_training to work
export TEST_BASELINE_SMALL=1
python -m pytest test/test_baseline_training.py -s
- name: Run Habitat 2.0 Benchmark
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
#move the episode dataset file into the expected location
mkdir -p data/ep_datasets/
cp data/hab2_bench_assets/bench_scene.json.gz data/ep_datasets/
#run the benchmark
bash scripts/hab2_bench/bench_runner.sh
python scripts/hab2_bench/plot_bench.py
# Assert the SPS number are up to standard
python scripts/hab2_bench/assert_bench.py
- name: Test building API documentation
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
conda activate habitat
cd habitat-lab
# Download sim inventory for crosslinking (no need to build the whole sim docs for that)
mkdir -p ../habitat-sim/build/docs-public/habitat-sim
curl -s https://aihabitat.org/docs/habitat-sim/objects.inv > ../habitat-sim/build/docs-public/habitat-sim/objects.inv
cd docs
conda install -y -c conda-forge doxygen=1.9.5
conda install -y jinja2 pygments docutils
mkdir -p ../build/docs
./build-public.sh
- name: Setup non editable install env
uses: conda-incubator/[email protected]
with:
miniconda-version: "latest"
python-version: "3.9"
activate-environment: "non-editable-install"
- name: Ensure non-editable mode works
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
cd habitat-lab
conda activate non-editable-install
conda install -y -c conda-forge -c aihabitat-nightly habitat-sim
pip install habitat-lab/
python -c 'import habitat; print("habitat version:", habitat.__version__)'
pip install habitat-baselines/
python -c 'import habitat_baselines; print("habitat_baselines version:", habitat_baselines.__version__)'
pip install habitat-hitl/
python -c 'import habitat_hitl; print("habitat_hitl version:", habitat_hitl.__version__)'
- name: Setup build env
uses: conda-incubator/[email protected]
with:
miniconda-version: "latest"
python-version: "3.9"
activate-environment: "build-env"
- name: Build lab and baselines packages
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
cd habitat-lab
conda activate build-env
pip install --upgrade build
python -m build -s -w -C--global-option=egg_info -C--global-option=--tag-date habitat-lab/
python -m build -s -w -C--global-option=egg_info -C--global-option=--tag-date habitat-baselines/
- name: Setup bdist conda env
uses: conda-incubator/[email protected]
with:
miniconda-version: "latest"
python-version: "3.9"
activate-environment: "bdist-install"
- name: Ensure bdist install works and build sdist
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
cd habitat-lab
conda activate bdist-install
conda install -y -c conda-forge -c aihabitat-nightly habitat-sim
#create the sdist for testing in the next job
conda create -n sdist-install --clone bdist-install
pip install habitat-lab/dist/habitat_lab*.whl
python -c 'import habitat; print("habitat version:", habitat.__version__)'
pip install habitat-baselines/dist/habitat_baselines*.whl
python -c 'import habitat_baselines; print("habitat_baselines version:", habitat_baselines.__version__)'
- name: Ensure sdist install works
run: |-
export PATH=$HOME/miniconda/bin:/usr/local/cuda/bin:$PATH
cd habitat-lab
# install from source distribution:
conda activate sdist-install
pip install habitat-lab/dist/habitat_lab*.tar.gz
python -c 'import habitat; print("habitat version:", habitat.__version__)'
pip install habitat-baselines/dist/habitat_baselines*.tar.gz
python -c 'import habitat_baselines; print("habitat_baselines version:", habitat_baselines.__version__)'
#NOTE: use the below to debug with ssh: simply move this "job" just before the crashing job to intercept the workflow
#- name: Debugging with tmate
# uses: mxschmitt/[email protected]