Skip to content

Commit

Permalink
Updating CI (#25)
Browse files Browse the repository at this point in the history
* trying different ci image

* using python instead of python3

* updated run scripts for using new image

* adding conda
  • Loading branch information
dc-luo authored Jul 26, 2024
1 parent 8fd3ffb commit 3701b83
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 14 deletions.
19 changes: 13 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
name: CI


on:
push:
branches:
- main
pull_request:
workflow_dispatch:

defaults:
run:
Expand All @@ -14,18 +16,23 @@ jobs:
style:
runs-on: ubuntu-20.04
container:
image: quay.io/fenicsproject/stable:2019.1.0.r3
options: --user 1001 --privileged
name: SOUPy Unit Tests
image: dcluo28/dibasis:latest
name: Repo Test

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v3
- name: Checkout hippylib
run: git clone https://github.com/hippylib/hippylib.git
- name: See directory
run: pwd && ls
- name: Check directory
run: ls
- name: Check user
run: whoami
- name: Run unit tests
run: source .github/workflows/run_tests.sh
- name: Run examples
run: source .github/workflows/run_examples.sh
# - name: Activate conda
# run: conda init && source ~/.bashrc && conda activate dibasis
# - name: Check conda
# run: conda info
18 changes: 16 additions & 2 deletions .github/workflows/run_examples.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,25 @@
#!/bin/bash
set -ev

CONDA_ENV=dibasis
PYTHON=python

export HIPPYLIB_PATH=$(pwd)/hippylib
export HIPPYFLOW_PATH=$(pwd)/hippyflow

# This is for running MPI on root in the docker container
export OMPI_MCA_btl_vader_single_copy_mechanism=none
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

# Run poisson example
cd examples/poisson

python3 driver_poisson_mean.py
conda init
source ~/.bashrc
conda activate $CONDA_ENV

$PYTHON driver_poisson_mean.py

mpirun -n 2 python3 driver_poisson_mean.py
mpirun -n 2 --oversubscribe python driver_poisson_mean.py

23 changes: 17 additions & 6 deletions .github/workflows/run_tests.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,27 @@
#!/bin/bash
set -ev

PYTHON=python3

CONDA_ENV=dibasis
PYTHON=python
export HIPPYLIB_PATH=$(pwd)/hippylib

# This is for running MPI on root in the docker container
export OMPI_MCA_btl_vader_single_copy_mechanism=none
export OMPI_ALLOW_RUN_AS_ROOT=1
export OMPI_ALLOW_RUN_AS_ROOT_CONFIRM=1

# Run the code
cd soupy/test

conda init
source ~/.bashrc
conda activate $CONDA_ENV

$PYTHON -m unittest discover -v
$PYTHON -m unittest discover -v -p 'ptest_*'

mpirun -n 4 $PYTHON ptest_meanVarRiskMeasureSAA.py
mpirun -n 4 $PYTHON ptest_scipyCostWrapper.py
mpirun -n 4 $PYTHON ptest_superquantileSAA.py
mpirun -n 4 $PYTHON ptest_transformedMeanRiskMeasureSAA.py
mpirun -n 2 --oversubscribe $PYTHON ptest_meanVarRiskMeasureSAA.py
mpirun -n 2 --oversubscribe $PYTHON ptest_scipyCostWrapper.py
mpirun -n 2 --oversubscribe $PYTHON ptest_superquantileSAA.py
mpirun -n 2 --oversubscribe $PYTHON ptest_transformedMeanRiskMeasureSAA.py

0 comments on commit 3701b83

Please sign in to comment.