From d5de914225f0ccbe0878273a16c528ac6d67170a Mon Sep 17 00:00:00 2001 From: Ryan Krattiger Date: Mon, 13 Jun 2022 16:37:31 -0500 Subject: [PATCH 1/2] Update sensei CI container for sensei v4.0 integration --- .github/workflows/docker/sensei/Dockerfile | 27 +++++----- .../workflows/docker/sensei/install_deps.sh | 2 +- .../workflows/docker/sensei/install_sensei.sh | 23 ++++---- .../docker/sensei/install_vtk_minimal.sh | 52 ++++++++----------- .../workflows/docker/sensei/vtk_use_mpi.patch | 39 ++++++++++++++ 5 files changed, 90 insertions(+), 53 deletions(-) create mode 100644 .github/workflows/docker/sensei/vtk_use_mpi.patch diff --git a/.github/workflows/docker/sensei/Dockerfile b/.github/workflows/docker/sensei/Dockerfile index 3cb2bec207c..89471d6b7fe 100644 --- a/.github/workflows/docker/sensei/Dockerfile +++ b/.github/workflows/docker/sensei/Dockerfile @@ -1,30 +1,29 @@ -FROM fedora:33 +FROM fedora:35 # Set install root ENV PACKAGE_ROOT=/root/install +COPY tools.sh /root/bin/tools.sh + +# Copy and run the install script +COPY install_deps.sh /root/bin/install_deps.sh +RUN /root/bin/install_deps.sh + # Configure MPI environment ENV MPI_HOME=/usr/lib64/openmpi/ # Configure Python environment -ENV PYTHONPATH=/usr/lib64/python3.9/site-packages/openmpi +ENV PYTHONPATH=/usr/lib64/python3.10/site-packages/openmpi # Configure VTK environment -ENV VTK_VERSION=9.0.1 +ENV VTK_VERSION=9.1.0 ENV VTK_DIR=${PACKAGE_ROOT}/vtk/${VTK_VERSION} - -# Configure Sensei Environment -ENV SENSEI_VERSION=develop -ENV SENSEI_DIR=${PACKAGE_ROOT}/sensei/${SENSEI_VERSION} - -# Copy and run the install script -COPY install_deps.sh /root/bin/install_deps.sh -RUN /root/bin/install_deps.sh - -COPY tools.sh /root/bin/tools.sh - COPY install_vtk_minimal.sh /root/bin/install_vtk.sh +COPY vtk_use_mpi.patch /tmp/vtk_use_mpi.patch RUN /root/bin/install_vtk.sh +# Configure Sensei Environment +ENV SENSEI_VERSION=v4.0.0 +ENV SENSEI_DIR=${PACKAGE_ROOT}/sensei/${SENSEI_VERSION} COPY install_sensei.sh /root/bin/install_sensei.sh RUN /root/bin/install_sensei.sh diff --git a/.github/workflows/docker/sensei/install_deps.sh b/.github/workflows/docker/sensei/install_deps.sh index e59c7f9e2b3..58ee87065c9 100755 --- a/.github/workflows/docker/sensei/install_deps.sh +++ b/.github/workflows/docker/sensei/install_deps.sh @@ -6,7 +6,7 @@ dnf update -y # Development tools dnf install -y --setopt=install_weak_deps=False \ libasan libtsan libubsan clang clang-tools-extra \ - ninja-build cmake git which findutils + ninja-build cmake git which findutils patch # MPI dependencies dnf install -y --setopt=install_weak_deps=False \ diff --git a/.github/workflows/docker/sensei/install_sensei.sh b/.github/workflows/docker/sensei/install_sensei.sh index 96e26bfdf22..5d4cc63e288 100755 --- a/.github/workflows/docker/sensei/install_sensei.sh +++ b/.github/workflows/docker/sensei/install_sensei.sh @@ -1,7 +1,10 @@ #!/bin/bash -DOWNLOAD_ROOT=/root/downloads -EXTRACT_ROOT=/root/downloads/extracted +set -x +set -e + +DOWNLOAD_ROOT=/tmp/downloads +EXTRACT_ROOT=/tmp/downloads/extracted mkdir -p ${DOWNLOAD_ROOT} mkdir -p ${EXTRACT_ROOT} @@ -11,19 +14,21 @@ export CMAKE_GENERATOR=Ninja cd ${DOWNLOAD_ROOT} mkdir sensei cd sensei -git clone https://gitlab.kitware.com/sensei/sensei.git && -cd sensei && -git checkout ${SENSEI_VERSION} && -mkdir build && -cd build && +git clone https://github.com/SENSEI-insitu/sensei.git +cd sensei +git checkout develop +mkdir build +cd build cmake .. \ + -D SENSEI_VERSION=${SENSEI_VERSION} \ -D BUILD_TESTING=OFF \ -D ENABLE_PYTHON=ON \ -D ENABLE_MANDELBROT=OFF \ -D ENABLE_OSCILLATORS=OFF \ + -D ENABLE_VTK_IO=ON \ -D ENABLE_VTK_MPI=ON \ - -D MPI4PY_INCLUDE_DIR=/usr/lib64/python3.9/site-packages/openmpi/mpi4py/include && -cmake --build . && + -D MPI4PY_INCLUDE_DIR=/usr/lib64/python3.10/site-packages/openmpi/mpi4py/include +cmake --build . cmake --install . --prefix ${SENSEI_DIR} rm -rf ${DOWNLOAD_ROOT} diff --git a/.github/workflows/docker/sensei/install_vtk_minimal.sh b/.github/workflows/docker/sensei/install_vtk_minimal.sh index dba03f4259d..8f8db277249 100755 --- a/.github/workflows/docker/sensei/install_vtk_minimal.sh +++ b/.github/workflows/docker/sensei/install_vtk_minimal.sh @@ -1,10 +1,13 @@ #!/bin/bash +set -x +set -e + # Include common build tools . $(dirname ${BASH_SOURCE[0]})/tools.sh -DOWNLOAD_ROOT=/root/downloads -EXTRACT_ROOT=/root/downloads/extracted +DOWNLOAD_ROOT=/tmp/downloads +EXTRACT_ROOT=/tmp/downloads/extracted mkdir -p ${DOWNLOAD_ROOT} mkdir -p ${EXTRACT_ROOT} @@ -13,51 +16,42 @@ export CMAKE_GENERATOR=Ninja export CC=clang export CXX=clang++ +if [[ -z ${VTK_VERSION} ]]; then + VTK_VERSION=9.1.0 +fi + parse_version_env VTK_VERSION curl https://vtk.org/files/release/${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}/VTK-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH}.tar.gz \ --output ${DOWNLOAD_ROOT}/vtk.tar.gz \ --silent extract ${DOWNLOAD_ROOT}/vtk.tar.gz -C ${EXTRACT_ROOT}/vtk -cd ${EXTRACT_ROOT}/vtk/VTK-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH} && -mkdir -p build && -cd build && +cd ${EXTRACT_ROOT}/vtk/VTK-${VTK_VERSION_MAJOR}.${VTK_VERSION_MINOR}.${VTK_VERSION_PATCH} +patch -i /tmp/vtk_use_mpi.patch +mkdir -p build +cd build cmake .. \ -DCMAKE_BUILD_TYPE=Release \ -DVTK_BUILD_EXAMPLES=OFF \ -DVTK_BUILD_TESTING=OFF \ -DVTK_BUILD_DOCUMENTATION=OFF \ -DVTK_BUILD_SHARED_LIBS=ON \ - -DVTK_USE_MPI=ON \ - -DVTK_GROUP_ENABLE_StandAlone=NO \ + -DVTK_GROUP_ENABLE_StandAlone=DONT_WANT \ -DVTK_GROUP_ENABLE_Imaging=NO \ -DVTK_GROUP_ENABLE_Qt=NO \ -DVTK_GROUP_ENABLE_Rendering=NO \ -DVTK_GROUP_ENABLE_Views=NO \ -DVTK_GROUP_ENABLE_Web=NO \ - -DVTK_WRAP_PYTHON=YES \ - -DVTK_PYTHON_VERSION=3 \ - -DVTK_MODULE_ENABLE_VTK_PythonInterpreter=YES \ - -DVTK_MODULE_ENABLE_VTK_WrappingPythonCore=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonDataModel=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonMisc=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonExecutionModel=YES \ - -DVTK_MODULE_ENABLE_VTK_IOParallelNetCDF=NO \ - -DVTK_MODULE_ENABLE_VTK_IOMPIParallel=NO \ - -DVTK_MODULE_ENABLE_VTK_IOMPIImage=NO \ - -DVTK_MODULE_ENABLE_VTK_FiltersParallelVerdict=NO \ - -DVTK_MODULE_ENABLE_VTK_FiltersParallelGeometry=NO \ - -DVTK_MODULE_ENABLE_VTK_DomainsParallelChemistry=NO \ - -DVTK_MODULE_ENABLE_VTK_FiltersParallelMPI=NO \ - -DVTK_MODULE_ENABLE_VTK_ParallelCore=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonSystem=YES \ - -DVTK_MODULE_ENABLE_VTK_IOLegacy=YES \ - -DVTK_MODULE_ENABLE_VTK_IOCore=YES \ - -DVTK_MODULE_ENABLE_VTK_IOXMLParser=YES \ + -DVTK_GROUP_ENABLE_MPI=DONT_WANT \ + -DVTK_USE_MPI=ON \ + -DVTK_MODULE_ENABLE_VTK_ParallelMPI=YES \ + -DVTK_MODULE_ENABLE_VTK_IOParallelXML=YES \ -DVTK_MODULE_ENABLE_VTK_IOXML=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonMath=YES \ - -DVTK_MODULE_ENABLE_VTK_CommonTransforms=YES && -cmake --build . && + -DVTK_MODULE_ENABLE_VTK_IOLegacy=YES \ + -DVTK_ENABLE_KITS=OFF \ + -DVTK_WRAP_PYTHON=YES \ + -DVTK_PYTHON_VERSION=3 +cmake --build . cmake --install . --prefix ${VTK_DIR} rm -rf ${DOWNLOAD_ROOT} diff --git a/.github/workflows/docker/sensei/vtk_use_mpi.patch b/.github/workflows/docker/sensei/vtk_use_mpi.patch new file mode 100644 index 00000000000..641667a3fa8 --- /dev/null +++ b/.github/workflows/docker/sensei/vtk_use_mpi.patch @@ -0,0 +1,39 @@ +diff --git a/CMakeLists.txt b/CMakeLists.txt +index a9d56e765c..6ce9d80cb2 100644 +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -178,10 +178,18 @@ set("_vtk_module_reason_VTK::Java" + "via `VTK_WRAP_JAVA`") + # For vtkTkRenderWidget (only useful with Python, since WRAP_TCL is gone) + if (VTK_USE_TK) +- set(VTK_GROUP_ENABLE_Tk YES) ++ if (VTK_GROUP_ENABLE_Tk STREQUAL "DEFAULT") ++ set(VTK_GROUP_ENABLE_Tk "WANT") ++ elseif (VTK_GROUP_ENABLE_Tk STREQUAL "NO") ++ message(FATAL_ERROR "VTK_USE_TK=ON is not compatible with VTK_GROUP_ENABLE_Tk=NO") ++ endif () + endif () + if (VTK_USE_MPI) +- set(VTK_GROUP_ENABLE_MPI YES) ++ if (VTK_GROUP_ENABLE_MPI STREQUAL "DEFAULT") ++ set(VTK_GROUP_ENABLE_MPI "WANT") ++ elseif (VTK_GROUP_ENABLE_MPI STREQUAL "NO") ++ message(FATAL_ERROR "VTK_USE_MPI=ON is not compatible with VTK_GROUP_ENABLE_MPI=NO") ++ endif () + else () + # Reject `VTK::mpi`, but allow those which happen to be part of the group to + # be built. +diff --git a/Documentation/release/dev/change-vtk-use-mpi-tk-behavior.md b/Documentation/release/dev/change-vtk-use-mpi-tk-behavior.md +new file mode 100644 +index 0000000000..4a59b225b0 +--- /dev/null ++++ b/Documentation/release/dev/change-vtk-use-mpi-tk-behavior.md +@@ -0,0 +1,8 @@ ++## `VTK_USE_MPI`/`VTK_USE_TK` are less aggresive ++ ++The configure option `VTK_USE_MPI` and `VTK_USE_TK` no longer forces their ++respective Groups on. They will now either change the default to `WANT` or use ++the specified value for `VTK_GROUP_ENABLE_{MPI,Tk}`. ++ ++There is now an explicit error when either `VTK_USE_{MPI,TK}` is `ON` but the ++respective group is configured as `NO`. From 58f9dbcc817106fa9878a2d74a58764e771fc3e6 Mon Sep 17 00:00:00 2001 From: Ryan Krattiger Date: Mon, 13 Jun 2022 16:42:49 -0500 Subject: [PATCH 2/2] Add simple script for building and pushing sensei container --- .github/workflows/docker/sensei/build-container.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 .github/workflows/docker/sensei/build-container.sh diff --git a/.github/workflows/docker/sensei/build-container.sh b/.github/workflows/docker/sensei/build-container.sh new file mode 100644 index 00000000000..dab1ec9eb75 --- /dev/null +++ b/.github/workflows/docker/sensei/build-container.sh @@ -0,0 +1,3 @@ +image_name=senseiinsitu/ci:fedora35-amrex-$(date +%Y%m%d) +docker build --tag $image_name . +docker push $image_name