Skip to content

Commit

Permalink
Roll back initial #678 changes.
Browse files Browse the repository at this point in the history
Rolling back initial changes in favor of a different approach.
  • Loading branch information
robertbartel committed Jul 29, 2024
1 parent 78b2f4c commit 3018f02
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 35 deletions.
5 changes: 0 additions & 5 deletions docker/main/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand All @@ -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}
Expand Down
17 changes: 4 additions & 13 deletions docker/main/ngen/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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}

################################################################################################################
Expand Down Expand Up @@ -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
Expand All @@ -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 \
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
15 changes: 0 additions & 15 deletions example.env
Original file line number Diff line number Diff line change
Expand Up @@ -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 ##
Expand Down
2 changes: 1 addition & 1 deletion python/gui/dependencies.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 3018f02

Please sign in to comment.