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

Add builder and GA for pflotran #23

Merged
merged 1 commit into from
Feb 26, 2025
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
24 changes: 24 additions & 0 deletions .github/workflows/full.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Full end-to-end test

on:
workflow_dispatch:

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Set up Python 3.11
uses: actions/setup-python@v3
with:
python-version: "3.11"
- name: Install dependencies
run: pip install .
- name: Build environment
run: deploy build
- name: Test environment
run: deploy test
- name: Make links
run: deploy links
10 changes: 9 additions & 1 deletion config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,19 @@ builds:
url: https://github.com/petsc/petsc.git
ref: a093114c2e7b4ba1f47e6ac8a72c57724150f16d

- name: pflotran
version: 1.8.12
depends: [ petsc ]
src:
type: git
url: https://bitbucket.org/opengosim/pflotran_ogs_1.8
ref: 9dda71eba27f4beef56a269d03037b6f3230578b

- name: runcirrus
version: 1.0.0

envs:
- name: cirrus
- name: pflotran
dest: versions
- name: runcirrus
dest: versions/runcirrus
Expand Down
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
Cirrus was compiled on: [PRUNED]
RESERVOIR_DEFAULTS keyword selected.
Cirrus card:: DIMENS
Cirrus card:: EQUALS
Cirrus card:: EQUALS
Cirrus card:: COPY
Cirrus card:: MULTIPLY
Cirrus card:: EQUALS
Pflotran was compiled on: [PRUNED]
RESERVOIR_DEFAULTS option has been selected
Pflotran card:: DIMENS
Pflotran card:: EQUALS
Pflotran card:: EQUALS
Pflotran card:: COPY
Pflotran card:: MULTIPLY
Pflotran card:: EQUALS
Calculating pore volumes
Calculating connections
Ncell= 300 Nact= 300 Nconn= 740 Nflt= 0 Npo= 0
Reading SUBSURFACE cards:
Cirrus card:: GRID
Cirrus card:: TIME
Cirrus card:: OUTPUT
Cirrus card:: MATERIAL_PROPERTY
Pflotran card:: GRID
Pflotran card:: TIME
Pflotran card:: OUTPUT
Pflotran card:: MATERIAL_PROPERTY
Name :: formation
Cirrus card:: CHARACTERISTIC_CURVES
Pflotran card:: CHARACTERISTIC_CURVES
Name :: ch1
Cirrus card:: EOS
Pflotran card:: EOS
"EOS,WATER,REFERENCE_DENSITY units" set to default value.
"EOS,WATER,DENSITY,CONSTANT units" set to default value.
"EOS,WATER,VISCOSITY,CONSTANT units" set to default value.
Cirrus card:: EOS
Pflotran card:: EOS
"EOS,OIL,FORMULA_WEIGHT units" set to default value.
Cirrus card:: EOS
Pflotran card:: EOS
"EOS,GAS,FORMULA_WEIGHT units" set to default value.
Cirrus card:: WELL_DATA
Pflotran card:: WELL_DATA
injg
Cirrus card:: WELL_DATA
Pflotran card:: WELL_DATA
prod
Cirrus card:: EQUILIBRATION
Pflotran card:: EQUILIBRATION

Cirrus card:: END_SUBSURFACE
Pflotran card:: END_SUBSURFACE
Extent of Gridded Domain
X: 152.400 - 2895.600
Y: 152.400 - 2895.600
Z: -2563.37 - -2543.56
Created default Region all.
Requested processors = 1
Degrees of freedom per cell= 3, number of phases = 3
Degrees of freedom per cell= 4, number of phases = 3
Step time tstep fopt fopr fwpr fgpr fwir fgir fwct fgor fpav NL LI Ch
days days ksm3 sm3/d sm3/d ksm3/d sm3/d ksm3/d ksm3/sm3 Bar
------ -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -------- -- -- --
Expand Down
21 changes: 12 additions & 9 deletions deploy_tests/test_cirrus.py → deploy_tests/test_pflotran.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,23 @@


def test_help() -> None:
output = subprocess.check_output(["cirrus", "-help"])
assert b"Cirrus command line options:" in output
status = subprocess.run(["pflotran", "-help"], stdout=subprocess.PIPE)
assert status.returncode == 87
assert b"Options for all PETSc programs:" in status.stdout


def test_version() -> None:
proc = subprocess.run(["cirrus", "-cirrusin", "/dev/null"], stdout=subprocess.PIPE)
proc = subprocess.run(
["pflotran", "-pflotranin", "/dev/null"], stdout=subprocess.PIPE
)

match = re.search(r"Cirrus (\d+\.\d+sv\d+)\n", proc.stdout.decode())
match = re.search(r" Pflotran (\d+\.\d+sv\d+)\+\n", proc.stdout.decode())
assert (
match
), f"Version not found in the following cirrus output: {proc.stdout.decode()}"
), f"Version not found in the following pflotran output: {proc.stdout.decode()}"

# Get the version as set by `deploy test`
version = semver.Version.parse(os.environ["cirrus_version"])
version = semver.Version.parse(os.environ["pflotran_version"])
expected_version = f"{version.major}.{version.minor}sv{version.patch}"
actual_version = match[1]

Expand All @@ -32,8 +35,8 @@ def test_version() -> None:
def test_spe1(tmp_path, snapshot) -> None:
output = subprocess.check_output(
[
"cirrus",
"-cirrusin",
"pflotran",
"-pflotranin",
DATADIR / "spe1.in",
"-output_prefix",
tmp_path / "spe1",
Expand All @@ -45,7 +48,7 @@ def test_spe1(tmp_path, snapshot) -> None:

# Replace strings that change from run to run
stdout = re.sub(
r"(Cirrus was compiled on:|Run completed, wall clock time =).*",
r"(Pflotran was compiled on:|Run completed, wall clock time =).*",
r"\1 [PRUNED]",
output.decode(),
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,16 @@ set -ex
: "${petsc:?}"
: "${src:?}"

if ! [[ -f "$tmp/six-*-.whl" ]]
then
python3 -m pip download -d "$tmp" six
fi

# --------------------------------------
# Build Cirrus
# Build Pflotran-OGS
# --------------------------------------
cd "$src/src/cirrus"
cd "$src/src/pflotran"
git reset --hard
git clean -xdf

export PETSC_DIR="$petsc"
export PETSC_ARCH=
export PYTHONPATH="$tmp/six-*-.whl"

make cirrus
make test
install -D cirrus "$out/bin/cirrus"
make UPDATE_PROVENANCE=0 pflotran
make UPDATE_PROVENANCE=0 check
install -D pflotran "$out/bin/pflotran"