Skip to content

Commit

Permalink
fix notebooks, add notebook execution as CI tests (#509)
Browse files Browse the repository at this point in the history
Signed-off-by: Clement Fuji Tsang <cfujitsang@nvidia.com>
  • Loading branch information
Caenorst committed Jan 12, 2022
1 parent 5f77d97 commit bad3231
Show file tree
Hide file tree
Showing 8 changed files with 201 additions and 94 deletions.
33 changes: 31 additions & 2 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,16 +71,45 @@ pytest linux:
tags: [kaolin]
stage: test
needs: ['build linux']
image: "docker:19.03.9"
image: "docker:19.03.0"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- ci/pytest-linux.sh

dibr-notebook linux:
tags: [kaolin]
stage: test
needs: ['build linux']
image: "docker:19.03.0"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- ci/dibr-notebook-linux.sh

dmtet-notebook linux:
tags: [kaolin]
stage: test
needs: ['build linux']
image: "docker:19.03.0"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- ci/dmtet-notebook-linux.sh

understanding-spcs-notebook linux:
tags: [kaolin]
stage: test
needs: ['build linux']
image: "docker:19.03.0"
before_script:
- docker login -u $CI_REGISTRY_USER -p $CI_REGISTRY_PASSWORD $CI_REGISTRY
script:
- ci/understanding-spcs-notebook-linux.sh

test windows:
tags: [kaolin_windows]
stage: test
needs: ['build windows']
script:
- ci\test-windows.bat

18 changes: 18 additions & 0 deletions ci/dibr-notebook-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
set -e
set -u

scriptroot="$( cd "$(dirname "$0")" ; pwd -P )"
cd $scriptroot/..

IMAGE_NAME=kaolin
if [ ! -z "${CI_REGISTRY_IMAGE}" ]; then
IMAGE_NAME="${CI_REGISTRY_IMAGE}/kaolin:${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"
docker pull $IMAGE_NAME
fi

docker run \
--runtime=nvidia \
--rm \
"$IMAGE_NAME" \
/bin/bash -c "cd examples/samples/ && unzip rendered_clock.zip && cd ../tutorial/ && ipython dibr_tutorial.ipynb"
18 changes: 18 additions & 0 deletions ci/dmtet-notebook-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
set -e
set -u

scriptroot="$( cd "$(dirname "$0")" ; pwd -P )"
cd $scriptroot/..

IMAGE_NAME=kaolin
if [ ! -z "${CI_REGISTRY_IMAGE}" ]; then
IMAGE_NAME="${CI_REGISTRY_IMAGE}/kaolin:${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"
docker pull $IMAGE_NAME
fi

docker run \
--runtime=nvidia \
--rm \
"$IMAGE_NAME" \
/bin/bash -c "cd examples/tutorial/ && ipython dmtet_tutorial.ipynb"
18 changes: 18 additions & 0 deletions ci/understanding-spcs-notebook-linux.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env sh
set -e
set -u

scriptroot="$( cd "$(dirname "$0")" ; pwd -P )"
cd $scriptroot/..

IMAGE_NAME=kaolin
if [ ! -z "${CI_REGISTRY_IMAGE}" ]; then
IMAGE_NAME="${CI_REGISTRY_IMAGE}/kaolin:${CI_COMMIT_REF_SLUG}-${CI_PIPELINE_ID}"
docker pull $IMAGE_NAME
fi

docker run \
--runtime=nvidia \
--rm \
"$IMAGE_NAME" \
/bin/bash -c "cd examples/tutorial/ && ipython understanding_spcs_tutorial.ipynb"
100 changes: 55 additions & 45 deletions examples/tutorial/dibr_tutorial.ipynb

Large diffs are not rendered by default.

105 changes: 58 additions & 47 deletions examples/tutorial/understanding_spcs_tutorial.ipynb

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions tools/ci_requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ flake8-mypy==17.8.0
flake8-pyi==19.3.0
pytest==5.4.2
pytest-cov==2.8.1
jupyter
2 changes: 2 additions & 0 deletions tools/linux/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ RUN sed -i -e 's|^deb http://[^.]*[.]ubuntu[.]com/ubuntu|deb https://urm.nvidia
build-essential \
curl \
git \
unzip \
libgtk2.0-0 libgtk-3-0 libgbm-dev libnotify-dev libgconf-2-4 libnss3 libxss1 libasound2 libxtst6 xauth xvfb \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
Expand Down Expand Up @@ -51,6 +52,7 @@ RUN npm install \
npm cache clean

COPY . .

ENV TORCH_CUDA_ARCH_LIST "5.2 6.0 6.1 7.0 7.5+PTX"
ENV KAOLIN_INSTALL_EXPERIMENTAL "1"
RUN python setup.py develop

0 comments on commit bad3231

Please sign in to comment.