Skip to content

Commit a333469

Browse files
committed
Add pygeosx unit tests to CI with Ubuntu 22 Images
1 parent 672d300 commit a333469

File tree

5 files changed

+44
-4
lines changed

5 files changed

+44
-4
lines changed

.devcontainer/devcontainer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"build": {
33
"dockerfile": "Dockerfile",
44
"args": {
5-
"GEOS_TPL_TAG": "307-681"
5+
"GEOS_TPL_TAG": "259-705"
66
}
77
},
88
"runArgs": [

.github/workflows/build_and_test.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,9 @@ on:
4242
ENABLE_HYPRE_DEVICE:
4343
required: false
4444
type: string
45+
ENABLE_PYGEOSX:
46+
required: false
47+
type: string
4548
ENABLE_TRILINOS:
4649
required: false
4750
type: string
@@ -230,6 +233,12 @@ jobs:
230233
script_args+=(--enable-hypre-device "${{ inputs.ENABLE_HYPRE_DEVICE }}")
231234
fi
232235
236+
237+
# pygeosx testing
238+
if [ "${{ inputs.ENABLE_PYGEOSX }}" == 'ON' ]; then
239+
script_args+=(--run-pygeosx-tests)
240+
fi
241+
233242
docker_args+=(--cap-add=SYS_PTRACE --rm)
234243
235244
script_args+=(--cmake-build-type ${{ inputs.CMAKE_BUILD_TYPE }})

.github/workflows/ci_tests.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ jobs:
183183
GEOS_ENABLE_BOUNDS_CHECK: OFF
184184
GCP_BUCKET: geosx/ubuntu22.04-gcc11
185185
HOST_CONFIG: /spack-generated.cmake
186+
ENABLE_PYGEOSX: ON
186187

187188
- name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2)
188189
CMAKE_BUILD_TYPE: Release
@@ -193,6 +194,7 @@ jobs:
193194
BUILD_SHARED_LIBS: ON
194195
GEOS_ENABLE_BOUNDS_CHECK: ON
195196
HOST_CONFIG: /spack-generated.cmake
197+
ENABLE_PYGEOSX: ON
196198

197199
- name: Ubuntu (22.04, gcc 12.3.0, open-mpi 4.1.2) - NO BOUNDS CHECK
198200
CMAKE_BUILD_TYPE: Release
@@ -203,6 +205,7 @@ jobs:
203205
BUILD_SHARED_LIBS: ON
204206
GEOS_ENABLE_BOUNDS_CHECK: OFF
205207
HOST_CONFIG: /spack-generated.cmake
208+
ENABLE_PYGEOSX: ON
206209

207210
- name: Ubuntu (22.04, clang 15.0.7, open-mpi 4.1.2)
208211
CMAKE_BUILD_TYPE: Release
@@ -212,6 +215,7 @@ jobs:
212215
GEOS_ENABLE_BOUNDS_CHECK: ON
213216
BUILD_SHARED_LIBS: ON
214217
HOST_CONFIG: /spack-generated.cmake
218+
ENABLE_PYGEOSX: ON
215219

216220
- name: Sherlock CPU (centos 7.9.2009, gcc 10.1.0, open-mpi 4.1.2, openblas 0.3.10)
217221
CMAKE_BUILD_TYPE: Release
@@ -231,6 +235,7 @@ jobs:
231235
DOCKER_IMAGE_TAG: ${{ needs.is_not_draft_pull_request.outputs.DOCKER_IMAGE_TAG }}
232236
DOCKER_REPOSITORY: ${{ matrix.DOCKER_REPOSITORY }}
233237
ENABLE_HYPRE: ${{ matrix.ENABLE_HYPRE }}
238+
ENABLE_PYGEOSX: ${{ matrix.ENABLE_PYGEOSX }}
234239
ENABLE_TRILINOS: ${{ matrix.ENABLE_TRILINOS }}
235240
GEOS_ENABLE_BOUNDS_CHECK: ${{ matrix.GEOS_ENABLE_BOUNDS_CHECK }}
236241
GCP_BUCKET: ${{ matrix.GCP_BUCKET }}

host-configs/environment.cmake

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ else()
2424
set(ENABLE_HYPRE OFF CACHE BOOL "" FORCE)
2525
endif()
2626

27+
# pygeosx
28+
if(NOT DEFINED ENABLE_PYGEOSX)
29+
set(ENABLE_PYGEOSX "$ENV{ENABLE_PYGEOSX}" CACHE BOOL "" FORCE)
30+
endif()
31+
if(ENABLE_PYGEOSX)
32+
set(Python3_EXECUTABLE /usr/bin/python3 CACHE PATH "")
33+
set(ENABLE_PYLVARRAY ON CACHE BOOL "")
34+
else()
35+
set(ENABLE_PYGEOSX OFF CACHE BOOL "" FORCE)
36+
endif()
37+
2738
# Same pattern
2839
if(NOT DEFINED ENABLE_TRILINOS)
2940
set(ENABLE_TRILINOS "$ENV{ENABLE_TRILINOS}" CACHE BOOL "" FORCE)

scripts/ci_build_and_test_in_container.sh

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,9 @@ Usage: $0
6363
--nproc N
6464
Number of cores to use for the build.
6565
--repository /path/to/repository
66-
Internal mountpoint where the geos repository will be available.
66+
Internal mountpoint where the geos repository will be available.
67+
--run-pygeosx-tests
68+
Runs the pygeosx tests.
6769
--run-integrated-tests
6870
Run the integrated tests. Then bundle and send the results to the cloud.
6971
--sccache-credentials credentials.json
@@ -79,7 +81,7 @@ exit 1
7981
# Then we'll move to the build dir.
8082
or_die cd $(dirname $0)/..
8183

82-
args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,geos-enable-bounds-check:,enable-hypre:,enable-hypre-device:,enable-trilinos:,exchange-dir:,host-config:,install-dir-basename:,makefile,ninja,no-install-schema,no-run-unit-tests,nproc:,repository:,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@")
84+
args=$(or_die getopt -a -o h --long build-exe-only,cmake-build-type:,code-coverage,data-basename:,geos-enable-bounds-check:,enable-hypre:,enable-hypre-device:,enable-trilinos:,exchange-dir:,host-config:,install-dir-basename:,makefile,ninja,no-install-schema,no-run-unit-tests,nproc:,repository:,run-pygeosx-tests,run-integrated-tests,sccache-credentials:,test-code-style,test-documentation,help -- "$@")
8385

8486
# Variables with default values
8587
BUILD_EXE_ONLY=false
@@ -90,6 +92,7 @@ ENABLE_HYPRE=ON
9092
ENABLE_HYPRE_DEVICE=CPU
9193
GEOS_LA_INTERFACE=Hypre
9294
RUN_UNIT_TESTS=true
95+
RUN_PYGEOSX_TESTS=false
9396
RUN_INTEGRATED_TESTS=false
9497
UPLOAD_TEST_BASELINES=false
9598
TEST_CODE_STYLE=false
@@ -133,6 +136,7 @@ do
133136
--no-run-unit-tests) RUN_UNIT_TESTS=false; shift;;
134137
--nproc) NPROC=$2; shift 2;;
135138
--repository) GEOS_SRC_DIR=$2; shift 2;;
139+
--run-pygeosx-tests) RUN_PYGEOSX_TESTS=true; shift;;
136140
--run-integrated-tests) RUN_INTEGRATED_TESTS=true; shift;;
137141
--upload-test-baselines) UPLOAD_TEST_BASELINES=true; shift;;
138142
--code-coverage) CODE_COVERAGE=true; shift;;
@@ -225,6 +229,10 @@ if [[ "${RUN_INTEGRATED_TESTS}" = true ]]; then
225229
ATS_CMAKE_ARGS="-DATS_ARGUMENTS=\"--machine openmpi --ats openmpi_mpirun=/usr/bin/mpirun --ats openmpi_args=--allow-run-as-root --ats openmpi_procspernode=32 --ats openmpi_maxprocs=32\" -DPython3_ROOT_DIR=${ATS_PYTHON_HOME} -DPython3_EXECUTABLE=${ATS_PYTHON_HOME}/bin/python3 -DATS_BASELINE_DIR=${ATS_BASELINE_DIR} -DATS_WORKING_DIR=${ATS_WORKING_DIR}"
226230
fi
227231

232+
# Set CMake options for pygeosx testing
233+
if [[ "${RUN_PYGEOSX_TESTS}" = true ]]; then
234+
PYGEOSX_CMAKE_ARGS="-DENABLE_PYGEOSX=ON -DENABLE_PYLVARRAY=ON"
235+
fi
228236

229237
if [[ "${CODE_COVERAGE}" = true ]]; then
230238
or_die apt-get update
@@ -260,7 +268,8 @@ or_die python3 scripts/config-build.py \
260268
-DENABLE_COVERAGE=$([[ "${CODE_COVERAGE}" = true ]] && echo 1 || echo 0) \
261269
-DGEOS_ENABLE_BOUNDS_CHECK=${GEOS_ENABLE_BOUNDS_CHECK} \
262270
${SCCACHE_CMAKE_ARGS} \
263-
${ATS_CMAKE_ARGS}
271+
${ATS_CMAKE_ARGS} \
272+
${PYGEOSX_CMAKE_ARGS}
264273

265274
# The configuration step is now over, we can now move to the build directory for the build!
266275
or_die cd ${GEOS_BUILD_DIR}
@@ -284,6 +293,12 @@ else
284293
or_die cmake --build . -j $NPROC
285294
or_die cmake --install .
286295

296+
if [[ "${RUN_PYGEOSX_TESTS}" = true ]]; then
297+
or_die ninja pygeosx
298+
or_die ninja geosx_python_tools
299+
or_die ninja pygeosx_unit_tests
300+
fi
301+
287302
if [[ ! -z "${DATA_BASENAME_WE}" ]]; then
288303
# Here we pack the installation.
289304
# The `--transform` parameter provides consistency between the tarball name and the unpacked folder.

0 commit comments

Comments
 (0)