Skip to content

Commit

Permalink
Update docker files.
Browse files Browse the repository at this point in the history
Add makefile to build, remove git submodules check and new tests
  • Loading branch information
lalalune authored and fire committed Jun 21, 2024
1 parent fb7991e commit 23af16d
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 51 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
61 changes: 34 additions & 27 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 *.*
Expand All @@ -14,4 +17,4 @@ prune */__pycache__
prune infinigen/datagen/customgt/build/*
prune infinigen/datagen/customgt/dependencies/*

global-exclude *.o *.so *.pyc .git *.png
global-exclude *.o *.so *.pyc *.png
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
19 changes: 0 additions & 19 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 23af16d

Please sign in to comment.