-
Notifications
You must be signed in to change notification settings - Fork 2.3k
181 lines (176 loc) · 6.65 KB
/
ubuntu-wheel.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
name: Ubuntu Wheel
permissions: {}
on:
workflow_dispatch:
inputs:
developer_build:
description: 'Set to OFF for Release wheels'
required: false
default: 'ON'
push:
branches:
- main
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GCE_CLI_GHA_VERSION: '416.0.0' # Fixed to avoid dependency on API changes
BUILD_CUDA_MODULE: 'ON'
BUILD_PYTORCH_OPS: 'ON'
BUILD_TENSORFLOW_OPS: 'OFF' # Turn ON when cxx11_abi is same for TF and PyTorch
jobs:
build-wheel:
permissions:
contents: write # Release upload
name: Build wheel
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11']
is_main:
- ${{ github.ref == 'refs/heads/main' }}
exclude:
- is_main: false
python_version: '3.8'
- is_main: false
python_version: '3.9'
- is_main: false
python_version: '3.10'
env:
DEVELOPER_BUILD: ${{ github.event.inputs.developer_build || 'ON' }}
PYTHON_VERSION: ${{ matrix.python_version }}
CCACHE_TAR_NAME: open3d-ubuntu-1804-cuda-ci-ccache
OPEN3D_CPU_RENDERING: true
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
# Be verbose and explicit here such that a developer can directly copy the
# `docker/docker_build.sh xxx` command to execute locally.
- name: Docker build
run: |
if [ "${{ env.PYTHON_VERSION }}" = "3.8" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then
docker/docker_build.sh cuda_wheel_py38_dev
elif [ "${{ env.PYTHON_VERSION }}" = "3.9" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then
docker/docker_build.sh cuda_wheel_py39_dev
elif [ "${{ env.PYTHON_VERSION }}" = "3.10" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then
docker/docker_build.sh cuda_wheel_py310_dev
elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "ON" ]; then
docker/docker_build.sh cuda_wheel_py311_dev
elif [ "${{ env.PYTHON_VERSION }}" = "3.8" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then
docker/docker_build.sh cuda_wheel_py38
elif [ "${{ env.PYTHON_VERSION }}" = "3.9" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then
docker/docker_build.sh cuda_wheel_py39
elif [ "${{ env.PYTHON_VERSION }}" = "3.10" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then
docker/docker_build.sh cuda_wheel_py310
elif [ "${{ env.PYTHON_VERSION }}" = "3.11" ] && [ "${{ env.DEVELOPER_BUILD }}" = "OFF" ]; then
docker/docker_build.sh cuda_wheel_py311
fi
PIP_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d-[0-9]*.whl)"
PIP_CPU_PKG_NAME="$(basename ${GITHUB_WORKSPACE}/open3d_cpu*.whl)"
echo "PIP_PKG_NAME=$PIP_PKG_NAME" >> $GITHUB_ENV
echo "PIP_CPU_PKG_NAME=$PIP_CPU_PKG_NAME" >> $GITHUB_ENV
- name: Upload wheel to GitHub artifacts
uses: actions/upload-artifact@v4
with:
name: ${{ env.PIP_PKG_NAME }}
path: |
${{ env.PIP_PKG_NAME }}
${{ env.PIP_CPU_PKG_NAME }}
if-no-files-found: error
- name: GCloud CLI auth
if: ${{ github.ref == 'refs/heads/main' }}
uses: 'google-github-actions/auth@v2'
with:
project_id: ${{ secrets.GCE_PROJECT }}
credentials_json: '${{ secrets.GCE_SA_KEY_GPU_CI }}'
- name: GCloud CLI setup
if: ${{ github.ref == 'refs/heads/main' }}
uses: google-github-actions/setup-gcloud@v2
with:
version: ${{ env.GCE_CLI_GHA_VERSION }}
project_id: ${{ secrets.GCE_PROJECT }}
- name: Upload ccache to GCS
if: ${{ github.ref == 'refs/heads/main' }}
run: |
gsutil cp ${GITHUB_WORKSPACE}/${{ env.CCACHE_TAR_NAME }}.tar.gz gs://open3d-ci-cache/
- name: Update devel release
if: ${{ github.ref == 'refs/heads/main' }}
env:
GH_TOKEN: ${{ github.token }}
run: |
gh release upload main-devel ${GITHUB_WORKSPACE}/${{ env.PIP_PKG_NAME }} \
${GITHUB_WORKSPACE}/${{ env.PIP_CPU_PKG_NAME }} --clobber
gh release view main-devel
test-wheel-cpu:
name: Test wheel CPU
permissions:
contents: read
runs-on: ubuntu-20.04
needs: [build-wheel]
strategy:
fail-fast: false
matrix:
python_version: ['3.8', '3.9', '3.10', '3.11']
is_main:
- ${{ github.ref == 'refs/heads/main' }}
exclude:
- is_main: false
python_version: '3.8'
- is_main: false
python_version: '3.9'
- is_main: false
python_version: '3.10'
env:
OPEN3D_ML_ROOT: ${{ github.workspace }}/Open3D-ML
steps:
- name: Checkout source code
uses: actions/checkout@v4
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
- name: Checkout Open3D-ML source code
uses: actions/checkout@v4
with:
repository: isl-org/Open3D-ML
path: ${{ env.OPEN3D_ML_ROOT }}
- name: Download wheels
uses: actions/download-artifact@v4
with:
pattern: open3d*-manylinux*.whl
merge-multiple: true
- name: Set up Python
uses: actions/setup-python@v5
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 open3d-[0-9]*-"$pi_tag"-*.whl
- name: Run Python unit tests
run: |
source util/ci_utils.sh
echo "Running Open3D python tests..."
run_python_tests
- name: Test Python package (CPU)
env:
BUILD_CUDA_MODULE: OFF
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 open3d_cpu*-"$pi_tag"-*.whl
- name: Run Python unit tests (CPU)
run: |
source util/ci_utils.sh
echo "Running Open3D python tests (CPU wheel)..."
run_python_tests