-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added docker & docker-compose to the project #31
base: main
Are you sure you want to change the base?
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,4 +13,6 @@ datasets/t2* | |
split_files/ | ||
|
||
# Outputs. | ||
results_*/ | ||
results_*/ | ||
|
||
images/ |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
FROM pytorch/pytorch:2.5.1-cuda11.8-cudnn9-devel | ||
|
||
WORKDIR /workspace | ||
|
||
RUN apt-get update && \ | ||
apt-get install wget -y && \ | ||
apt-get install git -y | ||
|
||
# Install Miniconda | ||
RUN 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 | ||
|
||
RUN git clone https://github.com/nianticlabs/acezero --recursive | ||
|
||
RUN conda install ipykernel | ||
|
||
#Create ace0 env | ||
RUN cd acezero && \ | ||
conda env create -f environment.yml | ||
|
||
RUN echo "source activate ace0" > ~/.bashrc && \ | ||
conda run -n ace0 pip install ipykernel && \ | ||
conda install -n ace0 -c conda-forge libstdcxx-ng && \ | ||
/opt/conda/envs/ace0/bin/python -m ipykernel install --user --name=ace0 | ||
|
||
RUN cd acezero/dsacstar && \ | ||
conda run -n ace0 python setup.py install | ||
|
||
#Install ace0 deps | ||
RUN apt-get install -y libnvidia-egl-wayland1 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: Could you please combine as many apt-get calls as possible to a single RUN layer? See also https://docs.docker.com/build/building/best-practices/#apt-get In general, it's good to have fewer RUN lines, and group instructions with |
||
RUN apt-get install -y xvfb mesa-utils | ||
RUN apt-get install -y libgl1-mesa-glx libgl1-mesa-dri | ||
ENV DISPLAY=:99 | ||
RUN Xvfb :99 -screen 0 1024x768x24 & export DISPLAY=:99 | ||
|
||
# Install nerfstudio | ||
RUN conda create --name nerfstudio -y python=3.8 | ||
|
||
RUN conda run -n nerfstudio pip install --upgrade pip | ||
|
||
RUN conda run -n nerfstudio pip install torch==2.1.2+cu118 torchvision==0.16.2+cu118 --extra-index-url https://download.pytorch.org/whl/cu118 | ||
|
||
RUN conda run -n nerfstudio conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit | ||
|
||
ENV TCNN_CUDA_ARCHITECTURES="50;52;60;61;70;75;80;86" | ||
|
||
RUN conda run -n nerfstudio pip install ninja git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch | ||
|
||
RUN conda run -n nerfstudio pip install nerfstudio | ||
|
||
RUN apt-get install -y libglib2.0-0 | ||
|
||
RUN conda run -n nerfstudio ns-install-cli | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think all these RUNs up to L40 could be combined (or if not, very few splits would be needed). See advice from the Docker blog:
RUN apt-get install -y libglib2.0-0 # TODO: merge with earlier ones
ENV TCNN_CUDA_ARCHITECTURES="50;52;60;61;70;75;80;86" # consider making an export if it's not needed for the final image
RUN && \
conda create --name nerfstudio -y python=3.8 && \
conda run -n nerfstudio pip install --upgrade pip && \
conda run -n nerfstudio pip install "torch==2.1.2+cu118" "torchvision==0.16.2+cu118" --extra-index-url https://download.pytorch.org/whl/cu118 && \
conda run -n nerfstudio conda install -c "nvidia/label/cuda-11.8.0" cuda-toolkit && \
conda run -n nerfstudio pip install ninja "git+https://github.com/NVlabs/tiny-cuda-nn/#subdirectory=bindings/torch" && \
conda run -n nerfstudio pip install nerfstudio && \
conda run -n nerfstudio ns-install-cli |
||
|
||
WORKDIR /workspace/acezero |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
version: "3.8" | ||
|
||
services: | ||
acezero: | ||
restart: always | ||
container_name: acezero | ||
build: | ||
context: . | ||
dockerfile: Dockerfile | ||
tty: true | ||
stdin_open: true | ||
ports: | ||
- "7771:7007" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. suggestion: make this the default "7007:7007" or closer to it, e.g. "7008:7007" |
||
volumes: | ||
- ./images:/workspace/images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: remove this, it's not needed for the final container (unless I'm mistaken) |
||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: 'nvidia' | ||
count: all | ||
capabilities: [gpu] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I usually use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the docker-compose docs recommend using capabilities: [gpu] for docker-compose files |
||
extra_hosts: | ||
- "host.docker.internal:host-gateway" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggestion: put a comment above explaining what this does and why it's needed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you maybe be able to consider using a free conda implementation? E.g. Miniforge from conda-forge?
It's hard to predict what will happen to the permissiveness of Anaconda products: https://www.theregister.com/2024/08/08/anaconda_puts_the_squeeze_on/
If not, please add an echo or some sort of warning for users to check Anaconda's licensing terms.
Thanks!