-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from kmturbulenz/hakostra/llvm-mpich-image
Added image for llvm-mpich workflow
- Loading branch information
Showing
7 changed files
with
222 additions
and
92 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
name: Build all docker images | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
push_image: | ||
type: boolean | ||
description: Push image to package registry | ||
required: true | ||
default: true | ||
|
||
jobs: | ||
build-all-images: | ||
strategy: | ||
matrix: | ||
image: ["intel-impi-image", "gnu-ompi-image", "llvm-mpich-image"] | ||
uses: ./.github/workflows/build-single-image.yml | ||
with: | ||
image: ${{ matrix.image }} | ||
push_image: ${{ inputs.push_image }} | ||
secrets: inherit |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,75 @@ | ||
name: Docker image build | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
image: | ||
description: Which image to build | ||
required: true | ||
type: string | ||
push_image: | ||
description: Push image to package registry | ||
required: true | ||
type: boolean | ||
default: true | ||
|
||
workflow_dispatch: | ||
inputs: | ||
image: | ||
type: choice | ||
description: Which image to build | ||
required: true | ||
default: "intel-impi-image" | ||
options: | ||
- "intel-impi-image" | ||
- "gnu-ompi-image" | ||
- "llvm-mpich-image" | ||
push_image: | ||
type: boolean | ||
description: Push image to package registry | ||
required: true | ||
default: true | ||
|
||
jobs: | ||
build-single-image: | ||
|
||
runs-on: ubuntu-latest | ||
timeout-minutes: 300 | ||
|
||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 2 | ||
|
||
- uses: docker/setup-buildx-action@v3 | ||
name: Set up Docker Buildx | ||
id: buildx | ||
|
||
- name: Create tag with current date | ||
id: date | ||
run: echo "date=$(date +'%Y%m%d')" >> $GITHUB_OUTPUT | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: | | ||
ghcr.io/kmturbulenz/${{ inputs.image }} | ||
tags: | | ||
type=sha | ||
type=raw,prefix=date-,value=${{ steps.date.outputs.date }} | ||
- uses: docker/login-action@v3 | ||
name: Login to Github Packages | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- uses: docker/build-push-action@v6 | ||
name: Build image and push to GitHub Container Registry | ||
with: | ||
context: . | ||
target: ${{ inputs.image }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: ${{ inputs.push_image }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
# Fetch and build LLVM from Github | ||
set -o errexit | ||
set -o pipefail | ||
|
||
LLVM_ROOT_DIR="/opt/llvm" | ||
|
||
mkdir -p $LLVM_ROOT_DIR/install | ||
cd $LLVM_ROOT_DIR | ||
|
||
git clone --depth 1 https://github.com/llvm/llvm-project.git | ||
cd llvm-project | ||
mkdir build | ||
cd build | ||
cmake -GNinja \ | ||
-DCMAKE_BUILD_TYPE="Release" \ | ||
-DCMAKE_INSTALL_PREFIX="$LLVM_ROOT_DIR/install" \ | ||
-DLLVM_ENABLE_PROJECTS="clang;lld;flang;openmp" \ | ||
-DLLVM_TARGETS_TO_BUILD="X86" \ | ||
-DLLVM_ENABLE_RTTI="ON" \ | ||
../llvm 2>&1 | tee cmake.log | ||
ninja -j 2 install 2>&1 | tee ninja.log | ||
|
||
# To reduce the size of the image, only the installed files are kept, the | ||
# checked out and compiled sources are deleted. | ||
cd $LLVM_ROOT_DIR | ||
rm -rf llvm-project |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
# This script require environment variable MPICH_VER to be set | ||
|
||
set -o errexit | ||
set -o pipefail | ||
|
||
MPICH_URL="https://github.com/pmodels/mpich/releases/download/v${MPICH_VER}/mpich-${MPICH_VER}.tar.gz" | ||
MPICH_ROOT_DIR="/opt/mpich/${MPICH_VER}" | ||
|
||
mkdir -p $MPICH_ROOT_DIR | ||
cd $MPICH_ROOT_DIR | ||
|
||
wget --no-verbose $MPICH_URL | ||
tar -xf mpich-${MPICH_VER}.tar.gz | ||
rm mpich-${MPICH_VER}.tar.gz | ||
|
||
mv mpich-${MPICH_VER} source | ||
mkdir install | ||
cd source | ||
|
||
./configure \ | ||
--prefix=$MPICH_ROOT_DIR/install \ | ||
--with-pic \ | ||
--with-device=ch4:ucx \ | ||
2>&1 | tee configure.log | ||
make -j install 2>&1 | tee make.log | ||
|
||
# To reduce the size of the image, only the installed files are kept, the | ||
# checked out and compiled sources are deleted. | ||
cd $MPICH_ROOT_DIR | ||
rm -rf source |