From 77485b5a31396ae02d59a2e1b8fe2fe248a2c119 Mon Sep 17 00:00:00 2001 From: Hunor Laczko Date: Thu, 27 Apr 2023 10:56:38 +0000 Subject: [PATCH] docker update --- docker/Dockerfile | 48 +++++++++++++++++++++++++++++++++++++++ docker/docker-compose.yml | 20 ++++++++++++++++ docker/requirements.txt | 5 ++++ 3 files changed, 73 insertions(+) create mode 100644 docker/Dockerfile create mode 100644 docker/docker-compose.yml create mode 100644 docker/requirements.txt diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..b5317e5 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,48 @@ +# Use an existing image as the base +FROM nvcr.io/nvidia/pytorch:22.06-py3 + +# Add the current user to the image +ARG USER_NAME=lhunor +ARG USER_ID=11017 +ARG GROUP_NAME=guest +ARG GROUP_ID=11000 + +# Update the system and install required packages +RUN apt-get update && apt-get upgrade -y && apt-get install -y sudo git apt-utils htop + +# Create a new group with the same GID as the host +RUN groupadd --gid $GROUP_ID $GROUP_NAME + +# Create a new user with the same UID and GID as the host +RUN useradd --uid $USER_ID --gid $GROUP_ID --shell /bin/bash --create-home $USER_NAME + +# don't require password with sudo, for convenience +# not the safest thing to do, but hopefully okay inside the container +RUN echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers + +# Add the new user to the sudo group +RUN usermod -aG sudo $USER_NAME + +# install conda stuff still as root +RUN conda update -n base conda +RUN conda install -c fvcore -c iopath -c conda-forge fvcore iopath -y +RUN conda install -c bottler nvidiacub -y +RUN conda install pytorch3d -c pytorch3d -y + +# Set the default user to the new user +USER $USER_NAME + +ENV PATH="$PATH:/home/$USER_NAME/.local/bin" +RUN pip install --upgrade pip +COPY requirements.txt /tmp/ +RUN pip install --requirement /tmp/requirements.txt + +# defining the volumes that will be mounted +VOLUME [ "/data-net" ] +VOLUME [ "/data-local" ] +VOLUME [ "/home-net" ] + +WORKDIR /workspace + +# Start the container with a bash shell +CMD ["/bin/bash"] \ No newline at end of file diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 0000000..19f6432 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,20 @@ +services: + lhunor_torch: + image: lhunor_reconstruction:v1.13 + container_name: lhunor_reconstruction_v1.13 + ipc: host + tty: true + ulimits: + memlock: -1 + stack: 67108864 + volumes: + - '/home-net/lhunor:/home-net' + - '/data-net/guest/lhunor/data:/data-net' + #- '/data-fast/126-data1/lhunor/data:/data-local/126' + #- '/data-fast/127-data1/lhunor/data:/data-local/127' + - '/data-fast/128-data1/lhunor/data:/data-local/128' + deploy: + resources: + reservations: + devices: + - capabilities: [gpu] \ No newline at end of file diff --git a/docker/requirements.txt b/docker/requirements.txt new file mode 100644 index 0000000..fa8a232 --- /dev/null +++ b/docker/requirements.txt @@ -0,0 +1,5 @@ +plotly +scipy +deodr +pandas +pytorch_msssim \ No newline at end of file