-
Notifications
You must be signed in to change notification settings - Fork 2.3k
149 lines (142 loc) · 5.3 KB
/
ubuntu-openblas.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
name: Ubuntu OpenBLAS
on:
workflow_dispatch:
push:
branches:
- master
pull_request:
types: [opened, reopened, synchronize]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
env:
GCE_GPU_CI_SA: ${{ secrets.GCE_GPU_CI_SA }}
GCE_CLI_GHA_VERSION: '416.0.0' # Fixed to avoid dependency on API changes
jobs:
openblas-amd64:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Maximize build space
run: |
source util/ci_utils.sh
maximize_ubuntu_github_actions_build_space
- name: Docker build
run: docker/docker_build.sh openblas-amd64-py310-dev
- name: Docker test
run: docker/docker_test.sh openblas-amd64-py310-dev
# With forked repo, the GitHub secret is not available.
skip-arm64-check-on-fork:
runs-on: ubuntu-latest
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 "skip=no" >> $GITHUB_OUTPUT
else
echo "Secrets not available: skipping GCE test"
echo "skip=yes" >> $GITHUB_OUTPUT
fi
openblas-arm64:
runs-on: ubuntu-latest
needs: [skip-arm64-check-on-fork]
if: needs.skip-arm64-check-on-fork.outputs.skip == 'no'
strategy:
fail-fast: false
env:
# Export everything from matrix to be easily used.
# Docker tag must be consistent with docker_build.sh
CI_CONFIG : openblas-arm64-py310-dev
GCE_INSTANCE_PREFIX: open3d-ci-openblas-arm64-py310-dev
steps:
- name: Checkout source code
uses: actions/checkout@v3
- name: Package code
run: |
# GITHUB_WORKSPACE: /home/runner/work/Open3D/Open3D
cd "${GITHUB_WORKSPACE}/.."
tar -czvf Open3D.tar.gz Open3D
ls -alh
- name: GCloud CLI auth
uses: 'google-github-actions/auth@v1'
with:
project_id: ${{ secrets.GCE_PROJECT }}
credentials_json: '${{ secrets.GCE_SA_KEY_GPU_CI }}'
- name: GCloud CLI setup
uses: google-github-actions/setup-gcloud@v1
with:
version: ${{ env.GCE_CLI_GHA_VERSION }}
project_id: ${{ secrets.GCE_PROJECT }}
- name: VM create
run: |
gcloud compute images list
gcloud container images list
INSTANCE_NAME="${GCE_INSTANCE_PREFIX}-${GITHUB_SHA::8}"
INSTANCE_ZONES=(us-central1-a
us-central1-b
us-central1-f
asia-southeast1-b
asia-southeast1-c
europe-west4-a
europe-west4-b)
ZONE_ID=0
until ((ZONE_ID >= ${#INSTANCE_ZONES[@]})) ||
gcloud compute instances create "$INSTANCE_NAME" \
--zone="${INSTANCE_ZONES[$ZONE_ID]}" \
--machine-type=t2a-standard-4 \
--boot-disk-size="128GB" \
--image-project="ubuntu-os-cloud" \
--image-family="ubuntu-2004-lts-arm64" \
--metadata-from-file=startup-script=./util/gcloud_auto_clean.sh \
--scopes="storage-full,compute-rw" \
--service-account="$GCE_GPU_CI_SA"; do
((ZONE_ID = ZONE_ID + 1))
done
sleep 90
echo "GCE_ZONE=${INSTANCE_ZONES[$ZONE_ID]}" >> "${GITHUB_ENV}"
echo "INSTANCE_NAME=${INSTANCE_NAME}" >> "${GITHUB_ENV}"
exit $((ZONE_ID >= ${#INSTANCE_ZONES[@]})) # 0 => success
- name: VM copy code
run: |
gcloud compute scp \
"${GITHUB_WORKSPACE}/../Open3D.tar.gz" "${INSTANCE_NAME}":~ \
--zone "${GCE_ZONE}"
gcloud compute ssh "${INSTANCE_NAME}" \
--zone "${GCE_ZONE}" \
--command "ls -alh \
&& tar -xvzf Open3D.tar.gz \
&& ls -alh \
&& ls -alh Open3D"
- name: VM install docker
run: |
gcloud compute ssh "${INSTANCE_NAME}" \
--zone="${GCE_ZONE}" \
--command="sudo apt update \
&& curl -fsSL https://get.docker.com -o get-docker.sh \
&& sudo sh get-docker.sh"
- name: VM build docker
run: |
gcloud compute ssh "${INSTANCE_NAME}" \
--zone="${GCE_ZONE}" \
--command="sudo docker run --rm arm64v8/ubuntu:20.04 uname -p \
&& sudo Open3D/docker/docker_build.sh ${CI_CONFIG}"
- name: VM run docker
run: |
gcloud compute ssh "${INSTANCE_NAME}" \
--zone="${GCE_ZONE}" \
--command="sudo Open3D/docker/docker_test.sh ${CI_CONFIG}"
- name: VM delete
if: always()
run: |
gcloud compute instances delete "${INSTANCE_NAME}" --zone "${GCE_ZONE}"
ls -alh "${HOME}/.ssh"
gcloud compute os-login describe-profile
gcloud compute os-login ssh-keys remove --key-file "${HOME}/.ssh/google_compute_engine.pub"