From 3018f02a8781845c2f6a5d9c5f9cfa28a6a70b15 Mon Sep 17 00:00:00 2001 From: Robert Bartel Date: Thu, 18 Jul 2024 10:17:27 -0400 Subject: [PATCH] Roll back initial #678 changes. Rolling back initial changes in favor of a different approach. --- docker/main/docker-build.yml | 5 ----- docker/main/ngen/Dockerfile | 17 ++++------------- example.env | 15 --------------- python/gui/dependencies.txt | 2 +- requirements.txt | 2 +- 5 files changed, 6 insertions(+), 35 deletions(-) diff --git a/docker/main/docker-build.yml b/docker/main/docker-build.yml index 55d0e0151..c587e19bb 100644 --- a/docker/main/docker-build.yml +++ b/docker/main/docker-build.yml @@ -49,7 +49,6 @@ services: context: ./ngen target: rocky-ngen-deps args: - NUMPY_CONSTRAINT: ${NUMPY_INSTALL_CONSTRAINT:?Please set global NUMPY_INSTALL_CONSTRAINT in environment config} DOCKER_INTERNAL_REGISTRY: ${DOCKER_INTERNAL_REGISTRY:?} #depends_on: # - base @@ -60,7 +59,6 @@ services: context: ./ngen target: rocky_ngen_build_testing args: - NUMPY_CONSTRAINT: ${NUMPY_INSTALL_CONSTRAINT:?Please set global NUMPY_INSTALL_CONSTRAINT in environment config} REPO_URL: ${NGEN_REPO_URL?No NGen repo url configured} BRANCH: ${NGEN_BRANCH?No NGen branch configured} COMMIT: ${NGEN_COMMIT} @@ -79,7 +77,6 @@ services: context: ./ngen target: ngen_worker args: - NUMPY_CONSTRAINT: ${NUMPY_INSTALL_CONSTRAINT:?Please set global NUMPY_INSTALL_CONSTRAINT in environment config} REPO_URL: ${NGEN_REPO_URL?No NGen repo url configured} BRANCH: ${NGEN_BRANCH?No NGen branch configured} COMMIT: ${NGEN_COMMIT} @@ -101,7 +98,6 @@ services: context: ./ngen target: partitioner_image args: - NUMPY_CONSTRAINT: ${NUMPY_INSTALL_CONSTRAINT:?Please set global NUMPY_INSTALL_CONSTRAINT in environment config} REPO_URL: ${NGEN_REPO_URL?No NGen repo url configured} BRANCH: ${NGEN_BRANCH?No NGen branch configured} COMMIT: ${NGEN_COMMIT} @@ -118,7 +114,6 @@ services: context: ./ngen target: ngen_cal_worker args: - NUMPY_CONSTRAINT: ${NUMPY_INSTALL_CONSTRAINT:?Please set global NUMPY_INSTALL_CONSTRAINT in environment config} REPO_URL: ${NGEN_REPO_URL?No NGen repo url configured} BRANCH: ${NGEN_BRANCH?No NGen branch configured} COMMIT: ${NGEN_COMMIT} diff --git a/docker/main/ngen/Dockerfile b/docker/main/ngen/Dockerfile index 1e8069bd1..bd7a59457 100644 --- a/docker/main/ngen/Dockerfile +++ b/docker/main/ngen/Dockerfile @@ -67,9 +67,6 @@ ARG MPICH_VERSION="3.3.2" ARG MIN_PYTHON="3.8.0" ARG BLOSC2_VERSION -# Necessry to control specific numpy version after release of 2.0 and prior to fully support by all NextGen ecosystem -ARG NUMPY_CONSTRAINT - ARG NETCDF_C_VERSION=4.8.1 ARG NETCDF_CXX_VERSION=4.3.1 ARG NETCDF_FORTRAN_VERSION=4.6.0 @@ -292,15 +289,14 @@ RUN if [[ "${NETCDF_CXX_VERSION}" == "latest" ]]; then \ FROM rocky-base as rocky-ngen-packaged-deps ARG ROCKY_NGEN_DEPS_REQUIRED -ARG NUMPY_CONSTRAINT # TODO: later, go back and change all pip3/python3 to just pip/python (but leave for now to limit scope) -# Note that this includes numpy, which is needed for Python BMI support, regardless of BMI module +# Note that this includes numpy, which is needed for Python BMI support, regardless of BMI module USER root RUN dnf update -y && dnf install -y ${ROCKY_NGEN_DEPS_REQUIRED} && dnf clean -y all \ && ln -s $(which python3) $(which python3 | sed 's/python3/python/') \ && pip install --no-cache-dir "pip>=23.0,<23.1" wheel packaging \ - && if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then pip install --no-cache-dir numpy${NUMPY_CONSTRAINT}; fi + && if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then pip install --no-cache-dir numpy; fi USER ${USER} ################################################################################################################ @@ -654,8 +650,6 @@ ARG BUILD_TOPMODEL ARG BUILD_PET ARG BUILD_SLOTH -ARG NUMPY_CONSTRAINT - COPY --chown=${USER} --from=rocky_init_repo ${WORKDIR}/ngen ${WORKDIR}/ngen COPY --chown=${USER} --from=rocky_build_troute ${WORKDIR}/t-route/wheels /tmp/t-route-wheels COPY --chown=${USER} --from=rocky_build_troute ${WORKDIR}/t-route/src/kernel /tmp/t-route-kernels @@ -670,9 +664,8 @@ RUN if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then \ USER ${USER} ENV VIRTUAL_ENV=/dmod/venv -RUN python3 -m venv $VIRTUAL_ENV +RUN python3 -m venv $VIRTUAL_ENV && pip3 install numpy ENV PATH="$VIRTUAL_ENV/bin:$PATH" -RUN if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then pip install numpy${NUMPY_CONSTRAINT} ; fi RUN cd ${BOOST_ROOT} \ && tar -xf boost_tarball.blob --strip 1 \ @@ -788,8 +781,6 @@ FROM rocky-ngen-deps as rocky_ngen_build_testing #FROM rocky_build_ngen as rocky_ngen_build_testing #FROM ${DOCKER_INTERNAL_REGISTRY}/ngen-deps:latest as rocky_ngen_build_testing -ARG NUMPY_CONSTRAINT - COPY --chown=${USER} --from=rocky_init_repo ${WORKDIR}/ngen ${WORKDIR}/ngen ENV BOOST_ROOT=${WORKDIR}/boost @@ -804,7 +795,7 @@ USER ${USER} ENV VIRTUAL_ENV=/dmod/venv RUN if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then python3 -m venv ${VIRTUAL_ENV} ; fi ENV PATH="$VIRTUAL_ENV/bin:$PATH" -RUN if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then pip install numpy${NUMPY_CONSTRAINT} ; fi +RUN if [ "${NGEN_WITH_PYTHON}" == "ON" ]; then pip install numpy ; fi RUN cd ${BOOST_ROOT} && tar -xf boost_tarball.blob --strip 1 && rm boost_tarball.blob ENV BOOST_ROOT=${WORKDIR}/boost diff --git a/example.env b/example.env index c0cf82129..16b2bc94e 100644 --- a/example.env +++ b/example.env @@ -192,21 +192,6 @@ PYCHARM_REMOTE_DEBUG_SERVER_PORT_GUI=55875 ## Path string for Pycharm remote debug package egg #PYCHARM_REMOTE_DEBUG_EGG_PATH= -################################################################################ -################################################################################ -## Numpy Settings ## -################################################################################ -################################################################################ - -## Version of Numpy to select when installing (e.g., within Docker images) -## Note that this probably needs to stay in sync with what is in a few other places -## that don't read directly from this file: -## - requirement.txt -## - python/gui/dependencies.txt -# Note: mind the consecutive equal signs; the value being set here is '==1.26.4' -NUMPY_INSTALL_CONSTRAINT===1.26.4 - - ################################################################################ ################################################################################ ## Docker Settings ## diff --git a/python/gui/dependencies.txt b/python/gui/dependencies.txt index fb4a267a3..82c66ba24 100644 --- a/python/gui/dependencies.txt +++ b/python/gui/dependencies.txt @@ -17,4 +17,4 @@ channels channels-redis djangorestframework psycopg2-binary # TODO: get source package in future. Note that psycopg2 cannot be used on Mac; psycopg2-binary must be used -numpy==1.26.4 +numpy diff --git a/requirements.txt b/requirements.txt index eac573be2..67aa677e3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -20,7 +20,7 @@ python-dotenv djangorestframework git+https://github.com/noaa-owp/hypy@master#egg=hypy&subdirectory=python hydrotools.nwis-client -numpy==1.26.4 +numpy scikit-learn minio uri