Add Blender 3.1 tags and generate new Dockerfiles

pull/39/head
oliverpool 2022-03-11 11:21:36 +01:00
rodzic 0d23685f39
commit b854c739c4
5 zmienionych plików z 212 dodań i 0 usunięć

Wyświetl plik

@ -594,6 +594,74 @@ trigger:
event:
- push
---
kind: pipeline
name: 3.1-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.1-cpu-ubuntu18.04
pull: if-not-exists
image: plugins/docker
settings:
dockerfile: dist/3.1-cpu-ubuntu18.04/Dockerfile
password:
from_secret: docker_password
repo: nytimes/blender
tags: 3.1-cpu-ubuntu18.04
username:
from_secret: docker_username
trigger:
branch:
- master
event:
- push
---
kind: pipeline
name: 3.1-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.1-gpu-ubuntu18.04
pull: if-not-exists
image: plugins/docker
settings:
dockerfile: dist/3.1-gpu-ubuntu18.04/Dockerfile
password:
from_secret: docker_password
repo: nytimes/blender
tags:
- 3.1-gpu-ubuntu18.04
- latest
username:
from_secret: docker_username
trigger:
branch:
- master
event:
- push
---
kind: pipeline
name: notify
@ -633,6 +701,8 @@ depends_on:
- 2.93-cpu-ubuntu18.04
- 3.0-gpu-ubuntu18.04
- 3.0-cpu-ubuntu18.04
- 3.1-gpu-ubuntu18.04
- 3.1-cpu-ubuntu18.04
trigger:
branch:

Wyświetl plik

@ -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.1
- `nytimes/blender:3.1-cpu-ubuntu18.04`
- `nytimes/blender:3.1-gpu-ubuntu18.04`
### 3.0
- `nytimes/blender:3.0-cpu-ubuntu18.04`
- `nytimes/blender:3.0-gpu-ubuntu18.04`
@ -53,6 +56,9 @@ To contribute a new image make sure you:
- Add the image definition in the `manifest.json`
- Add the image to this README in the [Docker tags](#docker-tags) section
- run the `generate.py` script (for instance using `docker run -it --rm -v "$PWD":/usr/src/myapp -w /usr/src/myapp python:3.8-slim python generate.py`)
- ensure that you can build by running `docker build -t blender .` in the folders where the new `Dockerfile` were generated
- ensure that containerized blender can run `docker run -it blender blender --version`
- add the pipelines in `.drone.yml`
- PR your change and if the change is approved, we will deploy it Docker Hub
> This repository is maintained by the Research & Development team at The New York Times and is provided as-is for your own use. For more information about R&D at the Times visit [rd.nytimes.com](https://rd.nytimes.com)

Wyświetl plik

@ -0,0 +1,54 @@
# Dockerfile autogenerated on 03/11/2022, 10:28:35 by root
# Please do not edit this file directly
FROM ubuntu:18.04
LABEL Author="Or Fleisher <or.fleisher@nytimes.com>"
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.1/python/bin/"
ENV BLENDER_PATH "/bin/3.1"
ENV BLENDERPIP "/bin/3.1/python/bin/pip3"
ENV BLENDERPY "/bin/3.1/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.1/blender-3.1.0-linux-x64.tar.xz \
&& tar -xvf blender-3.1.0-linux-x64.tar.xz --strip-components=1 -C /bin \
&& rm -rf blender-3.1.0-linux-x64.tar.xz \
&& rm -rf blender-3.1.0-linux-x64
# Download the Python source since it is not bundled with Blender
RUN wget https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz \
&& tar -xzf Python-3.10.2.tgz \
&& cp -r Python-3.10.2/Include/* $BLENDER_PATH/python/include/python3.10/ \
&& rm -rf Python-3.10.2.tgz \
&& rm -rf Python-3.10.2
# 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 /

Wyświetl plik

@ -0,0 +1,54 @@
# Dockerfile autogenerated on 03/11/2022, 10:28:35 by root
# Please do not edit this file directly
FROM nvidia/cudagl:10.1-base-ubuntu18.04
LABEL Author="Or Fleisher <or.fleisher@nytimes.com>"
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.1/python/bin/"
ENV BLENDER_PATH "/bin/3.1"
ENV BLENDERPIP "/bin/3.1/python/bin/pip3"
ENV BLENDERPY "/bin/3.1/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.1/blender-3.1.0-linux-x64.tar.xz \
&& tar -xvf blender-3.1.0-linux-x64.tar.xz --strip-components=1 -C /bin \
&& rm -rf blender-3.1.0-linux-x64.tar.xz \
&& rm -rf blender-3.1.0-linux-x64
# Download the Python source since it is not bundled with Blender
RUN wget https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz \
&& tar -xzf Python-3.10.2.tgz \
&& cp -r Python-3.10.2/Include/* $BLENDER_PATH/python/include/python3.10/ \
&& rm -rf Python-3.10.2.tgz \
&& rm -rf Python-3.10.2
# 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 /

Wyświetl plik

@ -272,6 +272,34 @@
"BLENDERPY \"/bin/3.0/python/bin/python3.9\"",
"HW=\"GPU\""
]
},
{
"tag": "3.1-cpu-ubuntu18.04",
"base_os_image": "ubuntu:18.04",
"blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.1/blender-3.1.0-linux-x64.tar.xz",
"python_download_url": "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz",
"python_version": "python3.10",
"env": [
"PATH \"$PATH:/bin/3.1/python/bin/\"",
"BLENDER_PATH \"/bin/3.1\"",
"BLENDERPIP \"/bin/3.1/python/bin/pip3\"",
"BLENDERPY \"/bin/3.1/python/bin/python3.10\"",
"HW=\"CPU\""
]
},
{
"tag": "3.1-gpu-ubuntu18.04",
"base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04",
"blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.1/blender-3.1.0-linux-x64.tar.xz",
"python_download_url": "https://www.python.org/ftp/python/3.10.2/Python-3.10.2.tgz",
"python_version": "python3.10",
"env": [
"PATH \"$PATH:/bin/3.1/python/bin/\"",
"BLENDER_PATH \"/bin/3.1\"",
"BLENDERPIP \"/bin/3.1/python/bin/pip3\"",
"BLENDERPY \"/bin/3.1/python/bin/python3.10\"",
"HW=\"GPU\""
]
}
]
}