forked from isl-org/Open3D
-
Notifications
You must be signed in to change notification settings - Fork 1
136 lines (114 loc) · 4.14 KB
/
gce-ubuntu-docker.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
# Adapted from: https://acaird.github.io/computers/2020/02/11/github-google-container-cloud-run
name: Ubuntu GPU CI (docker)
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize] # Rebuild on new pushes to PR
env:
GCE_PROJECT: ${{ secrets.GCE_PROJECT }}
GCE_GPU_CI_SA: ${{ secrets.GCE_GPU_CI_SA }}
GCE_CLI_GHA_VERSION: '302.0.0' # Fixed to avoid dependency on API changes
jobs:
skip-check:
runs-on: ubuntu-18.04
name: Skip job for forks
outputs:
skip: ${{ steps.check.outputs.skip }}
steps:
- name: Skip check
id: check
run: |
if [ "$GITHUB_REPOSITORY" == "isl-org/Open3D" ] && [ -n "$GCE_GPU_CI_SA" ] ; then
echo "Secrets available: performing GCE test"
echo "::set-output name=skip::no"
else
echo "Secrets not available: skipping GCE test"
echo "::set-output name=skip::yes"
fi
build-push-docker-image:
name: Build and push docker
runs-on: ubuntu-18.04
needs: [skip-check]
if: needs.skip-check.outputs.skip == 'no'
strategy:
fail-fast: false
matrix:
UBUNTU_VERSION: ['bionic', 'focal'] # These configs have bionic and focal versions
env:
UBUNTU_VERSION: ${{ matrix.UBUNTU_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'recursive'
- name: GCloud CLI setup
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_PROJECT }}
- name: GCloud setup for docker
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh gcloud-setup
- name: Build docker image
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh docker-build
- name: Push the Docker image to Google Container Registry
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh docker-push
build-install-test:
name: Build and run
runs-on: ubuntu-18.04
needs: [skip-check, build-push-docker-image]
if: needs.skip-check.outputs.skip == 'no'
strategy:
fail-fast: false
max-parallel: 4 # Limit parallel runs to max GPU quota (4)
matrix:
# See gce-ubuntu-docker-run.sh for details. These need GPU.
CI_CONFIG_ID: ['2-bionic', '3-ML-SHARED-bionic', '4-ML-bionic', '5-ML-focal']
env:
CI_CONFIG_ID: ${{ matrix.CI_CONFIG_ID }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'false'
- name: GCloud CLI setup
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_PROJECT }}
- name: Create VM
run: |
./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh create-vm
- name: Config, build and run unit tests
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh run-ci
- name: Delete VM
if: always()
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh delete-vm
cleanup:
name: Clean-up docker image
runs-on: ubuntu-18.04
needs: [skip-check, build-push-docker-image, build-install-test]
if: always() && needs.skip-check.outputs.skip == 'no'
strategy:
fail-fast: false
matrix:
UBUNTU_VERSION: ['bionic', 'focal']
env:
UBUNTU_VERSION: ${{ matrix.UBUNTU_VERSION }}
steps:
- name: Checkout code
uses: actions/checkout@v2
with:
submodules: 'false'
- name: GCloud CLI setup
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_PROJECT }}
- name: Delete container image
run: ./util/docker/open3d-gpu/scripts/gce-ubuntu-docker-run.sh delete-image