Skip to content

Commit

Permalink
Merge Seg fault related PRs and few fixes (#58)
Browse files Browse the repository at this point in the history
* Merging pr 45

* merging pr 47

* Adding no-cache option to build

* let ngen build steps handle cpp test lib

* Update Dockerfile.ngen

* Added missing "

* Fix syntax error (#54)

* remove $ from build dir in build steps

* build wheel for new troute sub package

* use build module to build troute-config wheel

---------

Co-authored-by: Nels <nfrazier@lynker.com>
Co-authored-by: Arpita Patel <gagarp@gmail.com>
  • Loading branch information
3 people authored Nov 23, 2023
1 parent 43918eb commit d85f70a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 7 deletions.
3 changes: 2 additions & 1 deletion .github/action_templates/build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ runs:
tags: |
awiciroh/${{ inputs.image-name}}:latest
builder: mybuilder
no-cache: true
env:
DOCKER_BUILDKIT: 1
DOCKER_CLI_EXPERIMENTAL: enabled
DOCKER_CLI_EXPERIMENTAL: enabled
8 changes: 3 additions & 5 deletions docker/Dockerfile.ngen
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ RUN cd ${WORKDIR}/ngen \
-DNETCDF_LIBRARY=/usr/lib/libnetcdf.so \
-DNETCDF_CXX_INCLUDE_DIR=/usr/local/include \
-DNETCDF_CXX_LIBRARY=/usr/local/lib64/libnetcdf-cxx4.so ; \
cmake --build cmake_build_serial --target all -j $(nproc); \
fi \
&& if [ "${BUILD_NGEN_PARALLEL}" == "true" ]; then \
cmake -B cmake_build_parallel -S . \
Expand All @@ -149,21 +150,18 @@ RUN cd ${WORKDIR}/ngen \
-DNETCDF_LIBRARY=/usr/lib/libnetcdf.so \
-DNETCDF_CXX_INCLUDE_DIR=/usr/local/include \
-DNETCDF_CXX_LIBRARY=/usr/local/lib64/libnetcdf-cxx4.so ; \
cmake --build cmake_build_parallel --target all -j $(nproc); \
fi \
&& ln -s $(if [ "${BUILD_NGEN_PARALLEL}" == "true" ]; then echo "cmake_build_parallel"; else echo "cmake_build_serial"; fi) cmake_build \
# Build the required submodules/external libs needed for running the tests later \
# C++ functionality isn't separate, so always build the test_bmi_cpp shared lib (also needed for test_bmi_multi) \
&& ./build_sub extern/test_bmi_cpp \
# && ./build_sub extern/test_bmi_cpp \
# For the external language BMI integrations, conditionally build the test packages/libraries and run tests \
&& if [ "${NGEN_ACTIVATE_C}" == "ON" ]; then \
./build_sub extern/test_bmi_c; \
fi \
&& if [ "${NGEN_ACTIVATE_FORTRAN}" == "ON" ]; then \
./build_sub extern/test_bmi_fortran; \
fi \
&& for BUILD_DIR in $(if [ "${BUILD_NGEN_PARALLEL}" == "true" ]; then echo "cmake_build_parallel"; fi) $(if [ "${BUILD_NGEN_SERIAL}" == "true" ]; then echo "cmake_build_serial"; fi) ; do \
cmake --build $BUILD_DIR --target all -j $(nproc); \
done \
# run the serial tests \
&& cd ${WORKDIR}/ngen \
# && cmake --build cmake_build_serial --target test \
Expand Down
2 changes: 1 addition & 1 deletion docker/Dockerfile.ngen-deps
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ RUN pip3 install --upgrade pip \
&& git submodule update --init --recursive \
&& python3 -m pip install -r requirements-build.txt \
&& pip3 install . \
&& pip3 install numpy pandas pyyaml bmipy Cython netCDF4 wheel packaging \
&& pip3 install numpy pandas pyyaml bmipy Cython==3.0.3 netCDF4==1.6.3 wheel packaging \
&& HDF5_DIR=/usr pip3 install -v --no-build-isolation tables \
# Make aliases for convenience \
&& alias pip='pip3' \
Expand Down
6 changes: 6 additions & 0 deletions docker/Dockerfile.t-route
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ ARG REPO_URL \
COPY --chown=root --from=rocky_init_troute_repo ${WORKDIR}/t-route ${WORKDIR}/t-route

RUN cp -s /usr/bin/python3 /usr/bin/python \
# Install the build package to build package wheel for troute-config
&& pip install build \
#&& python(){ /usr/bin/python3 \$@; } && export -f python \
&& cd ${WORKDIR}/t-route \
&& mkdir wheels \
Expand All @@ -50,6 +52,10 @@ RUN cp -s /usr/bin/python3 /usr/bin/python \
&& cd ../troute-routing \
&& python3 setup.py --use-cython bdist_wheel \
&& cp dist/*.whl ${WORKDIR}/t-route/wheels/ \
# troute-config doesn't use setup.py, use build to make the wheel
&& cd ../troute-config \
&& python3 -m build . \
&& cp dist/*.whl ${WORKDIR}/t-route/wheels/ \
&& cd ../troute-nwm \
&& python3 setup.py bdist_wheel \
&& cp dist/*.whl ${WORKDIR}/t-route/wheels/
Expand Down

0 comments on commit d85f70a

Please sign in to comment.