From 543292bdb1be6940efcf2cf7f88fdeb1dcb022bd Mon Sep 17 00:00:00 2001 From: Sameer Sheorey Date: Tue, 26 Mar 2024 14:11:14 -0700 Subject: [PATCH] Remove build folder in CI to save space except lib / bin --- .github/workflows/windows.yml | 1 + .../pipelines/registration/registration.cpp | 2 +- docker/Dockerfile.ci | 5 ++++- docker/Dockerfile.wheel | 5 ++++- docker/docker_build.sh | 16 ++++------------ 5 files changed, 14 insertions(+), 15 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b56e0213085..11223949007 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -366,6 +366,7 @@ jobs: uses: actions/download-artifact@v4 with: pattern: open3d-*win*.whl + merge-multiple: true - name: Set up Python uses: actions/setup-python@v5 diff --git a/cpp/pybind/pipelines/registration/registration.cpp b/cpp/pybind/pipelines/registration/registration.cpp index f5165537fea..cddcb7e7e80 100644 --- a/cpp/pybind/pipelines/registration/registration.cpp +++ b/cpp/pybind/pipelines/registration/registration.cpp @@ -351,7 +351,7 @@ Sets :math:`c = 1` if ``with_scaling`` is ``False``. "Check if two point clouds build the polygons with similar " "edge lengths. That is, checks if the lengths of any two " "arbitrary edges (line formed by two vertices) individually " - "drawn withinin source point cloud and within the target " + "drawn within the source point cloud and within the target " "point cloud with correspondences are similar. The only " "parameter similarity_threshold is a number between 0 " "(loose) and 1 (strict)"); diff --git a/docker/Dockerfile.ci b/docker/Dockerfile.ci index e446353744a..6270dc1ae41 100644 --- a/docker/Dockerfile.ci +++ b/docker/Dockerfile.ci @@ -17,6 +17,7 @@ ARG BUILD_TENSORFLOW_OPS ARG BUILD_PYTORCH_OPS ARG PACKAGE ARG BUILD_SYCL_MODULE +ARG CI RUN if [ -z "${DEVELOPER_BUILD}" ]; then echo "Error: ARG DEVELOPER_BUILD not specified."; exit 1; fi \ && if [ -z "${CCACHE_TAR_NAME}" ]; then echo "Error: ARG CCACHE_TAR_NAME not specified."; exit 1; fi \ @@ -210,7 +211,9 @@ RUN \ && make install-pip-package -j$(nproc) \ && make install -j$(nproc) \ && if [ "${PACKAGE}" = "ON" ]; then make package; fi \ - && if [ "${PACKAGE}" = "VIEWER" ]; then make package-Open3DViewer-deb; fi + && if [ "${PACKAGE}" = "VIEWER" ]; then make package-Open3DViewer-deb; fi \ + && if [ ${CI:-}a != a ]; then ls | grep -Ev '^bin$|^lib$' | xargs rm -rf ; fi +# If CI is not null or unset, remove all build folders except bin and lib to save disk space # Compress ccache folder, move to / directory RUN ccache -s \ diff --git a/docker/Dockerfile.wheel b/docker/Dockerfile.wheel index 6a7d7080aed..a719262ece2 100644 --- a/docker/Dockerfile.wheel +++ b/docker/Dockerfile.wheel @@ -10,6 +10,7 @@ ARG CCACHE_VERSION ARG PYTHON_VERSION ARG BUILD_TENSORFLOW_OPS ARG BUILD_PYTORCH_OPS +ARG CI # Forward all ARG to ENV # ci_utils.sh requires these environment variables @@ -130,7 +131,9 @@ WORKDIR /root/Open3D RUN export NPROC=$(nproc) \ && export BUILD_SHARED_LIBS=OFF \ && source /root/Open3D/util/ci_utils.sh \ - && build_pip_package build_azure_kinect build_jupyter + && build_pip_package build_azure_kinect build_jupyter \ + && if [ ${CI:-}a != a ]; then cd /root/Open3D/build/ && ls | grep -Ev '^lib$' | xargs rm -rf ; fi + # remove build folder (except lib) to save CI space on Github # Compress ccache folder, move to / directory RUN ccache -s \ diff --git a/docker/docker_build.sh b/docker/docker_build.sh index 766473463d9..0dd13cebc57 100755 --- a/docker/docker_build.sh +++ b/docker/docker_build.sh @@ -207,15 +207,11 @@ cuda_wheel_build() { --build-arg PYTHON_VERSION="${PYTHON_VERSION}" \ --build-arg BUILD_TENSORFLOW_OPS="${BUILD_TENSORFLOW_OPS}" \ --build-arg BUILD_PYTORCH_OPS="${BUILD_PYTORCH_OPS}" \ + --build-arg CI="${CI:-}" \ -t open3d-ci:wheel \ -f docker/Dockerfile.wheel . popd - if [ ! -z ${CI+x} ] ; then # Is CI env var set? - echo "[cuda_wheel_build()] Remove build cache to recover disk space..." - df -h $PWD - docker builder prune --all --force - df -h $PWD - fi + df -h $PWD python_package_dir=/root/Open3D/build/lib/python_package docker run -v "${PWD}:/opt/mount" --rm open3d-ci:wheel \ @@ -255,15 +251,11 @@ ci_build() { --build-arg BUILD_PYTORCH_OPS="${BUILD_PYTORCH_OPS}" \ --build-arg PACKAGE="${PACKAGE}" \ --build-arg BUILD_SYCL_MODULE="${BUILD_SYCL_MODULE}" \ + --build-arg CI="${CI:-}" \ -t "${DOCKER_TAG}" \ -f docker/Dockerfile.ci . popd - if [ ! -z ${CI+x} ] ; then # Is CI env var set? - echo "[ci_build()] Remove build cache to recover disk space..." - df -h $PWD - docker builder prune --all --force - df -h $PWD - fi + df -h $PWD docker run -v "${PWD}:/opt/mount" --rm "${DOCKER_TAG}" \ bash -cx "cp /open3d* /opt/mount \