Skip to content

Commit

Permalink
Merge pull request #1425 from LLNL/task/rhornung67/v0.10.0-RC
Browse files Browse the repository at this point in the history
Merge v0.10.0-RC to main
  • Loading branch information
rhornung67 authored Sep 26, 2024
2 parents 5f53159 + 0cbe048 commit ea853a3
Show file tree
Hide file tree
Showing 350 changed files with 20,442 additions and 8,629 deletions.
7 changes: 7 additions & 0 deletions .github/actions/apply-style/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
FROM ghcr.io/llnl/radiuss:clang-14-ubuntu-22.04

COPY entrypoint.sh /entrypoint.sh

USER root

ENTRYPOINT ["/entrypoint.sh"]
68 changes: 68 additions & 0 deletions .github/actions/apply-style/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
#!/bin/bash

# This is a bare minimum of options needed to create the `style` build target.
CMAKE_ARGS=-DCMAKE_CXX_COMPILER=clang++
CMAKE_ARGS="$CMAKE_ARGS -DENABLE_CLANGFORMAT=ON"
CMAKE_ARGS="$CMAKE_ARGS -DCLANGFORMAT_EXECUTABLE=/usr/bin/clang-format"
CMAKE_ARGS="$CMAKE_ARGS -DAXOM_ENABLE_ALL_COMPONENTS=OFF"

# Avoid error "fatal: detected dubious ownership in repository at '/github/workspace'"
REPO_PATH=/github/workspace
git config --global --add safe.directory "$REPO_PATH"
find "$REPO_PATH" -type d | while read -r dir; do
git config --global --add safe.directory "$dir"
done

git fetch

###
# Attempt to find the branch of the PR from the detached head state
##

echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"
echo "Attempting to find branch that matches commit..."

# Get the current commit SHA
current_commit_sha=$(git rev-parse HEAD)
# List all branches containing the current commit SHA
branches=$(git branch -r --contains $current_commit_sha)

# Loop over the string split by whitespace
branch=""
num_branches_found=0
for _possible_branch in $branches; do
# Skip items that start with "pull/"
if [[ $_possible_branch == pull/* ]]; then
continue
fi
if [[ $_possible_branch == origin/* ]]; then
_possible_branch=$(echo "$_possible_branch" | sed 's/origin\///')
fi
echo "Possible Branch: $_possible_branch"
branch=$_possible_branch
num_branches_found=$((num_branches_found+1))
done

if [ "$num_branches_found" -ne 1 ]; then
echo "Error: Unable to find a single branch that matched git sha $current_commit_sha"
exit 1
fi

echo "Found branch: $branch"
echo "~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~"

git checkout $branch

git submodule update --init --recursive

mkdir build && cd build
cmake $CMAKE_ARGS ../src
make style
cd ..

git config user.name "format-robot"
git config user.email "[email protected]"
if [ -n "$(git status --porcelain)" ]; then
git commit -am 'Apply style updates'
git push
fi
28 changes: 28 additions & 0 deletions .github/workflows/apply-style.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Apply Style

on:
issue_comment:
types: [created]

jobs:
apply-style:
if: startsWith(github.event.comment.body, '/style')
name: Apply Style to Source
runs-on: ubuntu-latest

steps:
# Checkout the GitHub created reference for the PR.
# The only way to do this is by using the "issue" number
# but that is really the PR number in this context.
# This is due to using an `issue_comment` event which
# is due to the GitHub Actions API that does not have
# a `pull_request_comment` event or something similar.
# This leaves us in a detached head state which is corrected
# in `apply-style/entrypoint.sh`
- name: Checkout pull request
uses: actions/checkout@v3
with:
ref: refs/pull/${{ github.event.issue.number }}/head

- name: Apply style updates
uses: ./.github/actions/apply-style
25 changes: 14 additions & 11 deletions .github/workflows/docker_build_tpls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,46 @@ jobs:
name: Builds a docker image and extracts generated hostconfigs
strategy:
matrix:
compiler: [clang-10, gcc-11]
compiler: [clang-14, gcc-13]
env:
REPO: axom/tpls
HOSTCONFIG_LOC: /home/axom/export_hostconfig
DOCKERFILE_PREFIX: ./scripts/docker/dockerfile_
steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
run: |
echo "branch=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_OUTPUT
id: extract_branch
- name: Get dockerfile name
shell: bash
run: echo "##[set-output name=filename;]$(echo ${DOCKERFILE_PREFIX}${{ matrix.compiler }})"
run: |
echo "filename=$(echo ${DOCKERFILE_PREFIX}${{ matrix.compiler }})" >> $GITHUB_OUTPUT
id: dockerfile_name
- name: Get dockerhub repo name
shell: bash
run: |
echo ${REPO}:${{ matrix.compiler }}_`date "+%m-%d-%y_%Hh-%Mm"`
echo "##[set-output name=repo_plus_tag;]$(echo ${REPO}:${{ matrix.compiler }}_`date "+%m-%d-%y_%Hh-%Mm"`)"
echo "##[set-output name=repo_plus_latest;]$(echo ${REPO}:${{ matrix.compiler }}_latest)"
repo_plus_tag=$(echo ${REPO}:${{ matrix.compiler }}_`date "+%m-%d-%y_%Hh-%Mm"`) && export repo_plus_tag
echo $repo_plus_tag
echo "repo_plus_tag=$repo_plus_tag" >> $GITHUB_OUTPUT
echo "repo_plus_latest=$(echo ${REPO}:${{ matrix.compiler }}_latest)" >> $GITHUB_OUTPUT
id: repo_name

- name: Checkout
uses: actions/checkout@v2
uses: actions/checkout@v4

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

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

- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ steps.repo_name.outputs.repo_plus_tag }},${{ steps.repo_name.outputs.repo_plus_latest }}
Expand All @@ -66,7 +69,7 @@ jobs:
docker rm extract_hc
- name: Upload hostconfig
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.compiler }}_hostconfigs
path: ./extracted_hc/export_hostconfig/*
10 changes: 5 additions & 5 deletions .github/workflows/test_windows_tpls.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,21 +29,21 @@ jobs:

steps:
- name: Checkout repo w/ submodules
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
submodules: recursive

- name: Set up python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: '3.7'
python-version: '3.10'

- name: List path and files
run: ls
- name: Run uberenv (${{ matrix.triplet }})
run: python3 ./scripts/uberenv/uberenv.py --triplet ${{ matrix.triplet }}
- name: Save Uberenv logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: uberenv_artifacts_${{ matrix.triplet }}_${{ matrix.cfg }}.zip
Expand Down Expand Up @@ -73,7 +73,7 @@ jobs:
ls
ctest -C ${{ matrix.cfg }} --no-compress-output -T Test
- name: Save CTest logs
uses: actions/upload-artifact@v2
uses: actions/upload-artifact@v4
if: ${{ always() }}
with:
name: ctest_artifacts_${{ matrix.triplet }}_${{ matrix.cfg }}.zip
Expand Down
17 changes: 5 additions & 12 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,10 @@
variables:
LLNL_SERVICE_USER: atk
GIT_SUBMODULE_STRATEGY: recursive
PROJECT_ALLOC_NAME: ${CI_PROJECT_NAME}_ci_${CI_PIPELINE_ID}
BUILD_ROOT: ${CI_PROJECT_DIR}
FULL_BUILD_ROOT: ${CI_BUILDS_DIR}/axom/${CI_JOB_NAME}
SLURM_OVERLAP: 1

stages:
- allocate
- build
- release

.src_workflow:
rules:
- if: '$FULL_BUILD != "ON"'
Expand All @@ -28,12 +22,8 @@ stages:
# Template
.src_build_script:
script:
# Use pre-existing allocation if any
- export JOBID=$(if [[ "$SYS_TYPE" == "toss_4_x86_64_ib" ]]; then squeue -h --name=${PROJECT_ALLOC_NAME} --format=%A; fi)
- ASSIGN_ID=$(if [[ -n "${JOBID}" ]]; then echo "--jobid=${JOBID}"; fi)
# BUILD + TEST
- echo -e "\e[0Ksection_start:$(date +%s):src_build_and_test\r\e[0KSource Build and Test ${CI_PROJECT_NAME}"
- ${ALLOC_COMMAND} ${ASSIGN_ID} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options '-DENABLE_DOCS=OFF ${EXTRA_CMAKE_OPTIONS}' --build-type ${BUILD_TYPE:-Debug} ${EXTRA_OPTIONS}
- ${ALLOC_COMMAND} python3 scripts/llnl_scripts/build_src.py -v --host-config ${HOST_CONFIG} --extra-cmake-options '-DENABLE_DOCS=OFF ${EXTRA_CMAKE_OPTIONS}' --build-type ${BUILD_TYPE:-Debug} ${EXTRA_OPTIONS}
- echo -e "\e[0Ksection_end:$(date +%s):src_build_and_test\r\e[0K"
artifacts:
expire_in: 2 weeks
Expand All @@ -58,6 +48,9 @@ stages:

# This is where jobs are included
include:
- local: .gitlab/build_quartz.yml
- local: .gitlab/build_ruby.yml
- local: .gitlab/build_lassen.yml
- local: .gitlab/build_tioga.yml
# ID token requirement for Gitlab 17.0+
- project: 'lc-templates/id_tokens'
file: 'id_tokens.yml'
35 changes: 5 additions & 30 deletions .gitlab/build_lassen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,10 @@
####
# This is the share configuration of jobs for lassen
.on_lassen:
variables:
SCHEDULER_PARAMETERS: "-nnodes 1 -W ${ALLOC_TIME} -q pci -alloc_flags atsdisable"
tags:
- shell
- batch
- lassen
rules:
- if: '$CI_COMMIT_BRANCH =~ /_lnone/ || $ON_LASSEN == "OFF"' #run except if ...
Expand All @@ -20,16 +22,14 @@
####
# Template
.src_build_on_lassen:
stage: build
variables:
ALLOC_COMMAND: "lalloc 1 -W 25 -q pci -alloc_flags atsdisable"
ALLOC_TIME: "25"
extends: [.src_build_script, .on_lassen, .src_workflow]
needs: []

.full_build_on_lassen:
stage: build
variables:
ALLOC_COMMAND: "lalloc 1 -W 45 -q pci -alloc_flags atsdisable"
ALLOC_TIME: "45"
extends: [.full_build_script, .on_lassen, .full_workflow]
needs: []

Expand Down Expand Up @@ -59,18 +59,6 @@ lassen-gcc_8_3_1_cuda-src:
HOST_CONFIG: "lassen-blueos_3_ppc64le_ib_p9-${COMPILER}.cmake"
extends: [.src_build_on_lassen]

lassen-xl_16_1_1-src:
variables:
COMPILER: "[email protected]"
HOST_CONFIG: "lassen-blueos_3_ppc64le_ib_p9-${COMPILER}.cmake"
extends: [.src_build_on_lassen]

lassen-xl_16_1_1_cuda-src:
variables:
COMPILER: "[email protected]_cuda"
HOST_CONFIG: "lassen-blueos_3_ppc64le_ib_p9-${COMPILER}.cmake"
extends: [.src_build_on_lassen]

####
# Full Build jobs
lassen-clang_10_0_1-full:
Expand Down Expand Up @@ -98,16 +86,3 @@ lassen-gcc_8_3_1_cuda-full:
SPEC: "%${COMPILER}~mfem+cuda"
EXTRA_SPEC: "cuda_arch=70"
extends: [.full_build_on_lassen]

lassen-xl_16_1_1-full:
variables:
COMPILER: "[email protected]"
SPEC: "%${COMPILER}+mfem~openmp~cpp14"
extends: [.full_build_on_lassen]

lassen-xl_16_1_1_cuda-full:
variables:
COMPILER: "[email protected]"
SPEC: "%${COMPILER}+mfem+cuda~openmp~cpp14"
EXTRA_SPEC: "cuda_arch=70"
extends: [.full_build_on_lassen]
Loading

0 comments on commit ea853a3

Please sign in to comment.