Features/ams new interface #394
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
name: CI | |
on: | |
# Triggers the workflow on pull request events only for the "develop" branch | |
pull_request: | |
branches: [ "develop" ] | |
workflow_dispatch: | |
jobs: | |
build-run-tests: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
container: ghcr.io/llnl/ams-ci-almalinux8:latest | |
strategy: | |
matrix: | |
with_hdf5: [ON, OFF] | |
with_caliper: [ON, OFF] | |
with_mpi : [ON, OFF] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build WITH_HDF5=${{ matrix.with_hdf5 }}, WITH_CALIPER=${{ matrix.with_caliper }} WITH_MPI=${{ matrix.with_mpi }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
rm -rf build/ | |
mkdir build | |
cd build | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
export AMS_TORCH_PATH=$(spack location -i py-torch)/lib/python3.10/site-packages/torch/share/cmake/Torch | |
export AMS_FAISS_PATH=$(spack location -i faiss) | |
export AMS_UMPIRE_PATH=$(spack location -i umpire) | |
export AMS_HDF5_PATH=$(spack location -i hdf5) | |
cmake \ | |
-DBUILD_SHARED_LIBS=On \ | |
-DCMAKE_INSTALL_PREFIX=./install \ | |
-DWITH_CALIPER=${{ matrix.with_caliper }} \ | |
-DWITH_HDF5=${{ matrix.with_hdf5 }} \ | |
-DAMS_HDF5_DIR=$AMS_HDF5_PATH \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DWITH_CUDA=Off \ | |
-DWITH_MPI=${{ matrix.with_mpi }} \ | |
-DWITH_TESTS=On \ | |
-DTorch_DIR=$AMS_TORCH_PATH \ | |
-DWITH_AMS_DEBUG=On \ | |
-DWITH_WORKFLOW=Off \ | |
$GITHUB_WORKSPACE | |
make -j$(nproc) | |
- name: Run Tests WITH_HDF5=${{ matrix.with_hdf5 }}, WITH_CALIPER=${{ matrix.with_caliper }} WITH_MPI=${{ matrix.with_mpi }} | |
run: | | |
cd build | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
env CTEST_OUTPUT_ON_FAILURE=1 make test | |
- name: Install AMS WITH_HDF5=${{ matrix.with_hdf5 }}, WITH_CALIPER=${{ matrix.with_caliper }} WITH_MPI=${{ matrix.with_mpi }} | |
run: | | |
cd build | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
make -j$(nproc) install | |
build-cuda-tests: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
container: ghcr.io/llnl/ams-ci-cuda11.6.1:latest | |
strategy: | |
matrix: | |
with_hdf5: [ON, OFF] | |
with_caliper: [ON, OFF] | |
with_mpi : [ON, OFF] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build WITH_CUDA=On WITH_HDF5=${{ matrix.with_hdf5 }}, WITH_CALIPER=${{ matrix.with_caliper }} WITH_MPI=${{ matrix.with_mpi }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
rm -rf build/ | |
mkdir build | |
cd build | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
export AMS_TORCH_PATH=$(spack location -i py-torch)/lib/python3.10/site-packages/torch/share/cmake/Torch | |
export AMS_FAISS_PATH=$(spack location -i faiss) | |
export AMS_UMPIRE_PATH=$(spack location -i umpire) | |
export AMS_HDF5_PATH=$(spack location -i hdf5) | |
cmake \ | |
-DBUILD_SHARED_LIBS=On \ | |
-DCMAKE_INSTALL_PREFIX=./install \ | |
-DWITH_CALIPER=${{ matrix.with_caliper }} \ | |
-DWITH_HDF5=${{ matrix.with_hdf5 }} \ | |
-DAMS_HDF5_DIR=$AMS_HDF5_PATH \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DWITH_CUDA=On \ | |
-DWITH_MPI=${{ matrix.with_mpi }} \ | |
-DWITH_TESTS=On \ | |
-DTorch_DIR=$AMS_TORCH_PATH \ | |
-DWITH_AMS_DEBUG=On \ | |
-DWITH_WORKFLOW=Off \ | |
$GITHUB_WORKSPACE | |
make -j$(nproc) | |
- name: Install AMS WITH_CUDA=On WITH_HDF5=${{ matrix.with_hdf5 }}, WITH_CALIPER=${{ matrix.with_caliper }} WITH_MPI=${{ matrix.with_mpi }} | |
run: | | |
cd build | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
make -j$(nproc) install | |
install-link-cpu-tests: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
container: ghcr.io/llnl/ams-ci-almalinux8:latest | |
strategy: | |
matrix: | |
with_shared: [ON, OFF] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build SharedLibray=${{ matrix.with_shared }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
rm -rf build/ | |
mkdir build | |
cd build | |
export AMS_INSTALL_PATH=$(pwd)/install | |
echo "AMS_INSTALL_PATH=${AMS_INSTALL_PATH}" | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
export AMS_TORCH_PATH=$(spack location -i py-torch)/lib/python3.10/site-packages/torch/share/cmake/Torch | |
export AMS_FAISS_PATH=$(spack location -i faiss) | |
export AMS_UMPIRE_PATH=$(spack location -i umpire) | |
export AMS_HDF5_PATH=$(spack location -i hdf5) | |
export AMS_AMQPCPP_PATH=$(spack location -i amqp-cpp)/cmake | |
cmake \ | |
-DBUILD_SHARED_LIBS=${{ matrix.with_shared }} \ | |
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=${{ matrix.with_shared }} \ | |
-DCMAKE_INSTALL_PREFIX=$AMS_INSTALL_PATH \ | |
-DWITH_RMQ=On \ | |
-Damqpcpp_DIR=$AMS_AMQPCPP_PATH \ | |
-DWITH_CALIPER=On \ | |
-DWITH_HDF5=On \ | |
-DAMS_HDF5_DIR=$AMS_HDF5_PATH \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DWITH_CUDA=Off \ | |
-DWITH_MPI=On \ | |
-DWITH_TESTS=On \ | |
-DTorch_DIR=$AMS_TORCH_PATH \ | |
-DWITH_AMS_DEBUG=On \ | |
-DWITH_WORKFLOW=Off \ | |
$GITHUB_WORKSPACE | |
make -j$(nproc) | |
make -j$(nproc) install | |
echo "AMS_INSTALL_PATH=${AMS_INSTALL_PATH}" >> $GITHUB_ENV | |
- name: Install IdealGas SharedLibray=${{ matrix.with_shared }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
mkdir build_idealgas/ | |
cd build_idealgas/ | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
echo "AMS_INSTALL_PATH=${AMS_INSTALL_PATH}" | |
cmake -DWITH_CUDA=Off -DAMS_DIR=${AMS_INSTALL_PATH}/lib64/cmake/AMS -DMFEM_DIR=${AMS_MFEM_PATH} $GITHUB_WORKSPACE/examples/ideal_gas/ | |
make -j$(nproc) VERBOSE=1 | |
install-link-cuda-tests: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
container: ghcr.io/llnl/ams-ci-cuda11.6.1:latest | |
strategy: | |
matrix: | |
with_shared: [ON, OFF] | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Build SharedLibray=${{ matrix.with_shared }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
rm -rf build/ | |
mkdir build | |
cd build | |
export AMS_INSTALL_PATH=$(pwd)/install | |
echo "AMS_INSTALL_PATH=${AMS_INSTALL_PATH}" | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
export AMS_TORCH_PATH=$(spack location -i py-torch)/lib/python3.10/site-packages/torch/share/cmake/Torch | |
export AMS_FAISS_PATH=$(spack location -i faiss) | |
export AMS_UMPIRE_PATH=$(spack location -i umpire) | |
export AMS_HDF5_PATH=$(spack location -i hdf5) | |
echo "Current directory is: $(pwd)" | |
cmake \ | |
-DBUILD_SHARED_LIBS=${{ matrix.with_shared }} \ | |
-DCMAKE_INSTALL_RPATH_USE_LINK_PATH=${{ matrix.with_shared }} \ | |
-DCMAKE_INSTALL_PREFIX=$AMS_INSTALL_PATH \ | |
-DWITH_CALIPER=On \ | |
-DWITH_HDF5=On \ | |
-DAMS_HDF5_DIR=$AMS_HDF5_PATH \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DWITH_CUDA=On \ | |
-DWITH_MPI=On \ | |
-DWITH_TESTS=On \ | |
-DTorch_DIR=$AMS_TORCH_PATH \ | |
-DWITH_AMS_DEBUG=On \ | |
-DWITH_WORKFLOW=Off \ | |
$GITHUB_WORKSPACE | |
make -j$(nproc) | |
make -j$(nproc) install | |
echo "AMS_INSTALL_PATH=${AMS_INSTALL_PATH}" >> $GITHUB_ENV | |
ls ${AMS_INSTALL_PATH} | |
- name: Install IdealGas SharedLibray=${{ matrix.with_shared }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
mkdir build_idealgas/ | |
cd build_idealgas/ | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
cmake -DCMAKE_CUDA_ARCHITECTURES=70 -DAMS_DIR=${AMS_INSTALL_PATH}/lib64/cmake/AMS -DMFEM_DIR=${AMS_MFEM_PATH} $GITHUB_WORKSPACE/examples/ideal_gas/ | |
make -j$(nproc) VERBOSE=1 | |
- name: Install BOptions SharedLibray=${{ matrix.with_shared }} | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
mkdir build_bnm_opt/ | |
cd build_bnm_opt/ | |
cmake -DCMAKE_CUDA_ARCHITECTURES=70 -DAMS_DIR=${AMS_INSTALL_PATH}/lib64/cmake/AMS $GITHUB_WORKSPACE/examples/bnm_opt/ | |
make -j$(nproc) VERBOSE=1 | |
build-rmq-tests: | |
# The type of runner that the job will run on | |
runs-on: ubuntu-latest | |
services: | |
rabbitmq: | |
image: rabbitmq:3.11 | |
env: | |
RABBITMQ_DEFAULT_USER: ams | |
RABBITMQ_DEFAULT_PASS: ams | |
ports: | |
- 5672 | |
container: | |
image: ghcr.io/llnl/ams-ci-almalinux8:latest | |
env: | |
RABBITMQ_USER: ams | |
RABBITMQ_PASS: ams | |
RABBITMQ_HOST: rabbitmq | |
RABBITMQ_PORT: 5672 | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Build Torch=On FAISS=On RMQ=On AMS | |
shell: bash -l {0} | |
run: | | |
module load gcc/11.2.1 | |
export SPACK_ROOT=/spack/ | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
rm -rf build/ | |
mkdir build | |
cd build | |
export AMS_MFEM_PATH=$(spack location -i mfem) | |
export AMS_TORCH_PATH=$(spack location -i py-torch)/lib/python3.10/site-packages/torch/share/cmake/Torch | |
export AMS_FAISS_PATH=$(spack location -i faiss) | |
export AMS_UMPIRE_PATH=$(spack location -i umpire) | |
export AMS_HDF5_PATH=$(spack location -i hdf5) | |
export AMS_AMQPCPP_PATH=$(spack location -i amqp-cpp)/cmake | |
cmake \ | |
-DBUILD_SHARED_LIBS=On \ | |
-DCMAKE_PREFIX_PATH=$INSTALL_DIR \ | |
-DWITH_CALIPER=On \ | |
-DWITH_HDF5=On \ | |
-DAMS_HDF5_DIR=$AMS_HDF5_PATH \ | |
-DCMAKE_INSTALL_PREFIX=./install \ | |
-DCMAKE_BUILD_TYPE=Release \ | |
-DWITH_CUDA=Off \ | |
-DWITH_MPI=On \ | |
-DWITH_TORCH=On \ | |
-DWITH_TESTS=On \ | |
-DTorch_DIR=$AMS_TORCH_PATH \ | |
-DWITH_AMS_DEBUG=On \ | |
-DWITH_WORKFLOW=On \ | |
-DWITH_RMQ=On \ | |
-Damqpcpp_DIR=$AMS_AMQPCPP_PATH \ | |
$GITHUB_WORKSPACE | |
make | |
- name: Run tests Torch=On FAISS=On RMQ=On AMSlib RabbitMQ egress | |
run: | | |
cd build | |
export SPACK_ROOT=/spack/ | |
source /spack/share/spack/setup-env.sh | |
spack env activate -p /ams-spack-env | |
# We overwrite the rmq.json created by CMake | |
echo """{ | |
\"db\": { | |
\"dbType\": \"rmq\", | |
\"rmq_config\": { | |
\"rabbitmq-name\": \"rabbit\", | |
\"rabbitmq-user\": \"${RABBITMQ_USER}\", | |
\"rabbitmq-password\": \"${RABBITMQ_PASS}\", | |
\"service-port\": ${RABBITMQ_PORT}, | |
\"service-host\": \"${RABBITMQ_HOST}\", | |
\"rabbitmq-vhost\": \"/\", | |
\"rabbitmq-outbound-queue\": \"test-ci\", | |
\"rabbitmq-exchange\": \"ams-fanout\", | |
\"rabbitmq-routing-key\": \"training\" | |
}, | |
\"update_surrogate\": false | |
}, | |
\"ml_models\": {}, | |
\"domain_models\": {} | |
}""" > $GITHUB_WORKSPACE/build/tests/AMSlib/rmq.json | |
make test | |
env: | |
RABBITMQ_USER: ams | |
RABBITMQ_PASS: ams | |
RABBITMQ_HOST: rabbitmq | |
RABBITMQ_PORT: 5672 |