|
|
|
# ---------------------------------*-sh-*------------------------------------
|
|
|
|
# Copyright (C) 2021 OpenCFD Ltd.
|
|
|
|
# SPDX-License-Identifier: (GPL-3.0+)
|
|
|
|
#
|
|
|
|
# Example commands for creating a sideloaded deployment on
|
|
|
|
# redhat/ubi image. Not scripted
|
|
|
|
#
|
|
|
|
# Resources
|
|
|
|
#
|
|
|
|
# https://develop.openfoam.com/Development/openfoam/-/wikis/packaging/common/create-tar.sh
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Before starting
|
|
|
|
# ===============
|
|
|
|
#
|
|
|
|
# - Need a build image (eg, build_ubifake.Dockerfile)
|
|
|
|
# - Create build location on local machine. For example,
|
|
|
|
|
|
|
|
mkdir -p build-root/deploy
|
|
|
|
mkdir -p build-root/fetch
|
|
|
|
mkdir -p build-root/scratch
|
|
|
|
|
|
|
|
# fetch : where we will stage the original tar files
|
|
|
|
# deploy : the final contents to deploy to the image
|
|
|
|
# scratch : local build space
|
|
|
|
|
|
|
|
|
|
|
|
# Fetching
|
|
|
|
# ========
|
|
|
|
#
|
|
|
|
# - Use tar files from https://dl.openfoam.com/source/latest/
|
|
|
|
# or create-tar.sh script (wiki) to fetch from git with modules etc.
|
|
|
|
#
|
|
|
|
# - unpack with the usual names in the _scratch_ directory. Eg,
|
|
|
|
#
|
|
|
|
# scratch/OpenFOAM-v2106
|
|
|
|
# scratch/ThirdParty-v2106
|
|
|
|
|
|
|
|
|
|
|
|
# Configure
|
|
|
|
# =========
|
|
|
|
#
|
|
|
|
# We want to all configurations known and modifiable in a transparent way.
|
|
|
|
# Within the OpenFOAM directory:
|
|
|
|
#
|
|
|
|
# mkdir etc-ubi8/config.sh
|
|
|
|
#
|
|
|
|
# Make all changes there (eg, prefs.openmpi, prefs.intelmpi ...)
|
|
|
|
# Refer to these preferences in the <etc/prefs.sh> file. For example,
|
|
|
|
#
|
|
|
|
# export FOAM_CONFIG_ETC=etc-ubi8
|
|
|
|
# export WM_MPLIB=INTELMPI
|
|
|
|
|
|
|
|
|
|
|
|
# Build
|
|
|
|
# =====
|
|
|
|
#
|
|
|
|
# - Mount the local directory within the build image.
|
|
|
|
# - Source the etc/bashrc and build OpenFOAM/ThirdParty
|
|
|
|
|
|
|
|
openfoam-chroot -dist=ubi8
|
|
|
|
|
|
|
|
# OR
|
|
|
|
openfoam-chroot -image=ubi8-build-openfoam
|
|
|
|
|
|
|
|
|
|
|
|
# Prepare for deployment
|
|
|
|
# ======================
|
|
|
|
#
|
|
|
|
# Stage all of the desired build artifacts in the deploy/ directory.
|
|
|
|
#
|
|
|
|
# For example,
|
|
|
|
|
|
|
|
mkdir -p deploy/ThirdParty
|
|
|
|
|
|
|
|
rsync --exclude .git --exclude build -aP scratch/OpenFOAM-v2106/ deploy/
|
|
|
|
|
|
|
|
rsync --exclude .git -aP scratch/ThirdParty-v2106/platforms deploy/ThirdParty
|
|
|
|
|
|
|
|
|
|
|
|
# NOTE any ThirdParty items are to be located in the ThirdParty
|
|
|
|
# *within* the OpenFOAM directory hierarchy. This ensures simpler and
|
|
|
|
# more reliable deployment.
|
|
|
|
#
|
|
|
|
# After this stage, the contents of deploy/ will resemble this:
|
|
|
|
|
|
|
|
CONTRIBUTORS.md
|
|
|
|
COPYING
|
|
|
|
META-INFO/
|
|
|
|
README.md
|
|
|
|
ThirdParty/
|
|
|
|
applications/
|
|
|
|
bin/
|
|
|
|
etc/
|
|
|
|
etc-ubi8/
|
|
|
|
platforms/
|
|
|
|
src/
|
|
|
|
wmake/
|
|
|
|
|
|
|
|
|
|
|
|
# Create deployment asset
|
|
|
|
# =======================
|
|
|
|
#
|
|
|
|
# For convenience the deployment asset will normally be stored under
|
|
|
|
# /openfoam/openfoam<version> on the image. Create the deployment tar
|
|
|
|
# file accordingly. For example,
|
|
|
|
|
|
|
|
tar --transform 's#^deploy/#openfoam2106/#' -cf deploy.tar deploy/
|
|
|
|
|
|
|
|
|
|
|
|
# Final deployment
|
|
|
|
# ================
|
|
|
|
#
|
|
|
|
# - Use the deploy_ubi.Dockerfile
|
|
|
|
|
|
|
|
# ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
# Additional Notes
|
|
|
|
# ================
|
|
|
|
|
|
|
|
Supporting multiple MPI vendors is quite simple and fairly lightweight.
|
|
|
|
|
|
|
|
- need an MPI-specific compilation of pt-scotch.
|
|
|
|
This takes the most amount of time, but is still fairly quick.
|
|
|
|
|
|
|
|
- recompile the Pstream library: src/Pstream/Allwmake-mpi
|
|
|
|
|
|
|
|
- recompile the ptscotch interface: src/parallel/decompose/Allwmake-mpi
|
|
|
|
|
|
|
|
|
|
|
|
# --------------------------------------------------------------------------- |