From 23af16de82ced59d0fac175777368563778d8002 Mon Sep 17 00:00:00 2001 From: moon Date: Wed, 12 Jun 2024 23:25:14 -0700 Subject: [PATCH] Update docker files. Add makefile to build, remove git submodules check and new tests --- .github/workflows/checks.yml | 5 ++- Dockerfile | 61 ++++++++++++++++++++---------------- MANIFEST.in | 5 ++- requirements.txt | 7 +++-- setup.py | 19 ----------- 5 files changed, 46 insertions(+), 51 deletions(-) diff --git a/.github/workflows/checks.yml b/.github/workflows/checks.yml index ed99f6f1b..a01c48102 100644 --- a/.github/workflows/checks.yml +++ b/.github/workflows/checks.yml @@ -26,7 +26,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - name: Checkout repository with submodules + uses: actions/checkout@v3 + with: + submodules: 'recursive' - name: Lint with ruff run: | diff --git a/Dockerfile b/Dockerfile index d9bb9da52..03277fb3e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,33 +3,40 @@ FROM ${APP_IMAGE} ARG APP_IMAGE ENV PATH="/root/miniconda3/bin:${PATH}" RUN if [ "$APP_IMAGE" = "nvidia/cuda:12.0.0-devel-ubuntu22.04" ]; then \ - echo "Using CUDA image" && \ - apt-get update && \ - apt-get install -y unzip sudo git g++ libglm-dev libglew-dev libglfw3-dev libgles2-mesa-dev zlib1g-dev wget cmake vim libxi6 libgconf-2-4 && \ - wget \ - https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh \ - && mkdir /root/.conda \ - && bash Miniconda3-latest-Linux-x86_64.sh -b \ - && rm -f Miniconda3-latest-Linux-x86_64.sh; \ - && apt-get install libxkbcommon-x11-0 \ -else \ - echo "Using Conda image" && \ - apt-get update -yq \ - && apt-get install -yq \ - cmake \ - g++ \ - libgconf-2-4 \ - libgles2-mesa-dev \ - libglew-dev \ - libglfw3-dev \ - libglm-dev \ - libxi6 \ - sudo \ - unzip \ - vim \ - zlib1g-dev; \ - && apt-get install libxkbcommon-x11-0 \ -fi + echo "Using CUDA image" && \ + apt-get update && \ + apt-get install -y libxkbcommon-x11-0 unzip sudo git g++ libglm-dev libglew-dev libglfw3-dev libgles2-mesa-dev zlib1g-dev wget cmake vim libxi6 libgconf-2-4 && \ + wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \ + mkdir /root/.conda && \ + bash Miniconda3-latest-Linux-x86_64.sh -b && \ + rm -f Miniconda3-latest-Linux-x86_64.sh; \ + else \ + echo "Using Conda image" && \ + apt-get update && \ + apt-get install -yq \ + cmake \ + g++ \ + libgconf-2-4 \ + libgles2-mesa-dev \ + libglew-dev \ + libglfw3-dev \ + libglm-dev \ + libxi6 \ + libxrender1 \ + libxxf86vm-dev \ + libxfixes3 \ + xorg \ + sudo \ + unzip \ + vim \ + dbus \ + software-properties-common \ + zlib1g-dev \ + libxkbcommon-x11-0 \ + wget && \ + apt-get clean && \ + rm -rf /var/lib/apt/lists/*; \ + fi RUN mkdir /opt/infinigen WORKDIR /opt/infinigen diff --git a/MANIFEST.in b/MANIFEST.in index 342ecf2f2..39def5d8a 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -4,6 +4,9 @@ # but some are still explicitly included in the .whl via include .gitmodules +include Makefile + +recursive-include scripts *.* recursive-include infinigen *.* recursive-include tests *.* @@ -14,4 +17,4 @@ prune */__pycache__ prune infinigen/datagen/customgt/build/* prune infinigen/datagen/customgt/dependencies/* -global-exclude *.o *.so *.pyc .git *.png \ No newline at end of file +global-exclude *.o *.so *.pyc *.png \ No newline at end of file diff --git a/requirements.txt b/requirements.txt index 6686c552b..2195b5f7a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,20 +4,21 @@ opencv-python matplotlib scipy imageio -scikit-image==0.19.3 +scikit-image==0.23.2 submitit frozendict flow_vis trimesh einops geomdl -numpy==1.26.2 +numpy==1.26.4 wandb jinja2 shapely -landlab==2.7.0 +landlab==2.8.0 scikit-learn psutil pyrender pytest pandas +bpy==3.6 diff --git a/setup.py b/setup.py index 48feae128..06963e40d 100644 --- a/setup.py +++ b/setup.py @@ -27,25 +27,6 @@ dont_build_steps = ["clean", "egg_info", "dist_info", "sdist", "--help"] is_build_step = not any(x in sys.argv[1] for x in dont_build_steps) -def ensure_submodules(): - # Inspired by https://github.com/pytorch/pytorch/blob/main/setup.py - - with (cwd/'.gitmodules').open() as f: - submodule_folders = [ - cwd/line.split("=", 1)[1].strip() - for line in f.readlines() - if line.strip().startswith("path") - ] - - if any(not p.exists() or not any(p.iterdir()) for p in submodule_folders): - subprocess.run( - ["git", "submodule", "update", "--init", "--recursive"], - cwd=cwd, - check=True - ) - -ensure_submodules() - # inspired by https://github.com/pytorch/pytorch/blob/161ea463e690dcb91a30faacbf7d100b98524b6b/setup.py#L290 # theirs seems to not exclude dist_info but this causes duplicate compiling in my tests if is_build_step and not MINIMAL_INSTALL: