Upgrade documentation techstack (#6470) #1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |