Repository navigation
244 lines (225 loc) · 8.32 KB
/
Copy pathubuntu.yml
File metadata and controls
244 lines (225 loc) · 8.32 KB
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
244
name: Ubuntu CI
on:
workflow_dispatch:
inputs:
developer_build:
description: 'Set to OFF for Release wheels'
required: false
default: 'ON'
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize] # Rebuild on new pushes to PR
env:
NPROC: 2
jobs:
ubuntu:
runs-on: ubuntu-18.04
strategy:
fail-fast: false
matrix:
CONFIG: [ON, OFF]
env:
SHARED: ${{ matrix.CONFIG }}
BUILD_CUDA_MODULE: OFF
BUILD_TENSORFLOW_OPS: ${{ matrix.CONFIG }}
BUILD_PYTORCH_OPS: ${{ matrix.CONFIG }}
BUILD_RPC_INTERFACE: ON
steps:
- name: Cancel outdated
uses: fkirc/skip-duplicate-actions@master
with:
github_token: ${{ github.token }}
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
- name: Setup cache
uses: actions/cache@v2
with:
# Ref: https://github.com/apache/incubator-mxnet/pull/18459/files
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet.
key: ${{ runner.os }}-ccache-${{ github.sha }}
# Restore any ccache cache entry, if none for
# ${{ runner.os }}-ccache-${{ github.sha }} exists.
# Common prefix will be used so that ccache can be used across commits.
restore-keys: |
${{ runner.os }}-ccache
- name: Set up Python version
uses: actions/setup-python@v2
with:
python-version: 3.6
# Pre-installed 18.04 packages: https://git.io/JfHmW
- name: Install dependencies
run: |
./util/install_deps_ubuntu.sh assume-yes
sudo apt-get --yes install ccache
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
- name: Config and build
run: |
PATH=/usr/lib/ccache:$PATH
ccache -s
./util/run_ci.sh
ccache -s
build-wheel:
name: Build wheel
runs-on: Ubuntu-18.04
strategy:
fail-fast: false
# https://github.community/t/how-to-conditionally-include-exclude-items-in-matrix-eg-based-on-branch/16853/6
matrix:
python_version: [3.6, 3.7, 3.8]
is_master:
- ${{ github.ref == 'refs/heads/master' }}
exclude:
- is_master: false
python_version: 3.7
- is_master: false
python_version: 3.8
env:
BUILD_CUDA_MODULE: ON
OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build }}
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: true
- name: Checkout Open3D-ML source code
uses: actions/checkout@v2
with:
repository: intel-isl/Open3D-ML
path: ${{ env.OPEN3D_ML_ROOT }}
- name: Setup cache
uses: actions/cache@v2
with:
# Ref: https://github.com/apache/incubator-mxnet/pull/18459/files
path: ~/.ccache
# We include the commit sha in the cache key, as new cache entries are
# only created if there is no existing entry for the key yet.
key: ${{ runner.os }}-ccache-${{ github.sha }}
# Restore any ccache cache entry, if none for
# ${{ runner.os }}-ccache-${{ github.sha }} exists.
# Common prefix will be used so that ccache can be used across commits.
restore-keys: |
${{ runner.os }}-ccache
- name: Set up Python version
uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: false
python-version: ${{ matrix.python_version }}
# Pre-installed 18.04 packages: https://git.io/JfHmW
- name: Install dependencies
shell: bash -l {0}
run: |
./util/install_deps_ubuntu.sh assume-yes
sudo apt-get --yes install ccache
ccache -M 2G # See .github/workflows/readme.md for ccache strategy.
source util/ci_utils.sh
echo
install_cuda_toolkit with-cudnn purge-cache
nvcc --version
# Export PATH and LD_LIBRARY_PATH (for CUDA) for the next step
echo "PATH=$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo
echo "Installing CPU versions of packages"
install_python_dependencies with-conda
echo
echo -n "Using conda"
conda info
echo "Using python: $(which python)"
python --version
echo -n "Using pip: "
python -m pip --version
echo "Using cmake: $(which cmake)"
cmake --version
- name: Config and build wheel
shell: bash -l {0}
run: |
PATH=/usr/lib/ccache:$PATH
ccache -s
source util/ci_utils.sh
build_pip_conda_package build_azure_kinect
ccache -s
PIP_PKG_NAME="$(basename build/lib/python_package/pip_package/open3d*.whl)"
echo "PIP_PKG_NAME=$PIP_PKG_NAME" >> $GITHUB_ENV
CONDA_PKG_NAME="$(basename build/lib/python_package/conda_package/linux-64/open3d*.tar.bz2)"
echo "CONDA_PKG_NAME=$CONDA_PKG_NAME" >> $GITHUB_ENV
- name: Upload wheel
uses: actions/upload-artifact@v2
with:
name: open3d_linux_x86_64_wheels
path: |
build/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }}
build/lib/python_package/conda_package/linux-64/${{ env.CONDA_PKG_NAME }}
if-no-files-found: error
- name: GCloud CLI setup
if: ${{ github.ref == 'refs/heads/master' }}
uses: google-github-actions/setup-gcloud@master
with:
version: ${{ env.GCE_CLI_GHA_VERSION }}
service_account_key: ${{ secrets.GCE_SA_KEY_GPU_CI }}
project_id: ${{ secrets.GCE_DOCS_PROJECT }}
export_default_credentials: true
- name: Upload wheel to GCS bucket
if: ${{ github.ref == 'refs/heads/master' }}
env:
python_version: ${{ matrix.python_version }}
run: |
PYTAG="-cp$(echo ${{ env.python_version }} | tr -d '.')"
gsutil cp build/lib/python_package/pip_package/${{ env.PIP_PKG_NAME }} gs://open3d-releases-master/python-wheels/
echo "Download pip package at: https://storage.googleapis.com/open3d-releases-master/python-wheels/${{ env.PIP_PKG_NAME }}"
gsutil cp build/lib/python_package/conda_package/linux-64/${{ env.CONDA_PKG_NAME }} gs://open3d-releases-master/conda_package/linux-64/
echo "Download conda package at: https://storage.googleapis.com/open3d-releases-master/conda_package/linux-64/${{ env.CONDA_PKG_NAME }}"
test-wheel:
name: Test wheel
runs-on: ubuntu-18.04
needs: [build-wheel]
strategy:
fail-fast: false
matrix:
python_version: [3.6, 3.7, 3.8]
is_master:
- ${{ github.ref == 'refs/heads/master' }}
exclude:
- is_master: false
python_version: 3.7
- is_master: false
python_version: 3.8
env:
OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML
steps:
- name: Checkout source code
uses: actions/checkout@v2
with:
submodules: false
- name: Checkout Open3D-ML source code
uses: actions/checkout@v2
with:
repository: intel-isl/Open3D-ML
path: ${{ env.OPEN3D_ML_ROOT }}
- name: Download wheels
uses: actions/download-artifact@v2
# See https://github.com/dawidd6/action-download-artifact for more
# flexible artifact download options
with:
name: open3d_linux_x86_64_wheels
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python_version }}
- name: Test Python package
run: |
python -V
source util/ci_utils.sh
pi_tag=$(python -c "import sys; print(f'cp{sys.version_info.major}{sys.version_info.minor}')")
test_wheel pip_package/open3d*-"$pi_tag"-*.whl
- name: Run Python unit tests (benchmarks)
run: |
source util/ci_utils.sh
echo "Running Open3D python tests..."
run_python_tests