From 3ee5ae086f0b1d4b4b24e4375f2a25aaec088fe7 Mon Sep 17 00:00:00 2001 From: Jedd Morgan <45512892+JR-Morgan@users.noreply.github.com> Date: Wed, 18 Oct 2023 18:00:39 +0100 Subject: [PATCH] install blender from berkely.edu with extra deps --- Dockerfile | 55 +++++++++++++++++++++++++++++++++++++++++++++----- pyproject.toml | 8 ++++---- 2 files changed, 54 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1ad00d1..9c6d342 100644 --- a/Dockerfile +++ b/Dockerfile @@ -2,12 +2,57 @@ FROM ubuntu:22.04 ENV DEBIAN_FRONTEND=noninteractive -RUN apt update && \ - apt install --no-install-recommends -y tar wget blender python3-pip && \ - pip3 install poetry +RUN \ + echo "**** install packages ****" && \ + apt-get update && \ + apt-get install --no-install-recommends -y \ + libopenexr-dev \ + bzip2 \ + build-essential \ + zlib1g-dev \ + libxmu-dev \ + libxi-dev \ + libxkbcommon-x11-0 \ + libxxf86vm-dev \ + libfontconfig1 \ + libxrender1 \ + libgl1-mesa-glx \ + wget \ + curl \ + python3-pip \ + ocl-icd-libopencl1 \ + xz-utils && \ + ln -s libOpenCL.so.1 /usr/lib/x86_64-linux-gnu/libOpenCL.so && \ + echo "**** install blender ****" && \ + mkdir /blender && \ + if [ -z ${BLENDER_VERSION+x} ]; then \ + BLENDER_VERSION=$(curl -sL https://mirrors.ocf.berkeley.edu/blender/source/ \ + | awk -F'"|/"' '/blender-[0-9]*\.[0-9]*\.[0-9]*\.tar\.xz/ && !/md5sum/ {print $4}' \ + | tail -1 \ + | sed 's|blender-||' \ + | sed 's|\.tar\.xz||'); \ + fi && \ + BLENDER_FOLDER=$(echo "Blender${BLENDER_VERSION}" | sed -r 's|(Blender[0-9]*\.[0-9]*)\.[0-9]*|\1|') && \ + curl -o \ + /tmp/blender.tar.xz -L \ + "https://mirrors.ocf.berkeley.edu/blender/release/${BLENDER_FOLDER}/blender-${BLENDER_VERSION}-linux-x64.tar.xz" && \ + tar xf \ + /tmp/blender.tar.xz -C \ + /blender/ --strip-components=1 && \ + ln -s \ + /blender/blender \ + /usr/bin/blender && \ + echo "**** cleanup ****" && \ + rm -rf \ + /tmp/* \ + /var/lib/apt/lists/* \ + /var/tmp/* + +RUN pip3 install poetry + COPY . . RUN poetry export -f requirements.txt --output requirements.txt && pip install -r requirements.txt && \ - wget -O blender-connector.zip https://releases.speckle.dev/installers/blender/bpy_speckle-2.17.0-alpha2.zip && \ - blender --background --python installation/connector.py + wget -O blender-connector.zip https://releases.speckle.dev/installers/blender/bpy_speckle-2.17.0-alpha2.zip && \ + blender --background --python installation/connector.py \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index 8205e9a..d2931cc 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,10 @@ [tool.poetry] -name = "speckle-automate-py" +name = "blender-automate" version = "0.1.0" -description = "Example function for Speckle Automate using specklepy" -authors = ["Gergő Jedlicska "] +description = "Run Blender renders in Speckle automate to output images" +authors = ["Jedd Morgan ", "Gergő Jedlicska "] readme = "README.md" -packages = [{include = "src/speckle_automate_py"}] +packages = [{include = ""}] [tool.poetry.dependencies] python = "^3.10"