kopia lustrzana https://github.com/nytimes/rd-blender-docker
Merge pull request #34 from oliverpool/blender_3.0
Add Blender 3.0 tags and generate new Dockerfilesbug/blend3-update-cuda
commit
58efd04e86
28
.drone.yml
28
.drone.yml
|
@ -218,6 +218,34 @@ pipeline:
|
||||||
event: push
|
event: push
|
||||||
branch: master
|
branch: master
|
||||||
|
|
||||||
|
3.0-cpu-ubuntu18.04:
|
||||||
|
image: plugins/docker
|
||||||
|
dockerfile: dist/3.0-cpu-ubuntu18.04/Dockerfile
|
||||||
|
repo: nytimes/blender
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
tags: 3.0-cpu-ubuntu18.04
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
branch: master
|
||||||
|
|
||||||
|
3.0-gpu-ubuntu18.04:
|
||||||
|
image: plugins/docker
|
||||||
|
dockerfile: dist/3.0-gpu-ubuntu18.04/Dockerfile
|
||||||
|
repo: nytimes/blender
|
||||||
|
username:
|
||||||
|
from_secret: docker_username
|
||||||
|
password:
|
||||||
|
from_secret: docker_password
|
||||||
|
tags:
|
||||||
|
- 3.0-gpu-ubuntu18.04
|
||||||
|
- latest
|
||||||
|
when:
|
||||||
|
event: push
|
||||||
|
branch: master
|
||||||
|
|
||||||
notify:
|
notify:
|
||||||
image: plugins/slack
|
image: plugins/slack
|
||||||
username: Blender Docker Bot
|
username: Blender Docker Bot
|
||||||
|
|
|
@ -20,6 +20,9 @@ The images in this repository are autogenerated by running the `generate.py` scr
|
||||||
|
|
||||||
## Docker tags
|
## Docker tags
|
||||||
- `nytimes/blender:latest` - Latest GPU image with latest Blender version
|
- `nytimes/blender:latest` - Latest GPU image with latest Blender version
|
||||||
|
### 3.0
|
||||||
|
- `nytimes/blender:3.0-cpu-ubuntu18.04`
|
||||||
|
- `nytimes/blender:3.0-gpu-ubuntu18.04`
|
||||||
### 2.93
|
### 2.93
|
||||||
- `nytimes/blender:2.93-cpu-ubuntu18.04`
|
- `nytimes/blender:2.93-cpu-ubuntu18.04`
|
||||||
- `nytimes/blender:2.93-gpu-ubuntu18.04`
|
- `nytimes/blender:2.93-gpu-ubuntu18.04`
|
||||||
|
@ -49,6 +52,7 @@ The images in this repository are autogenerated by running the `generate.py` scr
|
||||||
To contribute a new image make sure you:
|
To contribute a new image make sure you:
|
||||||
- Add the image definition in the `manifest.json`
|
- Add the image definition in the `manifest.json`
|
||||||
- Add the image to this README in the [Docker tags](#docker-tags) section
|
- 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`)
|
||||||
- PR your change and if the change is approved, we will deploy it Docker Hub
|
- 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)
|
> 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)
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Dockerfile autogenerated on 12/08/2021, 15:12:30 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"
|
||||||
|
|
||||||
|
# Enviorment variables
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
ENV PATH "$PATH:/bin/3.0/python/bin/"
|
||||||
|
ENV BLENDER_PATH "/bin/3.0"
|
||||||
|
ENV BLENDERPIP "/bin/3.0/python/bin/pip3"
|
||||||
|
ENV BLENDERPY "/bin/3.0/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/Blender3.0/blender-3.0.0-linux-x64.tar.xz \
|
||||||
|
&& tar -xvf blender-3.0.0-linux-x64.tar.xz --strip-components=1 -C /bin \
|
||||||
|
&& rm -rf blender-3.0.0-linux-x64.tar.xz \
|
||||||
|
&& rm -rf blender-3.0.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 /
|
|
@ -0,0 +1,54 @@
|
||||||
|
# Dockerfile autogenerated on 12/08/2021, 15:12:30 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"
|
||||||
|
|
||||||
|
# Enviorment variables
|
||||||
|
ENV DEBIAN_FRONTEND noninteractive
|
||||||
|
ENV LC_ALL C.UTF-8
|
||||||
|
ENV LANG C.UTF-8
|
||||||
|
ENV PATH "$PATH:/bin/3.0/python/bin/"
|
||||||
|
ENV BLENDER_PATH "/bin/3.0"
|
||||||
|
ENV BLENDERPIP "/bin/3.0/python/bin/pip3"
|
||||||
|
ENV BLENDERPY "/bin/3.0/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/Blender3.0/blender-3.0.0-linux-x64.tar.xz \
|
||||||
|
&& tar -xvf blender-3.0.0-linux-x64.tar.xz --strip-components=1 -C /bin \
|
||||||
|
&& rm -rf blender-3.0.0-linux-x64.tar.xz \
|
||||||
|
&& rm -rf blender-3.0.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 /
|
26
generate.py
26
generate.py
|
@ -44,9 +44,9 @@ def create_dockerfile(base_os: str,
|
||||||
"""
|
"""
|
||||||
Create a stringified Dockerfile based on arguments provided
|
Create a stringified Dockerfile based on arguments provided
|
||||||
"""
|
"""
|
||||||
dockerfile = "# Dockerfile autogenerated on {} by {} \n".format(
|
dockerfile = "# Dockerfile autogenerated on {} by {}\n".format(
|
||||||
datetime.now().strftime("%m/%d/%Y, %H:%M:%S"), getpass.getuser())
|
datetime.now().strftime("%m/%d/%Y, %H:%M:%S"), getpass.getuser())
|
||||||
dockerfile += "# Please do not edit this file directly \n\n"
|
dockerfile += "# Please do not edit this file directly\n\n"
|
||||||
|
|
||||||
dockerfile += "FROM {}\n\n".format(base_os)
|
dockerfile += "FROM {}\n\n".format(base_os)
|
||||||
dockerfile += "LABEL Author=\"{}\"\n".format(author)
|
dockerfile += "LABEL Author=\"{}\"\n".format(author)
|
||||||
|
@ -58,7 +58,7 @@ def create_dockerfile(base_os: str,
|
||||||
dockerfile += "\n"
|
dockerfile += "\n"
|
||||||
|
|
||||||
dockerfile += "# Install dependencies\n"
|
dockerfile += "# Install dependencies\n"
|
||||||
dockerfile += "RUN apt-get update && apt-get install -y \ \n"
|
dockerfile += "RUN apt-get update && apt-get install -y \\\n"
|
||||||
|
|
||||||
archivetype = blender_download_url.split(".")[-1]
|
archivetype = blender_download_url.split(".")[-1]
|
||||||
archiveflags = "xjvf"
|
archiveflags = "xjvf"
|
||||||
|
@ -78,29 +78,29 @@ def create_dockerfile(base_os: str,
|
||||||
dockerfile += "\n"
|
dockerfile += "\n"
|
||||||
|
|
||||||
dockerfile += "# Download and install Blender\n"
|
dockerfile += "# Download and install Blender\n"
|
||||||
dockerfile += "RUN wget {} \ \n".format(blender_download_url)
|
dockerfile += "RUN wget {} \\\n".format(blender_download_url)
|
||||||
dockerfile += "\u0009&& tar -{} {} --strip-components=1 -C /bin \ \n".format(
|
dockerfile += "\u0009&& tar -{} {} --strip-components=1 -C /bin \\\n".format(
|
||||||
archiveflags, blender_download_url.split("/")[-1])
|
archiveflags, blender_download_url.split("/")[-1])
|
||||||
dockerfile += "\u0009&& rm -rf {} \ \n".format(
|
dockerfile += "\u0009&& rm -rf {} \\\n".format(
|
||||||
blender_download_url.split("/")[-1])
|
blender_download_url.split("/")[-1])
|
||||||
dockerfile += "\u0009&& rm -rf {} \n\n".format(
|
dockerfile += "\u0009&& rm -rf {}\n\n".format(
|
||||||
blender_download_url.split("/")[-1].split(".tar."+archivetype)[0])
|
blender_download_url.split("/")[-1].split(".tar."+archivetype)[0])
|
||||||
|
|
||||||
dockerfile += "# Download the Python source since it is not bundled with Blender\n"
|
dockerfile += "# Download the Python source since it is not bundled with Blender\n"
|
||||||
dockerfile += "RUN wget {} \ \n".format(python_download_url)
|
dockerfile += "RUN wget {} \\\n".format(python_download_url)
|
||||||
dockerfile += "\u0009&& tar -xzf {} \ \n".format(
|
dockerfile += "\u0009&& tar -xzf {} \\\n".format(
|
||||||
python_download_url.split("/")[-1])
|
python_download_url.split("/")[-1])
|
||||||
dockerfile += "\u0009&& cp -r {}/Include/* $BLENDER_PATH/python/include/{}/ \ \n".format(
|
dockerfile += "\u0009&& cp -r {}/Include/* $BLENDER_PATH/python/include/{}/ \\\n".format(
|
||||||
python_download_url.split("/")[-1].split('.tgz')[0],
|
python_download_url.split("/")[-1].split('.tgz')[0],
|
||||||
python_version
|
python_version
|
||||||
)
|
)
|
||||||
dockerfile += "\u0009&& rm -rf {} \ \n".format(
|
dockerfile += "\u0009&& rm -rf {} \\\n".format(
|
||||||
python_download_url.split("/")[-1])
|
python_download_url.split("/")[-1])
|
||||||
dockerfile += "\u0009&& rm -rf {} \n\n".format(
|
dockerfile += "\u0009&& rm -rf {}\n\n".format(
|
||||||
python_download_url.split("/")[-1].split('.tgz')[0])
|
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 += "# 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 {}/python/lib/{}/site-packages/numpy \n\n".format(
|
dockerfile += "RUN rm -rf {}/python/lib/{}/site-packages/numpy\n\n".format(
|
||||||
"${BLENDER_PATH}", python_version)
|
"${BLENDER_PATH}", python_version)
|
||||||
|
|
||||||
dockerfile += "# Must first ensurepip to install Blender pip3 and then new numpy\n"
|
dockerfile += "# Must first ensurepip to install Blender pip3 and then new numpy\n"
|
||||||
|
|
|
@ -244,7 +244,34 @@
|
||||||
"BLENDERPY \"/bin/2.93/python/bin/python3.9\"",
|
"BLENDERPY \"/bin/2.93/python/bin/python3.9\"",
|
||||||
"HW=\"GPU\""
|
"HW=\"GPU\""
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "3.0-cpu-ubuntu18.04",
|
||||||
|
"base_os_image": "ubuntu:18.04",
|
||||||
|
"blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.0/blender-3.0.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/3.0/python/bin/\"",
|
||||||
|
"BLENDER_PATH \"/bin/3.0\"",
|
||||||
|
"BLENDERPIP \"/bin/3.0/python/bin/pip3\"",
|
||||||
|
"BLENDERPY \"/bin/3.0/python/bin/python3.9\"",
|
||||||
|
"HW=\"CPU\""
|
||||||
|
]
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"tag": "3.0-gpu-ubuntu18.04",
|
||||||
|
"base_os_image": "nvidia/cudagl:10.1-base-ubuntu18.04",
|
||||||
|
"blender_download_url": "https://mirror.clarkson.edu/blender/release/Blender3.0/blender-3.0.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/3.0/python/bin/\"",
|
||||||
|
"BLENDER_PATH \"/bin/3.0\"",
|
||||||
|
"BLENDERPIP \"/bin/3.0/python/bin/pip3\"",
|
||||||
|
"BLENDERPY \"/bin/3.0/python/bin/python3.9\"",
|
||||||
|
"HW=\"GPU\""
|
||||||
|
]
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
}
|
||||||
}
|
|
||||||
|
|
Ładowanie…
Reference in New Issue