Skip to content

Commit

Permalink
Merge branch 'main' of github.com:isl-org/Open3D into fix/4960-glfw-t…
Browse files Browse the repository at this point in the history
…erminate
  • Loading branch information
ssheorey committed Dec 29, 2023
2 parents 0821d31 + 7931263 commit bad8c8f
Show file tree
Hide file tree
Showing 1,950 changed files with 53,255 additions and 44,664 deletions.
1 change: 1 addition & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,4 @@ docs/_static/build
docs/_out
3rdparty_downloads
.python-version
cmake-build-*
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/0-build-issue-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
required: true
- label: "For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip)."
required: true
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch)."
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `main` branch)."
required: true

- type: textarea
Expand Down
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/1-bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
required: true
- label: "For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip)."
required: true
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch)."
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `main` branch)."
required: true

- type: textarea
Expand Down Expand Up @@ -50,13 +50,13 @@ body:
# For Colored-ICP `colors` attribute must be of the same dtype as
# `positions` and `normals` attribute.
source.point["colors"] = source.point["colors"].to(
source.point.colors = source.point.colors.to(
o3d.core.Dtype.Float32) / 255.0
target.point["colors"] = target.point["colors"].to(
target.point.colors = target.point.colors.to(
o3d.core.Dtype.Float32) / 255.0
# Initial guess transform between the two point-cloud.
# ICP algortihm requires a good initial allignment to converge efficiently.
# ICP algorithm requires a good initial alignment to converge efficiently.
current_transformation = np.identity(4)
draw([source.transform(current_transformation), target])
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/2-questions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
required: true
- label: "For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip)."
required: true
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch)."
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `main` branch)."
required: true

- type: textarea
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/3-feature-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ body:
required: true
- label: "For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip)."
required: true
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch)."
- label: "I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `main` branch)."
required: true

- type: textarea
Expand Down
34 changes: 34 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!--- Provide a general summary of your changes in the Title above -->

## Type

<!--- Select with 'x' and link to a related issue. What types of changes does your code introduce? -->

- [ ] Bug fix (non-breaking change which fixes an issue): Fixes #
- [ ] New feature (non-breaking change which adds functionality). Resolves #
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected) Resolves #

## Motivation and Context

<!--- Why is this change required? What problem does it solve? -->

## Checklist:

<!--- Go over all the following points, and put an `x` in all the boxes that
apply. If you're unsure about any of these, don't hesitate to ask. We're here
to help! -->

- [ ] I have run `python util/check_style.py --apply` to apply Open3D **code style**
to my code.
- [ ] This PR changes Open3D behavior or adds new functionality.
- [ ] Both C++ (Doxygen) and Python (Sphinx / Google style) **documentation** is
updated accordingly.
- [ ] I have added or updated C++ and / or Python **unit tests** OR included **test
results** (e.g. screenshots or numbers) here.
- [ ] I will follow up and update the code if CI fails.
<!-- In case I am unavailable later -->
- [ ] For fork PRs, I have selected **Allow edits from maintainers**.

## Description

<!--- Describe your changes, with test results and screenshots as appropriate. Move unrelated changes, if any, to a separate PR. -->
140 changes: 76 additions & 64 deletions .github/workflows/README.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,33 @@
# Running workflows on GitHub Actions

## OS versions

Use the oldest available OS version (e.g. ubuntu-18.04, macos-11, windows-2019)
for each workflow to ensure created binary artifacts are as widely compatible as
possible. For jobs that use docker, or auxiliary jobs (e.g. uploading artifacts
to google cloud), use ubuntu-latest to avoid changing the version on GitHub
actions updates. On macOS and Windows, using Ubuntu reduces CI cost.

## Documentation deployment

### Directory structure

- `.github/workflows/documentation.yml`: Github Actions workflow file to
create and deploy documentation. Documentation is created for every branch
as a CI test, but deployed only for `master`.
- `util/ci_utils.sh:build_docs()`: Called by GitHub Actions to buld documentation.
- `unpack_docs.sh`: Called by the documentation server to deploy the docs into
the website.
- `.github/workflows/documentation.yml`: Github Actions workflow file to
create and deploy documentation. Documentation is created for every branch
as a CI test, but deployed only for `main`.
- `util/ci_utils.sh:build_docs()`: Called by GitHub Actions to build documentation.
- `unpack_docs.sh`: Called by the documentation server to deploy the docs into
the website.

### Setting up the docs deployment

#### Step 1: Google Cloud

1. Setup `gcloud`
- [Install `gcloud`](https://cloud.google.com/sdk/install)
- `gcloud init` and login with admin's google account on the web
2. Create storage bucket
1. Setup `gcloud`
- [Install `gcloud`](https://cloud.google.com/sdk/install)
- `gcloud init` and login with admin's google account on the web
2. Create storage bucket

```bash
# Create with uniform bucket-level access: `-b`
# https://cloud.google.com/storage/docs/creating-buckets#storage-create-bucket-gsutil
Expand All @@ -34,23 +43,23 @@
gsutil lifecycle set gcs.lifecycle.json gs://open3d-docs/
```

Objects will be stored in the bucket for one week. Currently, the
documentation server fetches the latest docs from `master` branch every hour.
If the documentation server fails to fetch the docs matching the `master`
Objects will be stored in the bucket for 30 days. Currently, the
documentation server fetches the latest docs from `main` branch every hour.
If the documentation server fails to fetch the docs matching the `main`
commit id, the last successfully fetched docs will be displayed.
3. Create service account
3. Create service account
```bash
gcloud iam service-accounts create open3d-ci-sa \
--description="Service account for Open3D CI" \
--display-name="open3d-ci-sa"
```
4. Grant `objectAdmin` to the service account
4. Grant `objectAdmin` to the service account
```bash
gsutil iam ch \
serviceAccount:[email protected]:objectAdmin \
gs://open3d-docs
```
5. Create key for service account
5. Create key for service account
```bash
gcloud iam service-accounts keys create ~/open3d-ci-sa-key.json \
--iam-account [email protected]
Expand All @@ -60,31 +69,31 @@ Now `~/open3d-ci-sa-key.json` should have been created.

#### Step 2: GitHub

1. Encode the private key json file with `base64 ~/open3d-ci-sa-key.json` and
1. Encode the private key json file with `base64 ~/open3d-ci-sa-key.json` and
add the output text to the
[GitHub repository secrets](https://github.com/isl-org/Open3D/settings/secrets)
with name `GCE_SA_KEY_DOCS_CI`

2. Also add secret `GCE_DOCS_PROJECT: isl-buckets`
2. Also add secret `GCE_DOCS_PROJECT: isl-buckets`

## Google compute engine setup for GPU CI

### CI Procedure

The GCE CI workflow `.github/workflows/gce-ubuntu-docker.yml` performs these steps:

- Clone the repository
- Build docker image, starting with a an NVIDIA base devel image with CUDA and
cuDNN.
- Push image to Google container registry.
- On Google Compute Engine (GCE), in parallel (up to GPU quota limit - currently
4):
- Create a new VM instance with a custom OS image
- Run docker image on GCE (Google Compute Engine) with environment variables
set for specific build config.
- The docker image entrypoint is the `run-ci.sh` script: build, install, run
tests and uninstall.
- Delete the VM instance.
- Clone the repository
- Build docker image, starting with a an NVIDIA base devel image with CUDA and
cuDNN.
- Push image to Google container registry.
- On Google Compute Engine (GCE), in parallel (up to GPU quota limit - currently
4):
- Create a new VM instance with a custom OS image
- Run docker image on GCE (Google Compute Engine) with environment variables
set for specific build config.
- The docker image entrypoint is the `run-ci.sh` script: build, install, run
tests and uninstall.
- Delete the VM instance.

A separate VM instance is created for each commit and build option. The VM
instances are named according to the commit hash and build config ID used. We
Expand All @@ -95,21 +104,21 @@ either due to lack of resources or GPU quota exhaustion.

#### Step 1: Google Cloud: Create service account and key

1. Create service account
1. Create service account
```bash
gcloud iam service-accounts create open3d-ci-sa \
--description="Service account for Open3D CI" \
--display-name="open3d-ci-sa" \
--project open3d-dev
```
2. Grant `Compute Instance Admin (beta)` to the service account
2. Grant `Compute Instance Admin (beta)` to the service account
```bash
gcloud projects add-iam-policy-binding open3d-dev \
--member=serviceAccount:[email protected] \
--role=roles/compute.instanceAdmin \
--project open3d-dev
```
3. Create key for service account
3. Create key for service account
```bash
gcloud iam service-accounts keys create ~/open3d-ci-sa-key.json \
--iam-account [email protected] \
Expand Down Expand Up @@ -138,45 +147,48 @@ used for running CI.
## Ccache strategy
- Typically, a build generates ~500MB cache. A build with Filament compiled from
source generates ~600MB cache.
- Typically, regular X86 Ubuntu and macOS builds take about 40 mins without
caching.
- The bottleneck of the CI is in the ARM build since it runs on a simulator.
When building Filament from source, the build time can exceed GitHub's 6-hour
limit if caching is not properly activated. With proper caching and good cache
hit rate, the ARM build job can run within 1 hour.
- Both Ubuntu and macOS have a max cache setting of 2GB each out of a total
cache limit of 5GB for the whole repository. Windows MSVC does not use
caching at present since `ccache` does not officially support MSVC.
- ARM64 cache (limit 1.5GB) is stored on Google cloud bucket
(`open3d-ci-cache` in the `isl-buckets` project). The bucket is world
readable, but needs the `open3d-ci-sa` service account for writing. Every
ARM64 build downloads the cache contents before build. Only `master` branch
builds use `gsutil rsync` to update the cache in GCS. Cache transfer only
takes a few minutes, but reduces ARM64 CI time to about 1:15 hours.

## Development wheels for user testing

`master` branch Python wheels are uploaded to a world readable GCS bucket for
users to try out development wheels.
- Typically, a build generates ~500MB cache. A build with Filament compiled from
source generates ~600MB cache.
- Typically, regular X86 Ubuntu and macOS builds take about 40 mins without
caching.
- The bottleneck of the CI is in the ARM build since it runs on a simulator.
When building Filament from source, the build time can exceed GitHub's 6-hour
limit if caching is not properly activated. With proper caching and good cache
hit rate, the ARM build job can run within 1 hour.
- Both Ubuntu and macOS have a max cache setting of 2GB each out of a total
cache limit of 10GB for the whole repository. Windows MSVC does not use
caching at present since `cmake + ccache` requires Ninja instead of MSBuild.
Most users use MSVC / MSBuild instead of Ninja and this would make resolving
user issues harder.
- ARM64 cache (limit 1.5GB) is stored on Google cloud bucket
(`open3d-ci-cache` in the `isl-buckets` project). The bucket is world
readable, but needs the `open3d-ci-sa` service account for writing. Every
ARM64 build downloads the cache contents before build. Only `main` branch
builds use `gsutil rsync` to update the cache in GCS. Cache transfer only
takes a few minutes, but reduces ARM64 CI time to about 1:15 hours.

## Development wheels and binary archives for user testing

`main` branch Python wheels and binary archives are uploaded to a world
readable GCS bucket in `open3d-releases/{python-wheels,devel}` for users
to try out development wheels.

### Google Cloud storage

Follow instructions in A. Documentation deployment to setup a Google cloud
bucket with:

- Project: open3d-dev
- Service account: open3d-ci-sa-gpu
- Bucket name: open3d-ci-sa-gpu
- Public read permissions
- One week object lifecycle
- Project: open3d-dev
- Service account: open3d-ci-sa-gpu
- Bucket name: open3d-ci-sa-gpu
- Public read permissions
- One month (30 days) object lifecycle

```bash
gsutil mb -p open3d-dev -c STANDARD -l US -b on gs://open3d-releases-master
gsutil acl ch -u AllUsers:R gs://open3d-releases-master
gsutil lifecycle set gcs.lifecycle.json gs:/open3d-releases-master
gsutil mb -p open3d-dev -c STANDARD -l US -b on gs://open3d-releases
gsutil acl ch -u AllUsers:R gs://open3d-releases
gsutil lifecycle set gcs.lifecycle.json gs:/open3d-releases
gsutil iam ch \
serviceAccount:[email protected]:objectAdmin \
gs://open3d-releases-master
gs://open3d-releases
```
55 changes: 55 additions & 0 deletions .github/workflows/clean-gcloud-profiles.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# Run this manually when this error occurs:
# ```
# ERROR: (gcloud.compute.scp) INVALID_ARGUMENT:
# Login profile size exceeds 32 KiB. Delete profile values to make additional space.
# ```
#
# Whenever we log in to GCloud via SSH, the public key will be persistently
# stored unless we delete them. Typically, each CI job (e.g. CUDA, OpenBLAS ARM)
# will clean up its own log in profile automatically by:
# ```
# gcloud compute os-login ssh-keys remove --key-file "${HOME}/.ssh/google_compute_engine.pub"
# ```
#
# Sometimes due to CI error, the GCloud login profile may not be deleted so
# they will accumulate. When the error of "Login profile size exceeds 32 KiB"
# happens, run this workflow manually to clean up the login profiles.

name: Clean GCloud Profiles

on:
workflow_dispatch:
# push:
# branches:
# - main
# pull_request:
# types: [opened, reopened, synchronize]

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:
clean-gcloud-profiles:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- 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: Delete GCloud login profiles manually
run: |
gcloud compute os-login describe-profile
for i in $(gcloud compute os-login ssh-keys list | grep -v FINGERPRINT); do \
echo "Removing ssh key"; \
gcloud compute os-login ssh-keys remove --key $i || true; \
done
gcloud compute os-login describe-profile
Loading

0 comments on commit bad8c8f

Please sign in to comment.