From 2794d6b69846aa6173f18fdcfddf858b3d2febe7 Mon Sep 17 00:00:00 2001 From: oliverpool Date: Mon, 20 Jun 2022 09:37:51 +0200 Subject: [PATCH] Add Blender 3.2 tags and generate new Dockerfiles --- .drone.yml | 69 +++++++++++++++++++++++++++++ README.md | 3 ++ dist/3.2-cpu-ubuntu18.04/Dockerfile | 54 ++++++++++++++++++++++ dist/3.2-gpu-ubuntu18.04/Dockerfile | 54 ++++++++++++++++++++++ manifest.json | 28 ++++++++++++ 5 files changed, 208 insertions(+) create mode 100644 dist/3.2-cpu-ubuntu18.04/Dockerfile create mode 100644 dist/3.2-gpu-ubuntu18.04/Dockerfile diff --git a/.drone.yml b/.drone.yml index 5e02e10..9ba6355 100644 --- a/.drone.yml +++ b/.drone.yml @@ -650,6 +650,73 @@ steps: repo: nytimes/blender tags: - 3.1-gpu-ubuntu18.04 + username: + from_secret: docker_username + +trigger: + branch: + - master + event: + - push + +--- +kind: pipeline +name: 3.2-cpu-ubuntu18.04 + +platform: + os: linux + arch: amd64 + +steps: +- name: generate + pull: if-not-exists + image: python:3.8-slim + commands: + - python3 generate.py + +- name: 3.2-cpu-ubuntu18.04 + pull: if-not-exists + image: plugins/docker + settings: + dockerfile: dist/3.2-cpu-ubuntu18.04/Dockerfile + password: + from_secret: docker_password + repo: nytimes/blender + tags: 3.2-cpu-ubuntu18.04 + username: + from_secret: docker_username + +trigger: + branch: + - master + event: + - push + +--- +kind: pipeline +name: 3.2-gpu-ubuntu18.04 + +platform: + os: linux + arch: amd64 + +steps: +- name: generate + pull: if-not-exists + image: python:3.8-slim + commands: + - python3 generate.py + +- name: 3.2-gpu-ubuntu18.04 + pull: if-not-exists + image: plugins/docker + settings: + dockerfile: dist/3.2-gpu-ubuntu18.04/Dockerfile + password: + from_secret: docker_password + repo: nytimes/blender + tags: + - 3.2-gpu-ubuntu18.04 - latest username: from_secret: docker_username @@ -701,6 +768,8 @@ depends_on: - 3.0-cpu-ubuntu18.04 - 3.1-gpu-ubuntu18.04 - 3.1-cpu-ubuntu18.04 + - 3.2-gpu-ubuntu18.04 + - 3.2-cpu-ubuntu18.04 trigger: branch: diff --git a/README.md b/README.md index 358cd2a..713ec44 100644 --- a/README.md +++ b/README.md @@ -20,6 +20,9 @@ The images in this repository are autogenerated by running the `generate.py` scr ## Docker tags - `nytimes/blender:latest` - Latest GPU image with latest Blender version +### 3.2 +- `nytimes/blender:3.2-cpu-ubuntu18.04` +- `nytimes/blender:3.2-gpu-ubuntu18.04` ### 3.1 - `nytimes/blender:3.1-cpu-ubuntu18.04` - `nytimes/blender:3.1-gpu-ubuntu18.04` diff --git a/dist/3.2-cpu-ubuntu18.04/Dockerfile b/dist/3.2-cpu-ubuntu18.04/Dockerfile new file mode 100644 index 0000000..07464f5 --- /dev/null +++ b/dist/3.2-cpu-ubuntu18.04/Dockerfile @@ -0,0 +1,54 @@ +# Dockerfile autogenerated on 06/20/2022, 07:33:14 by root +# Please do not edit this file directly + +FROM ubuntu:18.04 + +LABEL Author="Or Fleisher " +LABEL Title="Blender in Docker" + +# Environment variables +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 +ENV PATH "$PATH:/bin/3.2/python/bin/" +ENV BLENDER_PATH "/bin/3.2" +ENV BLENDERPIP "/bin/3.2/python/bin/pip3" +ENV BLENDERPY "/bin/3.2/python/bin/python3.10" +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/Blender3.2/blender-3.2.0-linux-x64.tar.xz \ + && tar -xvf blender-3.2.0-linux-x64.tar.xz --strip-components=1 -C /bin \ + && rm -rf blender-3.2.0-linux-x64.tar.xz \ + && rm -rf blender-3.2.0-linux-x64 + +# Download the Python source since it is not bundled with Blender +RUN wget https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz \ + && tar -xzf Python-3.10.5.tgz \ + && cp -r Python-3.10.5/Include/* $BLENDER_PATH/python/include/python3.10/ \ + && rm -rf Python-3.10.5.tgz \ + && rm -rf Python-3.10.5 + +# 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.10/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/3.2-gpu-ubuntu18.04/Dockerfile b/dist/3.2-gpu-ubuntu18.04/Dockerfile new file mode 100644 index 0000000..406f5f5 --- /dev/null +++ b/dist/3.2-gpu-ubuntu18.04/Dockerfile @@ -0,0 +1,54 @@ +# Dockerfile autogenerated on 06/20/2022, 07:33:14 by root +# Please do not edit this file directly + +FROM nvidia/cudagl:10.1-base-ubuntu18.04 + +LABEL Author="Or Fleisher " +LABEL Title="Blender in Docker" + +# Environment variables +ENV DEBIAN_FRONTEND noninteractive +ENV LC_ALL C.UTF-8 +ENV LANG C.UTF-8 +ENV PATH "$PATH:/bin/3.2/python/bin/" +ENV BLENDER_PATH "/bin/3.2" +ENV BLENDERPIP "/bin/3.2/python/bin/pip3" +ENV BLENDERPY "/bin/3.2/python/bin/python3.10" +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/Blender3.2/blender-3.2.0-linux-x64.tar.xz \ + && tar -xvf blender-3.2.0-linux-x64.tar.xz --strip-components=1 -C /bin \ + && rm -rf blender-3.2.0-linux-x64.tar.xz \ + && rm -rf blender-3.2.0-linux-x64 + +# Download the Python source since it is not bundled with Blender +RUN wget https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz \ + && tar -xzf Python-3.10.5.tgz \ + && cp -r Python-3.10.5/Include/* $BLENDER_PATH/python/include/python3.10/ \ + && rm -rf Python-3.10.5.tgz \ + && rm -rf Python-3.10.5 + +# 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.10/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/manifest.json b/manifest.json index a0da3d5..d2c2003 100644 --- a/manifest.json +++ b/manifest.json @@ -300,6 +300,34 @@ "BLENDERPY \"/bin/3.1/python/bin/python3.10\"", "HW=\"GPU\"" ] + }, + { + "tag": "3.2-cpu-ubuntu18.04", + "base_os_image": "ubuntu:18.04", + "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.2/blender-3.2.0-linux-x64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz", + "python_version": "python3.10", + "env": [ + "PATH \"$PATH:/bin/3.2/python/bin/\"", + "BLENDER_PATH \"/bin/3.2\"", + "BLENDERPIP \"/bin/3.2/python/bin/pip3\"", + "BLENDERPY \"/bin/3.2/python/bin/python3.10\"", + "HW=\"CPU\"" + ] + }, + { + "tag": "3.2-gpu-ubuntu18.04", + "base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04", + "blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.2/blender-3.2.0-linux-x64.tar.xz", + "python_download_url": "https://www.python.org/ftp/python/3.10.5/Python-3.10.5.tgz", + "python_version": "python3.10", + "env": [ + "PATH \"$PATH:/bin/3.2/python/bin/\"", + "BLENDER_PATH \"/bin/3.2\"", + "BLENDERPIP \"/bin/3.2/python/bin/pip3\"", + "BLENDERPY \"/bin/3.2/python/bin/python3.10\"", + "HW=\"GPU\"" + ] } ] }