Commit 85437f35 authored by Scott Wittenburg's avatar Scott Wittenburg
Browse files

Add a Dockerfile for building ParaView in an Ubuntu 18.04 container

parent ec4be36e
#
# To build this image and run it with a shell, first change into the directory
# where this Dockerfile lives, then:
#
# sudo docker build -t pv-v5.6.0-egl .
#
# Or, to choose a different version:
#
# sudo docker build --build-arg PARAVIEW_TAG=master --build-arg SUPERBUILD_TAG=master -t pv-master-egl .
#
# Run the image with bash to look around:
#
# sudo docker run --runtime=nvidia -ti pv-v5.6.0-egl bash
#
#
# Build options
#
# BASE_IMAGE
#
# nvidia/opengl:1.0-glvnd-devel-ubuntu18.04
# ubuntu:18.04
#
# RENDERING
#
# egl
# osmesa
#
# PARAVIEW_TAG
#
# "master", "v5.6.0", <branch-name>, etc...
#
# SUPERBUILD_REPO
#
# allows cloning from a fork
#
# SUPERBUILD_TAG
#
# "master", "v5.6.0", <branch-name>, etc...
#
ARG BASE_IMAGE=nvidia/opengl:1.0-glvnd-devel-ubuntu16.04
FROM ${BASE_IMAGE}
ARG RENDERING=egl
ARG PARAVIEW_TAG=v5.6.0
ARG SUPERBUILD_TAG=v5.6.0
ARG SUPERBUILD_REPO=https://gitlab.kitware.com/paraview/paraview-superbuild.git
RUN apt-get update && apt-get install -y --no-install-recommends \
autoconf \
automake \
build-essential \
ca-certificates \
chrpath \
curl \
gfortran \
git \
libtool \
openssl \
python2.7-dev \
python-pip \
python-setuptools \
pkg-config && \
rm -rf /var/lib/apt/lists/* && \
pip install mako
# Create a non-root user
RUN groupadd pv-user && \
useradd -g pv-user -d /home/pv-user pv-user && \
mkdir /home/pv-user && chown -R pv-user:pv-user /home/pv-user && \
mkdir -p /opt/paraview && chown -R pv-user:pv-user /opt/paraview
USER pv-user
# Get CMake, then clone the ParaView superbuild project
RUN mkdir -p /home/pv-user/cmake/3.13.4 && cd /home/pv-user/cmake/3.13.4 && \
curl -L https://cmake.org/files/v3.13/cmake-3.13.4-Linux-x86_64.tar.gz | tar --strip-components=1 -xzv && \
mkdir -p /home/pv-user/pvsb && cd /home/pv-user/pvsb && \
git clone --recursive ${SUPERBUILD_REPO} src && \
cd src && git checkout ${SUPERBUILD_TAG} && git submodule update && cd .. && \
mkdir build && cd build && \
/home/pv-user/cmake/3.13.4/bin/cmake -C /home/pv-user/pvsb/src/cmake/sites/Docker-Ubuntu-18_04.cmake "-GUnix Makefiles" ../src && \
make -j"$(nproc)" install && \
rm -rf /home/pv-user/pvsb && rm -rf /home/pv-user/cmake
WORKDIR /opt/paraview
#!/bin/bash
# Simple build, choosing defaults for all options:
docker build --rm -t pv-v5.6.0-egl .
# Build version 5.6.0 w/ EGL:
# docker build --rm \
# --build-arg BASE_IMAGE="nvidia/opengl:1.0-glvnd-devel-ubuntu18.04" \
# --build-arg RENDERING="egl" \
# --build-arg SUPERBUILD_REPO="https://gitlab.kitware.com/scott.wittenburg/paraview-superbuild.git" \
# --build-arg SUPERBUILD_TAG="add-dockerfile-and-build-script" \
# --build-arg PARAVIEW_TAG=v5.6.0 \
# -t pv-v5.6.0-egl \
# .
# Build version 5.6.0 w/ OSMesa:
# docker build --rm \
# --build-arg BASE_IMAGE="ubuntu:18.04" \
# --build-arg RENDERING="osmesa" \
# --build-arg SUPERBUILD_REPO="https://gitlab.kitware.com/scott.wittenburg/paraview-superbuild.git" \
# --build-arg SUPERBUILD_TAG="add-dockerfile-and-build-script" \
# --build-arg PARAVIEW_TAG=v5.6.0 \
# -t pv-v5.6.0-osmesa \
# .
#!/bin/bash
# docker login (+ enter username and password)
docker tag pv-v5.6.0-egl kitware/paraviewweb:pv-v5.6.0-egl
docker push kitware/paraviewweb:pv-v5.6.0-egl
#!/bin/bash
# If you want to run the OSMesa version, no runtime arg is needed:
docker run --rm -ti pv-v5.6.0-osmesa
# Or if you have nvidia-docker2 installed and want to run the egl version:
# docker run --rm --runtime=nvidia -ti pv-v5.6.0-egl
# Where should ParaView get installed
set(CMAKE_INSTALL_PREFIX "/opt/paraview" CACHE PATH "")
# Where will superbuild download its source tarballs
set(superbuild_download_location "/home/pv-user/pvsb/downloads" CACHE PATH "")
# How do we get ParaView
message("Using paraview git tag: $ENV{PARAVIEW_TAG}")
set(paraview_FROM_GIT ON CACHE BOOL "")
set(paraview_GIT_TAG $ENV{PARAVIEW_TAG} CACHE STRING "")
set(paraview_SOURCE_SELECTION git CACHE STRING "")
# Build w/ either egl or osmesa
if("$ENV{RENDERING}" STREQUAL "egl")
message('Builing with EGL rendering')
set(ENABLE_egl ON CACHE BOOL "")
set(USE_SYSTEM_egl ON CACHE BOOL "")
set(EGL_INCLUDE_DIR "/usr/include" CACHE PATH "")
set(EGL_LIBRARY "/usr/lib/x86_64-linux-gnu/libEGL.so" CACHE FILEPATH "")
set(EGL_gldispatch_LIBRARY "/usr/lib/x86_64-linux-gnu/libGLdispatch.so" CACHE FILEPATH "")
set(EGL_opengl_LIBRARY "/usr/lib/x86_64-linux-gnu/libOpenGL.so" CACHE FILEPATH "")
# If we're going to have support for EGL, index would be nice too
set(ENABLE_nvidiaindex OFF CACHE BOOL "")
else()
message('Builing with OSMESA rendering')
set(ENABLE_osmesa ON CACHE BOOL "")
set(mesa_USE_SWR ON CACHE BOOL "")
endif()
# General rendering/graphics options
set(ENABLE_mesa OFF CACHE BOOL "")
set(PARAVIEW_DEFAULT_SYSTEM_GL OFF CACHE BOOL "")
# Some general options
set(BUILD_SHARED_LIBS ON CACHE BOOL "")
set(CMAKE_BUILD_TYPE Release CACHE STRING "")
set(BUILD_TESTING ON CACHE BOOL "")
# ParaView related
set(ENABLE_paraview ON CACHE BOOL "")
set(ENABLE_paraviewweb ON CACHE BOOL "")
set(ENABLE_paraviewgettingstartedguide OFF CACHE BOOL "")
set(ENABLE_paraviewtutorial OFF CACHE BOOL "")
set(ENABLE_paraviewusersguide OFF CACHE BOOL "")
set(ENABLE_paraviewtutorialdata OFF CACHE BOOL "")
# Python related
set(ENABLE_python ON CACHE BOOL "")
set(USE_SYSTEM_python ON CACHE BOOL "")
set(USE_SYSTEM_pythonsetuptools ON CACHE BOOL "")
set(ENABLE_matplotlib ON CACHE BOOL "")
set(ENABLE_scipy ON CACHE BOOL "")
# VTK-m related
set(ENABLE_vtkm ON CACHE BOOL "")
set(vtkm_SOURCE_SELECTION for-git CACHE STRING "")
# Disable Qt5 stuff
set(ENABLE_qt5 OFF CACHE BOOL "")
set(USE_SYSTEM_qt5 OFF CACHE BOOL "")
# Other options
set(ENABLE_ospray ON CACHE BOOL "")
set(ENABLE_netcdf OFF CACHE BOOL "")
set(ENABLE_hdf5 ON CACHE BOOL "")
set(ENABLE_szip ON CACHE BOOL "")
set(ENABLE_visitbridge ON CACHE BOOL "")
set(ENABLE_ffmpeg ON CACHE BOOL "")
set(ENABLE_vistrails ON CACHE BOOL "")
set(ENABLE_mpi ON CACHE BOOL "")
set(ENABLE_silo ON CACHE BOOL "")
set(ENABLE_xdmf3 ON CACHE BOOL "")
set(ENABLE_h5py ON CACHE BOOL "")
set(ENABLE_numpy ON CACHE BOOL "")
set(ENABLE_cosmotools ON CACHE BOOL "")
set(DIY_SKIP_SVN ON CACHE BOOL "")
set(ENABLE_glu ON CACHE BOOL "")
set(ENABLE_tbb ON CACHE BOOL "")
set(ENABLE_boost ON CACHE BOOL "")
set(ENABLE_vortexfinder2 OFF CACHE BOOL "")
set(USE_NONFREE_COMPONENTS ON CACHE BOOL "")
set(ENABLE_las ON CACHE BOOL "")
set(ENABLE_acusolve ON CACHE BOOL "")
set(ENABLE_fontconfig ON CACHE BOOL "")
# FIXME: We should be able to have these, but they didn't work at some point
set(ENABLE_vrpn OFF CACHE BOOL "")
set(ENABLE_boxlib OFF CACHE BOOL "")
set(CTEST_USE_LAUNCHERS TRUE CACHE BOOL "")
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment