Skip to content

Commit

Permalink
Fix docker, simplify installation in dockerfile (#701)
Browse files Browse the repository at this point in the history
* fix installation for CI / Docker

Signed-off-by: Clement Fuji Tsang <cfujitsang@nvidia.com>

* fix ci remaining cpu only problems

Signed-off-by: Clement Fuji Tsang <cfujitsang@nvidia.com>

---------

Signed-off-by: Clement Fuji Tsang <cfujitsang@nvidia.com>
  • Loading branch information
Caenorst committed Mar 30, 2023
1 parent ddb4ffe commit 6301891
Show file tree
Hide file tree
Showing 8 changed files with 32 additions and 111 deletions.
2 changes: 1 addition & 1 deletion ci/gitlab_jenkins_templates/ubuntu_cpuonly_CI.jenkins
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ spec:
- name: DOCKER_HOST
value: tcp://localhost:2375
- name: docker-daemon
image: docker:19.03.1-dind
image: docker:20.10.23-dind
securityContext:
privileged: true
env:
Expand Down
42 changes: 23 additions & 19 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 0 additions & 12 deletions tools/check_torchlibs_versions.py

This file was deleted.

60 changes: 0 additions & 60 deletions tools/get_torchvision_ver.sh

This file was deleted.

14 changes: 5 additions & 9 deletions tools/linux/Dockerfile.base
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ ENV PYTHON_VERSION=${PYTHON_VERSION}
ARG PYTORCH_VERSION=1.13.1
ENV PYTORCH_VERSION=${PYTORCH_VERSION}

# Note: removing this line as it seems to cause a lot of problems.
RUN sed -i -e 's|^deb http://[^.]*[.]ubuntu[.]com/ubuntu|deb https://urm.nvidia.com/artifactory/ubuntu-remote|' /etc/apt/sources.list

RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
&& if [ -f /etc/apt/sources.list.d/cuda.list ]; then \
rm /etc/apt/sources.list.d/cuda.list; \
Expand Down Expand Up @@ -51,22 +48,21 @@ RUN curl -o ~/miniconda.sh https://repo.anaconda.com/miniconda/Miniconda3-latest
ENV PATH /opt/conda/bin:$PATH

WORKDIR /tmp
COPY ./tools/get_torchvision_ver.sh ./tools/check_torchlibs_versions.py ./
RUN CUDA_MAJOR="$(echo ${CUDA_VERSION} | cut -d'.' -f1)" && \
CUDA_MINOR="$(echo ${CUDA_VERSION} | cut -d'.' -f2)" && \
CUDA_TAG="$(echo ${CUDA_MAJOR}${CUDA_MINOR})" && \
TORCHVISION_VERSION=`./get_torchvision_ver.sh ${PYTORCH_VERSION}` && \
rm ./get_torchvision_ver.sh && \
pip install torch==${PYTORCH_VERSION}+cu${CUDA_TAG} torchvision==${TORCHVISION_VERSION}+cu${CUDA_TAG} \
-f https://download.pytorch.org/whl/cu${CUDA_TAG} -f https://download.pytorch.org/whl/torch_stable.html && \
python check_torchlibs_versions.py ${PYTORCH_VERSION} ${TORCHVISION_VERSION} ${CUDA_MAJOR}.${CUDA_MINOR}
pip install --no-cache-dir torch==${PYTORCH_VERSION}+cu${CUDA_TAG} \
-f https://download.pytorch.org/whl/cu${CUDA_TAG} \
-f https://download.pytorch.org/whl/torch_stable.html


RUN curl -fsSL https://deb.nodesource.com/setup_16.x --insecure | bash - \
&& apt-get install -y nodejs

RUN conda list > conda_build.txt

WORKDIR /kaolin

### Install Dash3D Requirements ###
RUN npm install -g npm@8.5.4
COPY package.json package-lock.json ./
Expand Down
4 changes: 0 additions & 4 deletions tools/linux/Dockerfile.base_cpuonly
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#ARG CUDA_VERSION=11.3.1
#ARG CUDNN_VERSION=8
#FROM nvidia/cuda:${CUDA_VERSION}-cudnn${CUDNN_VERSION}-devel-ubuntu18.04
FROM ubuntu:18.04
# used for cross-compilation in docker build
#
Expand All @@ -9,7 +6,6 @@ ENV PYTHON_VERSION=${PYTHON_VERSION}
ARG PYTORCH_VERSION=1.10.2
ENV PYTORCH_VERSION=${PYTORCH_VERSION}

#RUN sed -i -e 's|^deb http://[^.]*[.]ubuntu[.]com/ubuntu|deb https://urm.nvidia.com/artifactory/ubuntu-remote|' /etc/apt/sources.list \
RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
&& apt-get update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ca-certificates \
Expand Down
2 changes: 0 additions & 2 deletions tools/linux/Dockerfile.install
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@ WORKDIR /kaolin

COPY . .

RUN sed -i -e 's|^deb http://[^.]*[.]ubuntu[.]com/ubuntu|deb https://urm.nvidia.com/artifactory/ubuntu-remote|' /etc/apt/sources.list

RUN echo "Acquire { https::Verify-Peer false }" > /etc/apt/apt.conf.d/99verify-peer.conf \
&& apt-get -y update \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y --allow-unauthenticated ca-certificates \
Expand Down
7 changes: 3 additions & 4 deletions tools/windows/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,7 @@ RUN Start-Process -FilePath 'miniconda3.exe' -Wait -ArgumentList '/S', '/D=C:\Us
# conditional: bespoke logic for 1.8.2 LTS install, otherwise generic wheel lookup
RUN $Env:TORCH_STR = ${Env:PYTORCH_VERSION} + '+cu' + ${Env:CUDA_VERSION}.Replace('.',''); \
$Env:TORCH_URL='https://download.pytorch.org/whl/cu' + ${Env:CUDA_VERSION}.Replace('.',''); \
if (${Env:PYTORCH_VERSION} -eq '1.8.2') { pip install torch==1.8.2 torchvision "usd-core<22.8" flask==2.0.3 pillow==8.1.2 scipy==1.7.3 cython==0.29.20 numpy==1.21.6 tornado==6.1 "tqdm>=4.51.0" ninja --extra-index-url https://download.pytorch.org/whl/lts/1.8 } \
else { pip install torch==${Env:TORCH_STR} torchvision "usd-core<22.8" flask==2.0.3 pillow==8.1.2 scipy==1.7.3 cython==0.29.20 numpy==1.21.6 tornado==6.1 "tqdm>=4.51.0" ninja --extra-index-url ${Env:TORCH_URL}; }
pip install --no-cache-dir torch==${Env:TORCH_STR} "usd-core<22.8" flask==2.0.3 pillow==8.1.2 scipy==1.7.3 cython==0.29.20 numpy==1.21.6 tornado==6.1 "tqdm>=4.51.0" ninja --extra-index-url ${Env:TORCH_URL};
# CUDA setup for running & testing on CI machine
Expand All @@ -109,8 +108,8 @@ RUN conda list > conda_build.txt
COPY . .
# NOTE: pin setuptools to avoid directory copy bug
RUN pip install --upgrade setuptools==58.0.0
RUN pip install --upgrade certifi
RUN pip install --upgrade --no-cache-dir setuptools==58.0.0
RUN pip install --upgrade --no-cache-dir certifi
RUN pip install -r tools\ci_requirements.txt
ENV KAOLIN_INSTALL_EXPERIMENTAL "1"
Expand Down

0 comments on commit 6301891

Please sign in to comment.