From c1b5317baaa4fdf9f53fa15dfea57012983c6e62 Mon Sep 17 00:00:00 2001 From: Or Fleisher Date: Wed, 9 Jun 2021 10:21:05 -0400 Subject: [PATCH] Add containers for 2.93 and allow custom python versions --- .travis.yml | 4 +- dist/2.80-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.80-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.81-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.81-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.82-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.82-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.83-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.83-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.90-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.90-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.91-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.91-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.92-cpu-ubuntu18.04/Dockerfile | 4 +- dist/2.92-gpu-ubuntu18.04/Dockerfile | 4 +- dist/2.93-cpu-ubuntu18.04/Dockerfile | 54 +++++++++++++++++++++++++++ dist/2.93-gpu-ubuntu18.04/Dockerfile | 54 +++++++++++++++++++++++++++ generate.py | 27 ++++++++++---- manifest.json | 56 ++++++++++++++++++++++++++++ 19 files changed, 214 insertions(+), 37 deletions(-) create mode 100644 dist/2.93-cpu-ubuntu18.04/Dockerfile create mode 100644 dist/2.93-gpu-ubuntu18.04/Dockerfile diff --git a/.travis.yml b/.travis.yml index 9144005..18336bb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -25,7 +25,9 @@ script: - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:2.91-gpu-ubuntu18.04; fi - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:2.92-cpu-ubuntu18.04; fi - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:2.92-gpu-ubuntu18.04; fi - - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker tag nytimes/blender:2.92-gpu-ubuntu18.04 nytimes/blender:latest; fi + - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:2.93-cpu-ubuntu18.04; fi + - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:2.93-gpu-ubuntu18.04; fi + - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker tag nytimes/blender:2.93-gpu-ubuntu18.04 nytimes/blender:latest; fi - if [[ $TRAVIS_PULL_REQUEST == 'false' ]]; then docker push nytimes/blender:latest; fi after_success: - bash ./notify.sh \ No newline at end of file diff --git a/dist/2.80-cpu-ubuntu18.04/Dockerfile b/dist/2.80-cpu-ubuntu18.04/Dockerfile index a81f5d5..99883c9 100644 --- a/dist/2.80-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.80-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -44,7 +44,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.80-gpu-ubuntu18.04/Dockerfile b/dist/2.80-gpu-ubuntu18.04/Dockerfile index 55dba42..17b1d72 100644 --- a/dist/2.80-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.80-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -44,7 +44,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.81-cpu-ubuntu18.04/Dockerfile b/dist/2.81-cpu-ubuntu18.04/Dockerfile index 15878d4..160ec2b 100644 --- a/dist/2.81-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.81-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -44,7 +44,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.81-gpu-ubuntu18.04/Dockerfile b/dist/2.81-gpu-ubuntu18.04/Dockerfile index 319dbae..df1611f 100644 --- a/dist/2.81-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.81-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -44,7 +44,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.82-cpu-ubuntu18.04/Dockerfile b/dist/2.82-cpu-ubuntu18.04/Dockerfile index 0798080..3d38811 100644 --- a/dist/2.82-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.82-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.82-gpu-ubuntu18.04/Dockerfile b/dist/2.82-gpu-ubuntu18.04/Dockerfile index 855e3d5..6142df2 100644 --- a/dist/2.82-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.82-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.83-cpu-ubuntu18.04/Dockerfile b/dist/2.83-cpu-ubuntu18.04/Dockerfile index 5b2833a..d3fb768 100644 --- a/dist/2.83-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.83-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.83-gpu-ubuntu18.04/Dockerfile b/dist/2.83-gpu-ubuntu18.04/Dockerfile index 1450db9..1cebaf7 100644 --- a/dist/2.83-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.83-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.90-cpu-ubuntu18.04/Dockerfile b/dist/2.90-cpu-ubuntu18.04/Dockerfile index fa30e7a..17bdf9f 100644 --- a/dist/2.90-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.90-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.90-gpu-ubuntu18.04/Dockerfile b/dist/2.90-gpu-ubuntu18.04/Dockerfile index 15e6d0a..1500491 100644 --- a/dist/2.90-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.90-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.91-cpu-ubuntu18.04/Dockerfile b/dist/2.91-cpu-ubuntu18.04/Dockerfile index 8c2994b..d1ac85b 100644 --- a/dist/2.91-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.91-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.91-gpu-ubuntu18.04/Dockerfile b/dist/2.91-gpu-ubuntu18.04/Dockerfile index 18710b2..51fcb63 100644 --- a/dist/2.91-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.91-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.92-cpu-ubuntu18.04/Dockerfile b/dist/2.92-cpu-ubuntu18.04/Dockerfile index d522c87..975c6f4 100644 --- a/dist/2.92-cpu-ubuntu18.04/Dockerfile +++ b/dist/2.92-cpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM ubuntu:18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.92-gpu-ubuntu18.04/Dockerfile b/dist/2.92-gpu-ubuntu18.04/Dockerfile index 589fb5b..743c8c0 100644 --- a/dist/2.92-gpu-ubuntu18.04/Dockerfile +++ b/dist/2.92-gpu-ubuntu18.04/Dockerfile @@ -1,4 +1,4 @@ -# Dockerfile autogenerated on 02/25/2021, 16:04:39 by juniorxsound +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound # Please do not edit this file directly FROM nvidia/cudagl:10.1-base-ubuntu18.04 @@ -45,7 +45,7 @@ RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ && rm -rf Python-3.7.0 # Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one -RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7m/site-packages/numpy # Must first ensurepip to install Blender pip3 and then new numpy RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy diff --git a/dist/2.93-cpu-ubuntu18.04/Dockerfile b/dist/2.93-cpu-ubuntu18.04/Dockerfile new file mode 100644 index 0000000..4c4c98e --- /dev/null +++ b/dist/2.93-cpu-ubuntu18.04/Dockerfile @@ -0,0 +1,54 @@ +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound +# Please do not edit this file directly + +FROM ubuntu:18.04 + +LABEL Author="Or Fleisher " +LABEL Title="Blender in Docker" + +# Enviorment variables +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 +ENV PATH "$PATH:/bin/2.93/python/bin/" +ENV BLENDER_PATH "/bin/2.93" +ENV BLENDERPIP "/bin/2.93/python/bin/pip3" +ENV BLENDERPY "/bin/2.93/python/bin/python3.9" +ENV HW="CPU" + +# Install dependencies +RUN apt-get update && apt-get install -y \ + wget \ + libopenexr-dev \ + bzip2 \ + build-essential \ + zlib1g-dev \ + libxmu-dev \ + libxi-dev \ + libxxf86vm-dev \ + libfontconfig1 \ + libxrender1 \ + libgl1-mesa-glx \ + xz-utils + +# Download and install Blender +RUN wget https://mirror.clarkson.edu/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz \ + && tar -xvf blender-2.93.0-linux-x64.tar.xz --strip-components=1 -C /bin \ + && rm -rf blender-2.93.0-linux-x64.tar.xz \ + && rm -rf blender-2.93.0-linux-x64 + +# Download the Python source since it is not bundled with Blender +RUN wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz \ + && tar -xzf Python-3.9.1.tgz \ + && cp -r Python-3.9.1/Include/* $BLENDER_PATH/python/include/python3.9/ \ + && rm -rf Python-3.9.1.tgz \ + && rm -rf Python-3.9.1 + +# Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one +RUN rm -rf ${BLENDER_PATH}/python/lib/python3.9/site-packages/numpy + +# Must first ensurepip to install Blender pip3 and then new numpy +RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy + +# Set the working directory +WORKDIR / \ No newline at end of file diff --git a/dist/2.93-gpu-ubuntu18.04/Dockerfile b/dist/2.93-gpu-ubuntu18.04/Dockerfile new file mode 100644 index 0000000..80e73be --- /dev/null +++ b/dist/2.93-gpu-ubuntu18.04/Dockerfile @@ -0,0 +1,54 @@ +# Dockerfile autogenerated on 06/09/2021, 09:43:33 by juniorxsound +# Please do not edit this file directly + +FROM nvidia/cudagl:10.1-base-ubuntu18.04 + +LABEL Author="Or Fleisher " +LABEL Title="Blender in Docker" + +# Enviorment variables +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 +ENV PATH "$PATH:/bin/2.93/python/bin/" +ENV BLENDER_PATH "/bin/2.93" +ENV BLENDERPIP "/bin/2.93/python/bin/pip3" +ENV BLENDERPY "/bin/2.93/python/bin/python3.9" +ENV HW="GPU" + +# Install dependencies +RUN apt-get update && apt-get install -y \ + wget \ + libopenexr-dev \ + bzip2 \ + build-essential \ + zlib1g-dev \ + libxmu-dev \ + libxi-dev \ + libxxf86vm-dev \ + libfontconfig1 \ + libxrender1 \ + libgl1-mesa-glx \ + xz-utils + +# Download and install Blender +RUN wget https://mirror.clarkson.edu/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz \ + && tar -xvf blender-2.93.0-linux-x64.tar.xz --strip-components=1 -C /bin \ + && rm -rf blender-2.93.0-linux-x64.tar.xz \ + && rm -rf blender-2.93.0-linux-x64 + +# Download the Python source since it is not bundled with Blender +RUN wget https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz \ + && tar -xzf Python-3.9.1.tgz \ + && cp -r Python-3.9.1/Include/* $BLENDER_PATH/python/include// \ + && rm -rf Python-3.9.1.tgz \ + && rm -rf Python-3.9.1 + +# Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one +RUN rm -rf ${BLENDER_PATH}/python/lib//site-packages/numpy + +# Must first ensurepip to install Blender pip3 and then new numpy +RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy + +# Set the working directory +WORKDIR / \ No newline at end of file diff --git a/generate.py b/generate.py index b50ab8b..3c736b1 100755 --- a/generate.py +++ b/generate.py @@ -38,6 +38,8 @@ def create_dockerfile(base_os: str, env: list, deps: list, blender_download_url: str, + python_download_url: str, + python_version: str, workdir: str) -> str: """ Create a stringified Dockerfile based on arguments provided @@ -60,7 +62,7 @@ def create_dockerfile(base_os: str, archivetype = blender_download_url.split(".")[-1] archiveflags = "xjvf" - + if archivetype == "xz": archiveflags = "xvf" deps.append("xz-utils") @@ -68,7 +70,7 @@ def create_dockerfile(base_os: str, for dependency, has_more in lookahead(deps): is_multiline = " \ " if has_more else "" dockerfile += "\u0009{}{}\n".format(dependency, is_multiline) - + # Needed so xz-utils doesn't accumalate if archivetype == "xz": deps.pop() @@ -85,14 +87,21 @@ def create_dockerfile(base_os: str, blender_download_url.split("/")[-1].split(".tar."+archivetype)[0]) dockerfile += "# Download the Python source since it is not bundled with Blender\n" - dockerfile += "RUN wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz \ \n" - dockerfile += "\u0009&& tar -xzf Python-3.7.0.tgz \ \n" - dockerfile += "\u0009&& cp -r Python-3.7.0/Include/* $BLENDER_PATH/python/include/python3.7m/ \ \n" - dockerfile += "\u0009&& rm -rf Python-3.7.0.tgz \ \n" - dockerfile += "\u0009&& rm -rf Python-3.7.0 \n\n" + dockerfile += "RUN wget {} \ \n".format(python_download_url) + dockerfile += "\u0009&& tar -xzf {} \ \n".format( + python_download_url.split("/")[-1]) + dockerfile += "\u0009&& cp -r {}/Include/* $BLENDER_PATH/python/include/{}/ \ \n".format( + python_download_url.split("/")[-1].split('.tgz')[0], + python_version + ) + dockerfile += "\u0009&& rm -rf {} \ \n".format( + python_download_url.split("/")[-1]) + dockerfile += "\u0009&& rm -rf {} \n\n".format( + python_download_url.split("/")[-1].split('.tgz')[0]) dockerfile += "# Blender comes with a super outdated version of numpy (which is needed for matplotlib / opencv) so override it with a modern one\n" - dockerfile += "RUN rm -rf ${BLENDER_PATH}/python/lib/python3.7/site-packages/numpy \n\n" + dockerfile += "RUN rm -rf {}/python/lib/{}/site-packages/numpy \n\n".format( + "${BLENDER_PATH}", python_version) dockerfile += "# Must first ensurepip to install Blender pip3 and then new numpy\n" dockerfile += "RUN ${BLENDERPY} -m ensurepip && ${BLENDERPIP} install --upgrade pip && ${BLENDERPIP} install numpy\n\n" @@ -124,6 +133,8 @@ if __name__ == "__main__": env=manifest["env"] + image["env"], deps=manifest["deps"], blender_download_url=image["blender_download_url"], + python_download_url=image["python_download_url"], + python_version=image["python_version"], workdir="/" ) diff --git a/manifest.json b/manifest.json index 284ddeb..6c5ae60 100644 --- a/manifest.json +++ b/manifest.json @@ -25,6 +25,8 @@ "tag": "2.80-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.80/blender-2.80-linux-glibc217-x86_64.tar.bz2", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.80/python/bin/\"", "BLENDER_PATH \"/bin/2.80\"", @@ -37,6 +39,8 @@ "tag": "2.80-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.80/blender-2.80-linux-glibc217-x86_64.tar.bz2", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.80/python/bin/\"", "BLENDER_PATH \"/bin/2.80\"", @@ -49,6 +53,8 @@ "tag": "2.81-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.81/blender-2.81-linux-glibc217-x86_64.tar.bz2", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.81/python/bin/\"", "BLENDER_PATH \"/bin/2.81\"", @@ -61,6 +67,8 @@ "tag": "2.81-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.81/blender-2.81-linux-glibc217-x86_64.tar.bz2", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.81/python/bin/\"", "BLENDER_PATH \"/bin/2.81\"", @@ -73,6 +81,8 @@ "tag": "2.82-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.82/blender-2.82-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.82/python/bin/\"", "BLENDER_PATH \"/bin/2.82\"", @@ -85,6 +95,8 @@ "tag": "2.82-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.82/blender-2.82-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.82/python/bin/\"", "BLENDER_PATH \"/bin/2.82\"", @@ -97,6 +109,8 @@ "tag": "2.83-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.83/blender-2.83.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.83/python/bin/\"", "BLENDER_PATH \"/bin/2.83\"", @@ -109,6 +123,8 @@ "tag": "2.83-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.83/blender-2.83.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.83/python/bin/\"", "BLENDER_PATH \"/bin/2.83\"", @@ -121,6 +137,8 @@ "tag": "2.90-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.90/blender-2.90.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.90/python/bin/\"", "BLENDER_PATH \"/bin/2.90\"", @@ -133,6 +151,8 @@ "tag": "2.90-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.90/blender-2.90.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.90/python/bin/\"", "BLENDER_PATH \"/bin/2.90\"", @@ -145,6 +165,8 @@ "tag": "2.91-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.91/blender-2.91.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.91/python/bin/\"", "BLENDER_PATH \"/bin/2.91\"", @@ -157,6 +179,8 @@ "tag": "2.91-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.91/blender-2.91.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.91/python/bin/\"", "BLENDER_PATH \"/bin/2.91\"", @@ -169,6 +193,8 @@ "tag": "2.92-cpu-ubuntu18.04", "base_os_image": "ubuntu:18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.92/blender-2.92.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.92/python/bin/\"", "BLENDER_PATH \"/bin/2.92\"", @@ -181,6 +207,8 @@ "tag": "2.92-gpu-ubuntu18.04", "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.92/blender-2.92.0-linux64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz", + "python_version": "python3.7m", "env": [ "PATH \"$PATH:/bin/2.92/python/bin/\"", "BLENDER_PATH \"/bin/2.92\"", @@ -188,6 +216,34 @@ "BLENDERPY \"/bin/2.92/python/bin/python3.7m\"", "HW=\"GPU\"" ] + }, + { + "tag": "2.93-cpu-ubuntu18.04", + "base_os_image": "ubuntu:18.04", + "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz", + "python_version": "python3.9", + "env": [ + "PATH \"$PATH:/bin/2.93/python/bin/\"", + "BLENDER_PATH \"/bin/2.93\"", + "BLENDERPIP \"/bin/2.93/python/bin/pip3\"", + "BLENDERPY \"/bin/2.93/python/bin/python3.9\"", + "HW=\"CPU\"" + ] + }, + { + "tag": "2.93-gpu-ubuntu18.04", + "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", + "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender2.93/blender-2.93.0-linux-x64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.9.1/Python-3.9.1.tgz", + "python_version": "python3.9", + "env": [ + "PATH \"$PATH:/bin/2.93/python/bin/\"", + "BLENDER_PATH \"/bin/2.93\"", + "BLENDERPIP \"/bin/2.93/python/bin/pip3\"", + "BLENDERPY \"/bin/2.93/python/bin/python3.9\"", + "HW=\"GPU\"" + ] } ]