Skip to content

Commit

Permalink
Merge pull request #60 from Chaste/new-ubuntu-images
Browse files Browse the repository at this point in the history
Docker runners for new Ubuntus
  • Loading branch information
kwabenantim authored Dec 8, 2023
2 parents c4a8b43 + 25762c6 commit dfbfc77
Show file tree
Hide file tree
Showing 9 changed files with 478 additions and 4 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/docker-portability-system.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: docker-portability-system

on:
workflow_dispatch:
inputs:
ubuntu_release:
description: 'Ubuntu release'
required: true
type: string
default: 'mantic'

jobs:
docker:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
include:
- tags: |
chaste/runner:${{ github.event.inputs.ubuntu_release }}.portability-system
build-args: |
BASE=${{ github.event.inputs.ubuntu_release }}
XSD=system
XERCESC=system
SUNDIALS=system
BOOST=system
VTK=system
PETSC=system
HDF5=system
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and export to Docker
uses: docker/build-push-action@v4
with:
context: .
pull: true
load: true
tags: ${{ matrix.tags }}
build-args: ${{ matrix.build-args }}

- name: Test image
run: |
tags=( ${{ matrix.tags }} )
for tag in "${tags[@]}"; do
docker run --rm --entrypoint /bin/bash ${tag}
done
- name: Build and push
uses: docker/build-push-action@v4
with:
context: .
pull: true
push: true
tags: ${{ matrix.tags }}
build-args: ${{ matrix.build-args }}
49 changes: 49 additions & 0 deletions scripts/install_boost.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,55 @@ if [ -z "${base_dir}" ]; then usage; fi

parallel="${parallel:-$(nproc)}"

# Modulefile pointing to system version
if [ "$version" = "system" ]; then
version=$(dpkg -s libboost-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3)

mkdir -p ${base_dir}/modulefiles/boost && cd ${base_dir}/modulefiles/boost
cat <<EOF > ${version}
#%Module1.0#####################################################################
###
## boost ${version} modulefile
##
proc ModulesTest { } {
set paths "[getenv BOOST_ROOT]
[getenv BOOST_ROOT]/lib
[getenv BOOST_ROOT]/include"
foreach path \$paths {
if { ![file exists \$path] } {
puts stderr "ERROR: Does not exist: \$path"
return 0
}
}
return 1
}
proc ModulesHelp { } {
puts stderr "\tThis adds the environment variables for boost ${version}\n"
}
module-whatis "This adds the environment variables for boost ${version}"
setenv BOOST_ROOT /usr
setenv BOOST_INCLUDEDIR /usr/include/boost
setenv BOOST_LIBRARYDIR /usr/lib/x86_64-linux-gnu
prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu
prepend-path INCLUDE /usr/include/boost
prepend-path C_INCLUDE_PATH /usr/include/boost
prepend-path CPLUS_INCLUDE_PATH /usr/include/boost
prepend-path CMAKE_PREFIX_PATH /usr
conflict boost
EOF
exit 0
fi

version_arr=(${version//\./ })
major=${version_arr[0]}
minor=${version_arr[1]}
Expand Down
76 changes: 75 additions & 1 deletion scripts/install_petsc_hdf5.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,84 @@ if [ -z "${base_dir}" ]; then usage; fi
parallel="${parallel:-$(nproc)}"

if [[ ! (${petsc_arch} = 'linux-gnu'
|| ${petsc_arch} = 'linux-gnu-opt') ]]; then
|| ${petsc_arch} = 'linux-gnu-opt'
|| ${petsc_arch} = 'system') ]]; then
usage
fi

# Modulefile pointing to system version
if [[ ("$petsc_version" = "system")
|| ("$hdf5_version" = "system")
|| ("$petsc_arch" = "system") ]]; then
petsc_version=$(dpkg -s libpetsc-real-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1)
hdf5_version=$(dpkg -s libhdf5-openmpi-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1)

mkdir -p ${base_dir}/modulefiles/petsc_hdf5/${petsc_version}_${hdf5_version}
cd ${base_dir}/modulefiles/petsc_hdf5/${petsc_version}_${hdf5_version}
cat <<EOF > ${petsc_arch}
#%Module1.0#####################################################################
###
## petsc_hdf5 ${petsc_version}_${hdf5_version}/${petsc_arch} modulefile
##
proc ModulesTest { } {
set paths "[getenv PETSC_DIR]
[getenv PETSC_DIR]/[getenv PETSC_ARCH]
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/bin
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/bin/h5pcc
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/include
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib/libhdf5.so
[getenv PETSC_DIR]/[getenv PETSC_ARCH]/lib/libpetsc.so"
foreach path \$paths {
if { ![file exists \$path] } {
puts stderr "ERROR: Does not exist: \$path"
return 0
}
}
return 1
}
proc ModulesHelp { } {
puts stderr "\tThis adds the environment variables for petsc ${petsc_version} and hdf5 ${hdf5_version}, with PETSC_ARCH=${petsc_arch}\n"
}
module-whatis "This adds the environment variables for petsc ${petsc_version} and hdf5 ${hdf5_version}, with PETSC_ARCH=${petsc_arch}"
setenv PETSC_DIR ""
setenv PETSC_ARCH ""
prepend-path PATH /usr/bin
prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu
prepend-path INCLUDE /usr/include/petsc
prepend-path C_INCLUDE_PATH /usr/include/petsc
prepend-path CPLUS_INCLUDE_PATH /usr/include/petsc
prepend-path CMAKE_PREFIX_PATH /usr/
setenv HDF5_ROOT /usr/
prepend-path INCLUDE /usr/include/hdf5
prepend-path C_INCLUDE_PATH /usr/include/hdf5
prepend-path CPLUS_INCLUDE_PATH /usr/include/hdf5
setenv PARMETIS_ROOT /usr/
prepend-path INCLUDE /usr/include
prepend-path C_INCLUDE_PATH /usr/include
prepend-path CPLUS_INCLUDE_PATH /usr/include
conflict petsc
conflict hdf5
conflict petsc_hdf5
EOF
exit 0
fi

petsc_version_arr=(${petsc_version//\./ })
petsc_major=${petsc_version_arr[0]}
petsc_minor=${petsc_version_arr[1]}
Expand Down
47 changes: 47 additions & 0 deletions scripts/install_sundials.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,53 @@ if [ -z "${base_dir}" ]; then usage; fi

parallel="${parallel:-$(nproc)}"

# Modulefile pointing to system version
if [ "$version" = "system" ]; then
version=$(dpkg -s libsundials-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1)

mkdir -p ${base_dir}/modulefiles/sundials && cd ${base_dir}/modulefiles/sundials
cat <<EOF > ${version}
#%Module1.0#####################################################################
###
## sundials ${version} modulefile
##
proc ModulesTest { } {
set paths "[getenv SUNDIALS_ROOT]
[getenv SUNDIALS_ROOT]/include
[getenv SUNDIALS_ROOT]/lib"
foreach path \$paths {
if { ![file exists \$path] } {
puts stderr "ERROR: Does not exist: \$path"
return 0
}
}
return 1
}
proc ModulesHelp { } {
puts stderr "\tThis adds the environment variables for sundials ${version}\n"
}
module-whatis "This adds the environment variables for sundials ${version}"
setenv SUNDIALS_ROOT /usr
prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu
prepend-path INCLUDE /usr/include/sundials
prepend-path C_INCLUDE_PATH /usr/include/sundials
prepend-path CPLUS_INCLUDE_PATH /usr/include/sundials
prepend-path CMAKE_PREFIX_PATH /usr
conflict sundials
EOF
exit 0
fi

version_arr=(${version//\./ })
major=${version_arr[0]}
minor=${version_arr[1]}
Expand Down
57 changes: 57 additions & 0 deletions scripts/install_vtk.sh
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,63 @@ if [ -z "${base_dir}" ]; then usage; fi

parallel="${parallel:-$(nproc)}"

# Modulefile pointing to system version
if [ "$version" = "system" ]; then
version=""
for i in 9 8 7 6
do
version=$(dpkg -s "libvtk${i}-dev" | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1)
if [ -n "${version}" ]; then break; fi
done

if [ -z "${version}" ]; then echo "Unknown VTK system version"; exit 1; fi

major=$(echo $version | cut -d. -f1)
minor=$(echo $version | cut -d. -f2)

mkdir -p ${base_dir}/modulefiles/vtk && cd ${base_dir}/modulefiles/vtk
cat <<EOF > ${version}
#%Module1.0#####################################################################
###
## vtk ${version} modulefile
##
proc ModulesTest { } {
set paths "[getenv VTK_ROOT]
[getenv VTK_ROOT]/include/vtk-${major}.${minor}
[getenv VTK_ROOT]/lib"
foreach path \$paths {
if { ![file exists \$path] } {
puts stderr "ERROR: Does not exist: \$path"
return 0
}
}
return 1
}
proc ModulesHelp { } {
puts stderr "\tThis adds the environment variables for vtk ${version}\n"
}
module-whatis "This adds the environment variables for vtk ${version}"
setenv VTK_ROOT /usr
prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu
prepend-path INCLUDE /usr/include/vtk-${major}.${minor}
prepend-path C_INCLUDE_PATH /usr/include/vtk-${major}.${minor}
prepend-path CPLUS_INCLUDE_PATH /usr/include/vtk-${major}.${minor}
prepend-path CMAKE_PREFIX_PATH /usr
conflict vtk
EOF
exit 0
fi

version_arr=(${version//\./ })
major=${version_arr[0]}
minor=${version_arr[1]}
Expand Down
49 changes: 49 additions & 0 deletions scripts/install_xercesc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,55 @@ if [ -z "${base_dir}" ]; then usage; fi

parallel="${parallel:-$(nproc)}"

# Modulefile pointing to system version
if [ "$version" = "system" ]; then
version=$(dpkg -s libxerces-c-dev | grep 'Version:' | cut -d' ' -f2 | cut -d. -f1,2,3 | cut -d+ -f1)

mkdir -p ${base_dir}/modulefiles/xercesc && cd ${base_dir}/modulefiles/xercesc
cat <<EOF > ${version}
#%Module1.0#####################################################################
###
## xercesc ${version} modulefile
##
proc ModulesTest { } {
set paths "[getenv XERCESC_ROOT]
[getenv XERCESC_INCLUDE]
[getenv XERCESC_LIBRARY]"
foreach path \$paths {
if { ![file exists \$path] } {
puts stderr "ERROR: Does not exist: \$path"
return 0
}
}
return 1
}
proc ModulesHelp { } {
puts stderr "\tThis adds the environment variables for xercesc ${version}\n"
}
module-whatis "This adds the environment variables for xercesc ${version}"
setenv XERCESC_ROOT /usr
setenv XERCESC_INCLUDE usr/include/xercesc
setenv XERCESC_LIBRARY /usr/lib/x86_64-linux-gnu
prepend-path LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_LIBRARY_PATH /usr/lib/x86_64-linux-gnu
prepend-path LD_RUN_PATH /usr/lib/x86_64-linux-gnu
prepend-path INCLUDE usr/include/xercesc
prepend-path C_INCLUDE_PATH usr/include/xercesc
prepend-path CPLUS_INCLUDE_PATH usr/include/xercesc
prepend-path CMAKE_PREFIX_PATH /usr
conflict xercesc
EOF
exit 0
fi

ver_si_on=${version//\./_} # Converts 3.1.1 to 3_1_1
version_arr=(${version//\./ })
major=${version_arr[0]}
Expand Down
Loading

0 comments on commit dfbfc77

Please sign in to comment.