Skip to content

Commit

Permalink
Docker build fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
boberfly committed Sep 15, 2020
1 parent a132a00 commit a1f2ce6
Show file tree
Hide file tree
Showing 5 changed files with 128 additions and 82 deletions.
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
*
# And then explicitly include just what we want
!build.py
!NVIDIA-OptiX-SDK-7.0.0-linux64.sh
!NVIDIA-OptiX-SDK-7.0.0-linux64.sh
!NVIDIA-OptiX-SDK-7.1.0-linux64-x86_64.sh
197 changes: 120 additions & 77 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,84 +2,127 @@
# production, and meets the glibc requirements of VFXPlatform 2018
# (2.17 or lower).

FROM centos:7

# Make GCC 6.3.1 the default compiler, as per VFXPlatform 2018

RUN yum install -y centos-release-scl
RUN yum install -y devtoolset-6

# Install CMake, SCons, and other miscellaneous build tools.
# We install SCons via `pip install --egg` rather than by
# `yum install` because this prevents a Cortex build failure
# caused by SCons picking up the wrong Python version and being
# unable to find its own modules.

RUN yum install -y epel-release

RUN yum install -y cmake3
RUN ln -s /usr/bin/cmake3 /usr/bin/cmake

RUN yum install -y python2-pip.noarch
RUN pip install --egg scons

RUN yum install -y patch
RUN yum install -y doxygen

# Install boost dependencies (needed by boost::iostreams)

RUN yum install -y bzip2-devel

# Install JPEG dependencies

RUN yum install -y nasm

# Install PNG dependencies

RUN yum install -y zlib-devel

# Install GLEW dependencies

RUN yum install -y libX11-devel
RUN yum install -y mesa-libGL-devel
RUN yum install -y mesa-libGLU-devel
RUN yum install -y libXmu-devel
RUN yum install -y libXi-devel

# Install OSL dependencies

RUN yum install -y flex
RUN yum install -y bison

# Install Qt dependencies

RUN yum install -y xkeyboard-config.noarch
RUN yum install -y fontconfig-devel.x86_64

FROM centos:7.6.1810

# As we don't want to inadvertently grab newer versions of our yum-installed
# packages, we use yum-versionlock to keep them pinned. We track the list of
# image packages here, then compare after our install steps to see what was
# added, and only lock those. This saves us storing redundant entires for
# packages installed in the base image.

# To unlock versions, just make sure yum-versionlock.list is empty in the repo
#COPY versionlock.sh ./
#COPY yum-versionlock.list /etc/yum/pluginconf.d/versionlock.list

#RUN yum install -y yum-versionlock && \
# ./versionlock.sh list-installed /tmp/packages && \
#
#
# NOTE: If you add a new yum package here, make sure you update the version
# lock files as follows and commit the changes to yum-versionlock.list:
#
# ./build-docker.py --update-package-versions --new-only
#
# We have to install scl as a separate yum command for some reason
# otherwise we get `scl not found` errors...
#
RUN yum install -y centos-release-scl && \
sed -i 's/7/7.6.1810/g; s|^#\s*\(baseurl=http://\)mirror|\1vault|g; /mirrorlist/d' /etc/yum.repos.d/CentOS-SCLo-*.repo && \
yum install -y devtoolset-6 && \
#
# Install CMake, SCons, and other miscellaneous build tools.
# We install SCons via `pip install --egg` rather than by
# `yum install` because this prevents a Cortex build failure
# caused by SCons picking up the wrong Python version and being
# unable to find its own modules.
#
yum install -y epel-release && \
#
yum install -y cmake3 && \
ln -s /usr/bin/cmake3 /usr/bin/cmake && \
#
yum install -y python2-pip.noarch && \
pip install --egg scons==3.0.5 && \
#
yum install -y \
git \
patch \
doxygen && \
#
# Install boost dependencies (needed by boost::iostreams)
#
yum install -y bzip2-devel && \
#
# Install JPEG dependencies
#
yum install -y nasm && \
#
# Install PNG dependencies && \
#
yum install -y zlib-devel && \
#
# Install GLEW dependencies
#
yum install -y \
libX11-devel \
mesa-libGL-devel \
mesa-libGLU-devel \
libXmu-devel \
libXi-devel && \
#
# Install OSL dependencies
#
yum install -y \
flex \
bison && \
#
# Install Qt dependencies
#
yum install -y \
xkeyboard-config.noarch \
fontconfig-devel.x86_64 && \
#
# Install Appleseed dependencies
#
yum install -y \
lz4 lz4-devel
#
# Install packages needed to generate the
# Gaffer documentation. Note that we are
# limited to Sphinx 1.4 because recommonmark
# is incompatible with later versions. And
# we are limited to docutils 0.12 because
# Sphinx 1.4 is incompatible with later
# versions.

RUN yum install -y xorg-x11-server-Xvfb
RUN yum install -y mesa-dri-drivers.x86_64
RUN yum install -y metacity
RUN yum install -y gnome-themes-standard

RUN pip install sphinx==1.4 sphinx_rtd_theme recommonmark
RUN pip install docutils==0.12

RUN yum install -y inkscape

RUN yum install -y wget

# Gaffer documentation.

#RUN yum install -y \
# xorg-x11-server-Xvfb \
# mesa-dri-drivers.x86_64 \
# metacity \
# gnome-themes-standard && \
# Note: When updating these, also update gaffer/config/azure/build.yaml
# pip install \
# sphinx==1.8.0 \
# sphinx_rtd_theme==0.4.3 \
# recommonmark==0.5.0 \
# docutils==0.12 && \
#
# yum install -y inkscape

# Now we've installed all our packages, update yum-versionlock for all the
# new packages so we can copy the versionlock.list out of the container when we
# want to update the build env.
# If there were already locks in the list from the source checkout then the
# correct version will already be installed and we just ignore this...
# ./versionlock.sh lock-new /tmp/packages

RUN yum install -y wget && \
#
#
# CUDA 11.0

RUN wget -O cuda.rpm https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda-repo-rhel7-11-0-local-11.0.3_450.51.06-1.x86_64.rpm --progress=dot:mega \
&& rpm -i cuda.rpm && yum install -y cuda && rm cuda.rpm
#
wget -O cuda.rpm https://developer.download.nvidia.com/compute/cuda/11.0.3/local_installers/cuda-repo-rhel7-11-0-local-11.0.3_450.51.06-1.x86_64.rpm --progress=dot:mega \
&& rpm -i cuda.rpm && yum install -y cuda && rm cuda.rpm && \
#
# ISPC 1.14
#
wget -O ispc.tar.gz https://github.com/ispc/ispc/releases/download/v1.14.1/ispc-v1.14.1-linux.tar.gz -- \
&& mkdir /ispc && tar xf ispc.tar.gz -C /ispc --strip-components=1 && mv /ispc/bin/ispc /usr/bin/ispc && rm -rf /ispc

# OptiX 7.1.0

Expand All @@ -91,4 +134,4 @@ RUN mkdir /optix && ./NVIDIA-OptiX-SDK-7.1.0-linux64-x86_64.sh --skip-license --

COPY build.py ./

ENTRYPOINT [ "scl", "enable", "devtoolset-6", "--", "bash" ]
ENTRYPOINT [ "scl", "enable", "devtoolset-6", "--", "bash" ]
6 changes: 3 additions & 3 deletions build.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@

parser.add_argument(
"--gafferVersion",
default = "0.57.4.0",
default = "0.58.1.0",
help = "The version of Gaffer to build against. "
)

Expand Down Expand Up @@ -334,7 +334,6 @@ def releaseId() :
"include/*",
"lib/*.cubin",
"lib/*.ptx",
"lib/libosdCPU*",
"lib/libGafferCycles*",
"license/*",
"python/*",
Expand All @@ -350,7 +349,8 @@ def releaseId() :
"./build/build.py --project Gflags --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx} && "
"./build/build.py --project Glog --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx} && "
"./build/build.py --project Embree --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx} && "
"./build/build.py --project OpenSubdiv --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx}".format(
"./build/build.py --project OpenSubdiv --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx} && "
"./build/build.py --project OpenImageDenoise --gafferRoot {gafferRoot} --buildDir {gafferCyclesRoot}/install/{platform}_{buildType} --forceCxxCompiler {cxx}".format(
gafferCyclesRoot=gafferCyclesDirName, gafferRoot=gafferDirName, **formatVariables ),
]

Expand Down
2 changes: 1 addition & 1 deletion cycles
2 changes: 2 additions & 0 deletions dependencies/OpenSubdiv/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@
" -D NO_GLFW=1"
" -D NO_GLFW_X11=1"
" -D GLEW_LOCATION={gafferRoot}"
" -D BUILD_SHARED_LIBS=0"
" -D NO_TBB=0"
" ..",
"cd gafferBuild && cmake --build . --config {cmakeBuildType} --target install",

Expand Down

0 comments on commit a1f2ce6

Please sign in to comment.