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

Spack GitHub action #15

Merged
merged 21 commits into from
Sep 26, 2023
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
2 changes: 1 addition & 1 deletion .github/workflows/ornl_ascent_mirror.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Ascent Mirror
name: ORNL Ascent Mirror

# triggers a github action everytime there is a push or mr
on:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pre_commit.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: pre-commit
name: pre-commit GitHub Action

# Won't run on develop/main directly
on: [pull_request]
Expand Down
45 changes: 45 additions & 0 deletions .github/workflows/spack_cpu_build.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Spack CPU Builds

# Until we remove the need to clone submodules to build, this should on be in PRs
on: [pull_request]

jobs:
exago_spack_builds:
# 20.04 is a version shared by E4S cache and Spack binaries for x86_64
runs-on: ubuntu-20.04
# This seems redundant if we use a spack submodule?
container: spack/ubuntu-focal:latest
strategy:
matrix:
spack_spec:
# Minimal Build
- exago@develop~mpi~ipopt~hiop~logging~python~raja~tests
- exago@develop+mpi~ipopt+hiop~logging~python~raja~tests ^openmpi
# See #18 - +hiop~mpi causes issues
# - exago@develop~mpi~ipopt+hiop+logging~python+raja+tests
# See #16 - +python~mpi causes issues
# - exago@develop~mpi~ipopt+hiop~logging+python~raja+tests
- exago@develop+mpi~ipopt+hiop~logging+python~raja+tests ^openmpi

name: Build ExaGO with Spack
steps:
- name: Checkout
uses: actions/checkout@v2
with:
# Once we move submodule deps into spack, we can do some more builds...
submodules: true

- name: Build Environment
env:
SPACK_SPEC: ${{ matrix.spack_spec }}
run: |
ls && pwd
. ./tpl/spack/share/spack/setup-env.sh
spack debug report
spack env create -d ./spack-env
spack env activate ./spack-env
spack add $SPACK_SPEC target=x86_64
spack develop --path $(pwd) --no-clone exago@develop
spack concretize --reuse
git config --global --add safe.directory $(pwd)
spack --stacktrace install --fail-fast
34 changes: 3 additions & 31 deletions .gitlab/ornl/ascent.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
- cd "$WORKDIR"
- export srcdir=$WORKDIR builddir=$WORKDIR/build installdir=$WORKDIR/install
# Export CTESTARGS defined in variables to run correct tests for stage
- export CTESTARGS="--output-on-failure -E Python"
- export CTESTARGS="$CTESTARGS"
- MY_CLUSTER="ascent" ./buildsystem/build.sh --test-only --job=gcc-cuda
- res=$?
- exit $res
Expand All @@ -101,19 +101,6 @@
- cd "$WORKDIR/.."
- rm -rf "$WORKDIR"

.ascent_python_test_script_template:
script:
- set -xv
- cd "$WORKDIR"
- export srcdir=$WORKDIR builddir=$WORKDIR/build installdir=$WORKDIR/install
# Export CTESTARGS defined in variables to run correct tests for stage
- export CTESTARGS="-VV -R Python"
- MY_CLUSTER="ascent" ./buildsystem/build.sh --test-only --job=gcc-cuda
- res=$?
- exit $res
# ---

# For Ascent CI
Ascent Build:
stage: build
tags:
Expand All @@ -132,28 +119,13 @@ Ascent Test:
variables:
# Don't clone for test jobs
GIT_STRATEGY: none
CTESTARGS: "--output-on-failure -E Python"
CTESTARGS: "--output-on-failure"
extends:
- .ascent_rules
- .ascent_test_script_template
- .ascent_environment_template

Ascent Py Test:
stage: test
dependencies:
- 'Ascent Build'
tags:
- batch
variables:
# Don't clone for test jobs
GIT_STRATEGY: none
extends:
- .ascent_rules
- .ascent_python_test_script_template
- .ascent_environment_template
# ---

# Reporting Ascent Status to PNNL
# -- Reporting Ascent Status to PNNL GitHub
.report-job:
when: always
variables:
Expand Down
28 changes: 6 additions & 22 deletions .gitlab/pnnl/base.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,26 +101,13 @@ stages:
variables:
# Don't clone for test jobs
GIT_STRATEGY: none
CTESTARGS: "--timeout 240 --output-on-failure -E Python"
CTESTARGS: "--timeout 240 --output-on-failure"
OUTPUT_SUFFIX: "_test"
artifacts:
when: always
paths:
- partition

.cluster_py_test:
stage: test
extends:
- .pnnl_tags_template
- .pnnl_script_template
# No after_script as only one test per platform cleans up
# Since python test should finish first, we let other test cleanup
variables:
# Don't clone for test jobs
GIT_STRATEGY: none
CTESTARGS: "--timeout 240 --output-on-failure -R Python"
OUTPUT_SUFFIX: "_test_python"

.module_rebuild:
needs: []
retry: 1
Expand Down Expand Up @@ -189,14 +176,11 @@ stages:
jobid=$(sbatch --export=ALL -A EXASGD $SLURM_ARGS -p $SLURM_Q -o $output -e $output -t 1:00:00 $WORKDIR/buildsystem/build.sh $SCRIPT_ARGS)
export jobid=$(echo $jobid | cut -f4 -d' ')

# Add partition for later if not a Python test
if [[ $CTESTARGS == *"-E Python"* ]]; then
partition=$(squeue -j $jobid -h --format="%P")
export partition=$(echo $partition | cut -f2 -d'=' | cut -f1 -d' ')
popd
echo "$partition" >> ./partition
pushd $WORKDIR
fi
partition=$(squeue -j $jobid -h --format="%P")
export partition=$(echo $partition | cut -f2 -d'=' | cut -f1 -d' ')
popd
echo "$partition" >> ./partition
pushd $WORKDIR

# Unique jobid filename for this job
echo $jobid > "$WORKDIR/jobid_${jobid}"
Expand Down
10 changes: 1 addition & 9 deletions .gitlab/pnnl/deception.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ Deception Test:
- .cluster_test
- .deception
variables:
CTESTARGS: " --timeout 240 --output-on-failure -E Python -LE deception-skip "
SCRIPT_ARGS: " --test-only --job=gcc-cuda "
needs: ['Deception Build']

Deception Py Test:
extends:
- .cluster_py_test
- .deception
variables:
CTESTARGS: " --timeout 240 --output-on-failure -LE deception-skip "
SCRIPT_ARGS: " --test-only --job=gcc-cuda "
needs: ['Deception Build']

Expand Down
10 changes: 1 addition & 9 deletions .gitlab/pnnl/incline.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ Incline Test:
- .incline
variables:
SCRIPT_ARGS: " --test-only --job=clang-hip "
CTESTARGS: " --timeout 240 --output-on-failure -E Python -LE incline-skip "
needs: ['Incline Build']

Incline Py Test:
extends:
- .cluster_py_test
- .incline
variables:
SCRIPT_ARGS: " --test-only --job=clang-hip "
CTESTARGS: " --timeout 240 --output-on-failure -LE incline-skip "
needs: ['Incline Build']

Incline Module Rebuild:
Expand Down
10 changes: 1 addition & 9 deletions .gitlab/pnnl/newell.gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,7 @@ Newell Test:
- .cluster_test
- .newell
variables:
CTESTARGS: " --timeout 240 --output-on-failure -E Python -LE newell-skip "
SCRIPT_ARGS: " --test-only --job=gcc-cuda "
needs: ['Newell Build']

Newell Py Test:
extends:
- .cluster_py_test
- .newell
variables:
CTESTARGS: " --timeout 240 --output-on-failure -LE newell-skip "
SCRIPT_ARGS: " --test-only --job=gcc-cuda "
needs: ['Newell Build']

Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/cheshirekow/cmake-format-precommit
rev: v0.6.10
rev: v0.6.13
hooks:
- id: cmake-format
- repo: https://github.com/pre-commit/mirrors-clang-format
Expand Down
6 changes: 4 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,8 +413,10 @@ if(EXAGO_ENABLE_PYTHON)
add_subdirectory(interfaces/python)
endif()

# Build tests
add_subdirectory(tests)
if(EXAGO_RUN_TESTS)
# Build tests
add_subdirectory(tests)
endif()

if((NOT EXAGO_ENABLE_IPOPT) AND (NOT EXAGO_ENABLE_HIOP))
message(
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# <b>Exa</b>scale <b>G</b>rid <b>O</b>ptimization toolkit (ExaGO<sup>TM</sup>) [![pipeline status](https://gitlab.pnnl.gov/exasgd/frameworks/exago/badges/develop/pipeline.svg)](https://gitlab.pnnl.gov/exasgd/frameworks/exago/-/commits/develop)
# <b>Exa</b>scale <b>G</b>rid <b>O</b>ptimization toolkit (ExaGO<sup>TM</sup>) [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit)](https://github.com/pre-commit/pre-commit) ![PNNL GitLab Push Mirror](https://github.com/pnnl/ExaGO/actions/workflows/pnnl_mirror.yaml/badge.svg) ![ORNL Ascent GitLab Push Mirror](https://github.com/pnnl/ExaGO/actions/workflows/ornl_ascent_mirror.yaml/badge.svg) ![pre-commit GitHub Action](https://github.com/pnnl/ExaGO/actions/workflows/pre_commit.yaml/badge.svg?event=pull_request) ![Spack CPU Build](https://github.com/pnnl/ExaGO/actions/workflows/spack_cpu_build.yaml/badge.svg?event=pull_request)

<!--![](viz/images/network_gen_load_us.png)-->
<img src="viz/images/network_gen_load_us.png">
Expand Down
8 changes: 4 additions & 4 deletions buildsystem/cmake/ExaGOFindPythonModule.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ macro(find_python_module module)
import ${module}; \
print(${module}.__version__)"
RESULT_VARIABLE _${module}_ver_status
OUTPUT_VARIABLE _${module}_version ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE _${module}_version
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT ${_${module}_ver_status})
set(${module}_VERSION
Expand All @@ -76,8 +76,8 @@ macro(find_python_module module)
"from pkg_resources import parse_version; \
print(parse_version('${${module}_VERSION}') ${_op} parse_version('${${module}_tgtver}'))"
RESULT_VARIABLE _${module}_verenuf_status
OUTPUT_VARIABLE _${module}_verenuf ERROR_QUIET
OUTPUT_STRIP_TRAILING_WHITESPACE
OUTPUT_VARIABLE _${module}_verenuf
ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE
)
if(NOT ${_${module}_verenuf_status})
if(${_${module}_verenuf} STREQUAL "True")
Expand Down
1 change: 0 additions & 1 deletion docs/manual/getting_started.tex
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ \section{Usage}
-DEXAGO_ENABLE_MPI:BOOL=ON \
-DEXAGO_BUILD_STATIC:BOOL=OFF \
-DEXAGO_ENABLE_CUDA:BOOL=OFF \
-DEXAGO_ENABLE_HIOP_DISTRIBUTED:BOOL=OFF \
-DEXAGO_ENABLE_PETSC:BOOL=ON \
-DEXAGO_BUILD_SHARED:BOOL=OFF \
-DIPOPT_INCLUDES:STRING="" \
Expand Down
3 changes: 2 additions & 1 deletion interfaces/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ if(mpi4py_FOUND)
"import pytest as p; print(p.__version__);"
RESULT_VARIABLE _pytest_SEARCH_SUCCESS
OUTPUT_VARIABLE _pytest_VALUES
ERROR_VARIABLE _pytest_ERROR_VALUE OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_VARIABLE _pytest_ERROR_VALUE
OUTPUT_STRIP_TRAILING_WHITESPACE
)

# Convert the process output into a list
Expand Down
8 changes: 0 additions & 8 deletions src/utils/version.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,6 @@ static const std::unordered_map<std::string, bool> ExaGOBoolConfigOptions = {
true,
#else
false,
#endif
},
{
"EXAGO_ENABLE_HIOP_DISTRIBUTED",
#ifdef EXAGO_ENABLE_HIOP_DISTRIBUTED
true,
#else
false,
#endif
},
{
Expand Down
30 changes: 18 additions & 12 deletions tests/functionality/opflow/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ if(EXAGO_INSTALL_TESTS)
HIOP
)

set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_HIOP_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
if(EXAGO_ENABLE_HIOP)
set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_HIOP_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
endif()

exago_add_test(
NAME
Expand All @@ -38,10 +40,12 @@ if(EXAGO_INSTALL_TESTS)
HIOP
RAJA
)
set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_RAJAHIOP_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
if(EXAGO_ENABLE_HIOP AND EXAGO_ENABLE_RAJA)
set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_RAJAHIOP_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
endif()

exago_add_test(
NAME
Expand All @@ -53,10 +57,12 @@ if(EXAGO_INSTALL_TESTS)
DEPENDS
HIOP_SPARSE
)
set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_HIOPSPARSE_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
if(EXAGO_ENABLE_HIOP_SPARSE)
set_tests_properties(
FUNCTIONALITY_TEST_OPFLOW_HIOPSPARSE_TOML_TESTSUITE
PROPERTIES LABELS "incline-skip;deception-skip;newell-skip"
)
endif()

# Note: All cartesian and/or current balance models are way behind. These
# models should not be used and their tests should be disabled.
Expand Down
Loading