Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update sensei CI container for sensei v4.0 integration #2834

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions .github/workflows/docker/sensei/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .github/workflows/docker/sensei/build-container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
image_name=senseiinsitu/ci:fedora35-amrex-$(date +%Y%m%d)
docker build --tag $image_name .
docker push $image_name
2 changes: 1 addition & 1 deletion .github/workflows/docker/sensei/install_deps.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down
23 changes: 14 additions & 9 deletions .github/workflows/docker/sensei/install_sensei.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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
Copy link
Contributor

@burlen burlen Jun 23, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwryankrattiger We want this to be pinned to an official release so that the usual churn that occurs during sensei development doesn't break amrex builds.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That wasn't possible at the time because the tagged release had a couple bugs in it that had to be fixed for this container to be built and work correctly in CI. The container that is used in CI is static, ie. this is not run each time CI is run, only when the container is rebuilt. The develop that was used to generate the container for amrex CI is the develop branch on 2022-06-13 which is denoted by the container name I pushed and referenced in the other PR for SENSEI updates. I agree it would be more ideal to use a tagged version, if you wanted to tag a new patch version of sensei, v4.0.1, I would be happy to update this and regenerate an image using the tagged version, I think most of the build/install issues have been fleshed out on develop now so that may be worthwhile anyway.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. the container is static so this is not going to run against future changes. Sorry, I misunderstood the situation.

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}
Expand Down
52 changes: 23 additions & 29 deletions .github/workflows/docker/sensei/install_vtk_minimal.sh
Original file line number Diff line number Diff line change
@@ -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}

Expand All @@ -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}
Expand Down
39 changes: 39 additions & 0 deletions .github/workflows/docker/sensei/vtk_use_mpi.patch
Original file line number Diff line number Diff line change
@@ -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`.