From b684ef24ad4620c5ee2eda8b227712b3d6399aa6 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Wed, 29 Apr 2026 13:33:26 -0400 Subject: [PATCH 01/13] Create codespace with existing dockerfile --- .devcontainer/Dockerfile | 186 ++++++++++++++++++++++++++++++++ .devcontainer/devcontainer.json | 8 ++ 2 files changed, 194 insertions(+) create mode 100644 .devcontainer/Dockerfile create mode 100644 .devcontainer/devcontainer.json diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile new file mode 100644 index 0000000..0a6c0b2 --- /dev/null +++ b/.devcontainer/Dockerfile @@ -0,0 +1,186 @@ +FROM --platform=linux/amd64 quay.io/jupyter/datascience-notebook + +SHELL ["/bin/bash", "+o", "pipefail", "-c"] + +# Non interactive mode +ENV DEBIAN_FRONTEND noninteractive + +USER root +# Fetch the latest definitions of packages +RUN apt-get update && \ + ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ + apt-get install -y tzdata && \ + dpkg-reconfigure --frontend noninteractive tzdata && \ + apt-get install -y \ + build-essential \ + curl \ + libcurl4 \ + git \ + vim \ + gfortran \ + libopenblas-dev \ + liblapack-dev \ + openssh-client \ + openssh-server \ + openmpi-bin \ + libopenmpi-dev \ + python3 \ + python3-pip \ + python3-venv \ + tcl-dev \ + tk-dev + +USER jovyan +WORKDIR /home/jovyan/ +ENV BASE_PATH /home/jovyan/ + +RUN mkdir -p \ + $BASE_PATH/parflow/build \ + $BASE_PATH/parflow/dependencies/cmake \ + $BASE_PATH/parflow/dependencies/silo-src \ + $BASE_PATH/parflow/dependencies/hdf5-src \ + $BASE_PATH/parflow/dependencies/hypre-src \ + $BASE_PATH/parflow/dependencies/netcdf-src + +# ----------------------------------------------------------------------------- +# Setup CMake 3.1 8.2 +# ----------------------------------------------------------------------------- + +ARG CMAKE_URL=https://cmake.org/files/LatestRelease/cmake-3.29.0-linux-x86_64.tar.gz + +RUN cd $BASE_PATH/parflow/dependencies/cmake && \ + curl -L $CMAKE_URL | tar --strip-components=1 -xzv + +ENV CMAKE $BASE_PATH/parflow/dependencies/cmake/bin/cmake +ENV CTEST $BASE_PATH/parflow/dependencies/cmake/bin/ctest + +# ----------------------------------------------------------------------------- +# Install HDF5 +# ----------------------------------------------------------------------------- + +ARG HDF5_URL=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz + +ENV HDF5_DIR /opt/hdf5 + +WORKDIR $BASE_PATH/parflow/dependencies/hdf5-src +RUN curl -L $HDF5_URL | tar --strip-components=1 -xzv && \ + CC=mpicc ./configure \ + --prefix=$HDF5_DIR \ + --enable-parallel && \ + make + +USER root +RUN make install +USER jovyan + +# ----------------------------------------------------------------------------- +# Install NetCDF +# ----------------------------------------------------------------------------- + +ARG NETCDF_URL=https://github.com/Unidata/netcdf-c/archive/v4.7.4.tar.gz + +ENV NETCDF_DIR /opt/netcdf + +WORKDIR $BASE_PATH/parflow/dependencies/netcdf-src +RUN curl -L $NETCDF_URL | tar --strip-components=1 -xzv && \ + CC=mpicc CPPFLAGS=-I$HDF5_DIR/include LDFLAGS=-L$HDF5_DIR/lib \ + ./configure --disable-shared --disable-dap --prefix=${NETCDF_DIR} && \ + make + +USER root +RUN make install +USER jovyan + +# ----------------------------------------------------------------------------- +# Install SILO +# ----------------------------------------------------------------------------- + +#ARG SILO_URL=https://wci.llnl.gov/sites/wci/files/2021-01/silo-4.10.2.tgz + +#ENV SILO_DIR /opt/silo + +#WORKDIR $BASE_PATH/parflow/dependencies/silo-src +#RUN curl -L $SILO_URL | tar --strip-components=1 -xzv && \ +# ./configure --prefix=$SILO_DIR --disable-silex --disable-hzip --disable-fpzip && \ +# make + +#USER root +#RUN make install +#USER jovyan + + +# ----------------------------------------------------------------------------- +# Install Hypre +# ----------------------------------------------------------------------------- + +ARG HYPRE_VERSION=v2.19.0 + +ENV HYPRE_DIR /opt/hypre + +WORKDIR $BASE_PATH/parflow/dependencies/hypre-src +RUN git clone https://github.com/hypre-space/hypre.git --single-branch --branch $HYPRE_VERSION + +WORKDIR $BASE_PATH/parflow/dependencies/hypre-src/hypre/src +RUN ./configure --prefix=$HYPRE_DIR --with-MPI + +USER root +RUN make install +USER jovyan + + +# ----------------------------------------------------------------------------- +# Install Parflow +# ----------------------------------------------------------------------------- + +#COPY --chown=ubuntu:ubuntu . $BASE_PATH/parflow/src +#RUN pip3 install -r $BASE_PATH/parflow/src/pftools/python/requirements_all.txt + + +# ARG PARFLOW_VERSION=master +# ARG PARFLOW_GIT_URL= +# RUN git clone \ +# --recursive --single-branch \ +# --branch $PARFLOW_VERSION \ +# $PARFLOW_GIT_URL \ +# $BASE_PATH/parflow/src + +RUN git clone -b master --depth 1 --single-branch https://github.com/parflow/parflow.git $BASE_PATH/parflow/src + +RUN $CMAKE \ + -S $BASE_PATH/parflow/src \ + -B $BASE_PATH/parflow/build \ + -D CMAKE_BUILD_TYPE=Release \ + -D HDF5_ROOT=$HDF5_DIR \ + -D PARFLOW_ENABLE_HDF5=TRUE \ + -D HYPRE_ROOT=$HYPRE_DIR \ + -D PARFLOW_ENABLE_HYPRE=TRUE \ + -D PARFLOW_ENABLE_SILO=TRUE \ + -D SILO_ROOT=$SILO_DIR \ + -D PARFLOW_HAVE_CLM=TRUE \ + -D PARFLOW_ENABLE_PYTHON=TRUE \ + -D PARFLOW_ENABLE_TIMING=TRUE \ + -D PARFLOW_AMPS_LAYER=mpi1 \ + -D PARFLOW_AMPS_SEQUENTIAL_IO=TRUE \ + -D PARFLOW_ENABLE_NETCDF=TRUE \ + -D NETCDF_DIR=$NETCDF_DIR \ + -D CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 + +RUN $CMAKE --build $BASE_PATH/parflow/build + +USER root +RUN $CMAKE --install $BASE_PATH/parflow/build --prefix /opt/parflow +USER jovyan + +RUN pip3 install \ + "subsettools>=2.0.1" \ + "hf_hydrodata>=1.4.3" \ + "matplotlib>=3.7.2" \ + "bokeh>=3.3.0" \ + jupyter \ + ipykernel + +ENV PARFLOW_DIR /opt/parflow/ +ENV LD_LIBRARY_PATH=/opt/parflow/lib:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH=/opt/hypre/lib:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH=/usr/include/:$LD_LIBRARY_PATH +WORKDIR /home/jovyan \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json new file mode 100644 index 0000000..9e1acc3 --- /dev/null +++ b/.devcontainer/devcontainer.json @@ -0,0 +1,8 @@ +{ + "name": "Subsetting ShortCourse", + "build": { + "dockerfile": "Dockerfile", + "context": ".." + }, + "postCreateCommand": "python -m ipykernel install --user --name subsetting-shortcourse --display-name \"Python (Subsetting ShortCourse)\"" +} From b96265cdcbfffc7cf4c5ec43fb099d87b32b08d8 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Wed, 29 Apr 2026 13:43:47 -0400 Subject: [PATCH 02/13] Fix cmake version --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 0a6c0b2..80c6c5a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -46,7 +46,7 @@ RUN mkdir -p \ # Setup CMake 3.1 8.2 # ----------------------------------------------------------------------------- -ARG CMAKE_URL=https://cmake.org/files/LatestRelease/cmake-3.29.0-linux-x86_64.tar.gz +ARG CMAKE_URL=https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz RUN cd $BASE_PATH/parflow/dependencies/cmake && \ curl -L $CMAKE_URL | tar --strip-components=1 -xzv From 8c03cd98b4d43ed8b375e06c7788fbdd13d11282 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Wed, 29 Apr 2026 14:12:30 -0400 Subject: [PATCH 03/13] Fix linker issues --- .devcontainer/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 80c6c5a..ae4751a 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -162,7 +162,8 @@ RUN $CMAKE \ -D PARFLOW_AMPS_LAYER=mpi1 \ -D PARFLOW_AMPS_SEQUENTIAL_IO=TRUE \ -D PARFLOW_ENABLE_NETCDF=TRUE \ - -D NETCDF_DIR=$NETCDF_DIR \ + -D NETCDF_DIR=$NETCDF_DIR \ + -D CMAKE_EXE_LINKER_FLAGS="-Wl,--no-as-needed -L$HDF5_DIR/lib -lhdf5_hl -lhdf5 -ldl -lz -lm" \ -D CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 RUN $CMAKE --build $BASE_PATH/parflow/build From 2c8a900c7c36e2670a9df58d46f10e9f8aef2f64 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Wed, 29 Apr 2026 14:36:33 -0400 Subject: [PATCH 04/13] Fix linker errors --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index ae4751a..2bd77c2 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -163,7 +163,7 @@ RUN $CMAKE \ -D PARFLOW_AMPS_SEQUENTIAL_IO=TRUE \ -D PARFLOW_ENABLE_NETCDF=TRUE \ -D NETCDF_DIR=$NETCDF_DIR \ - -D CMAKE_EXE_LINKER_FLAGS="-Wl,--no-as-needed -L$HDF5_DIR/lib -lhdf5_hl -lhdf5 -ldl -lz -lm" \ + -D CMAKE_EXE_LINKER_FLAGS="-Wl,--no-as-needed -L$HDF5_DIR/lib -lhdf5_hl -lhdf5 -ldl -lz -lm -lmvec" \ -D CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 RUN $CMAKE --build $BASE_PATH/parflow/build From f2ae8853a21db9a412d629c86c79b4563b193d51 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Wed, 29 Apr 2026 14:55:41 -0400 Subject: [PATCH 05/13] Fix persmissions issue --- .devcontainer/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 2bd77c2..f89fd88 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -166,9 +166,8 @@ RUN $CMAKE \ -D CMAKE_EXE_LINKER_FLAGS="-Wl,--no-as-needed -L$HDF5_DIR/lib -lhdf5_hl -lhdf5 -ldl -lz -lm -lmvec" \ -D CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 -RUN $CMAKE --build $BASE_PATH/parflow/build - USER root +RUN $CMAKE --build $BASE_PATH/parflow/build RUN $CMAKE --install $BASE_PATH/parflow/build --prefix /opt/parflow USER jovyan From fc312327148da89dd6412cdc85930fea207fde26 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 11:34:30 -0400 Subject: [PATCH 06/13] Change base image --- .devcontainer/Dockerfile | 88 +++++++++++++++------------------------- 1 file changed, 32 insertions(+), 56 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f89fd88..8672e3b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,11 +1,11 @@ -FROM --platform=linux/amd64 quay.io/jupyter/datascience-notebook +ARG BASE_IMAGE=ubuntu:20.04 +FROM ${BASE_IMAGE} SHELL ["/bin/bash", "+o", "pipefail", "-c"] # Non interactive mode -ENV DEBIAN_FRONTEND noninteractive +ENV DEBIAN_FRONTEND=noninteractive -USER root # Fetch the latest definitions of packages RUN apt-get update && \ ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \ @@ -28,11 +28,15 @@ RUN apt-get update && \ python3-pip \ python3-venv \ tcl-dev \ - tk-dev + tk-dev && \ + rm -rf /var/lib/apt/lists/* + +RUN groupadd -g 1000 ubuntu && \ + useradd -u 1000 -g ubuntu -m -N -s /bin/bash ubuntu -USER jovyan -WORKDIR /home/jovyan/ -ENV BASE_PATH /home/jovyan/ +USER ubuntu +WORKDIR /home/ubuntu/ +ENV BASE_PATH=/home/ubuntu/ RUN mkdir -p \ $BASE_PATH/parflow/build \ @@ -43,7 +47,7 @@ RUN mkdir -p \ $BASE_PATH/parflow/dependencies/netcdf-src # ----------------------------------------------------------------------------- -# Setup CMake 3.1 8.2 +# Setup CMake # ----------------------------------------------------------------------------- ARG CMAKE_URL=https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz @@ -51,8 +55,8 @@ ARG CMAKE_URL=https://cmake.org/files/v3.29/cmake-3.29.0-linux-x86_64.tar.gz RUN cd $BASE_PATH/parflow/dependencies/cmake && \ curl -L $CMAKE_URL | tar --strip-components=1 -xzv -ENV CMAKE $BASE_PATH/parflow/dependencies/cmake/bin/cmake -ENV CTEST $BASE_PATH/parflow/dependencies/cmake/bin/ctest +ENV CMAKE=$BASE_PATH/parflow/dependencies/cmake/bin/cmake +ENV CTEST=$BASE_PATH/parflow/dependencies/cmake/bin/ctest # ----------------------------------------------------------------------------- # Install HDF5 @@ -60,7 +64,7 @@ ENV CTEST $BASE_PATH/parflow/dependencies/cmake/bin/ctest ARG HDF5_URL=https://support.hdfgroup.org/ftp/HDF5/releases/hdf5-1.12/hdf5-1.12.0/src/hdf5-1.12.0.tar.gz -ENV HDF5_DIR /opt/hdf5 +ENV HDF5_DIR=/opt/hdf5 WORKDIR $BASE_PATH/parflow/dependencies/hdf5-src RUN curl -L $HDF5_URL | tar --strip-components=1 -xzv && \ @@ -71,7 +75,7 @@ RUN curl -L $HDF5_URL | tar --strip-components=1 -xzv && \ USER root RUN make install -USER jovyan +USER ubuntu # ----------------------------------------------------------------------------- # Install NetCDF @@ -79,7 +83,7 @@ USER jovyan ARG NETCDF_URL=https://github.com/Unidata/netcdf-c/archive/v4.7.4.tar.gz -ENV NETCDF_DIR /opt/netcdf +ENV NETCDF_DIR=/opt/netcdf WORKDIR $BASE_PATH/parflow/dependencies/netcdf-src RUN curl -L $NETCDF_URL | tar --strip-components=1 -xzv && \ @@ -89,25 +93,7 @@ RUN curl -L $NETCDF_URL | tar --strip-components=1 -xzv && \ USER root RUN make install -USER jovyan - -# ----------------------------------------------------------------------------- -# Install SILO -# ----------------------------------------------------------------------------- - -#ARG SILO_URL=https://wci.llnl.gov/sites/wci/files/2021-01/silo-4.10.2.tgz - -#ENV SILO_DIR /opt/silo - -#WORKDIR $BASE_PATH/parflow/dependencies/silo-src -#RUN curl -L $SILO_URL | tar --strip-components=1 -xzv && \ -# ./configure --prefix=$SILO_DIR --disable-silex --disable-hzip --disable-fpzip && \ -# make - -#USER root -#RUN make install -#USER jovyan - +USER ubuntu # ----------------------------------------------------------------------------- # Install Hypre @@ -115,7 +101,7 @@ USER jovyan ARG HYPRE_VERSION=v2.19.0 -ENV HYPRE_DIR /opt/hypre +ENV HYPRE_DIR=/opt/hypre WORKDIR $BASE_PATH/parflow/dependencies/hypre-src RUN git clone https://github.com/hypre-space/hypre.git --single-branch --branch $HYPRE_VERSION @@ -125,26 +111,14 @@ RUN ./configure --prefix=$HYPRE_DIR --with-MPI USER root RUN make install -USER jovyan - +USER ubuntu # ----------------------------------------------------------------------------- # Install Parflow # ----------------------------------------------------------------------------- -#COPY --chown=ubuntu:ubuntu . $BASE_PATH/parflow/src -#RUN pip3 install -r $BASE_PATH/parflow/src/pftools/python/requirements_all.txt - - -# ARG PARFLOW_VERSION=master -# ARG PARFLOW_GIT_URL= -# RUN git clone \ -# --recursive --single-branch \ -# --branch $PARFLOW_VERSION \ -# $PARFLOW_GIT_URL \ -# $BASE_PATH/parflow/src - -RUN git clone -b master --depth 1 --single-branch https://github.com/parflow/parflow.git $BASE_PATH/parflow/src +COPY --chown=ubuntu:ubuntu . $BASE_PATH/parflow/src +RUN pip3 install -r $BASE_PATH/parflow/src/pftools/python/requirements_all.txt RUN $CMAKE \ -S $BASE_PATH/parflow/src \ @@ -154,8 +128,6 @@ RUN $CMAKE \ -D PARFLOW_ENABLE_HDF5=TRUE \ -D HYPRE_ROOT=$HYPRE_DIR \ -D PARFLOW_ENABLE_HYPRE=TRUE \ - -D PARFLOW_ENABLE_SILO=TRUE \ - -D SILO_ROOT=$SILO_DIR \ -D PARFLOW_HAVE_CLM=TRUE \ -D PARFLOW_ENABLE_PYTHON=TRUE \ -D PARFLOW_ENABLE_TIMING=TRUE \ @@ -167,9 +139,15 @@ RUN $CMAKE \ -D CURL_LIBRARY=/usr/lib/x86_64-linux-gnu/libcurl.so.4 USER root +ENV HOME=/root RUN $CMAKE --build $BASE_PATH/parflow/build RUN $CMAKE --install $BASE_PATH/parflow/build --prefix /opt/parflow -USER jovyan +USER ubuntu +ENV HOME=/home/ubuntu + +# ----------------------------------------------------------------------------- +# Python packages for notebooks/utilities +# ----------------------------------------------------------------------------- RUN pip3 install \ "subsettools>=2.0.1" \ @@ -179,8 +157,6 @@ RUN pip3 install \ jupyter \ ipykernel -ENV PARFLOW_DIR /opt/parflow/ -ENV LD_LIBRARY_PATH=/opt/parflow/lib:$LD_LIBRARY_PATH -ENV LD_LIBRARY_PATH=/opt/hypre/lib:$LD_LIBRARY_PATH -ENV LD_LIBRARY_PATH=/usr/include/:$LD_LIBRARY_PATH -WORKDIR /home/jovyan \ No newline at end of file +ENV PARFLOW_DIR=/opt/parflow/ +ENV LD_LIBRARY_PATH=/opt/parflow/lib:/opt/hypre/lib:/usr/include/:$LD_LIBRARY_PATH +WORKDIR /home/ubuntu/ \ No newline at end of file From bde1580577767048024075e6b7001427ff7986b6 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 12:16:09 -0400 Subject: [PATCH 07/13] Fix venv issue --- .devcontainer/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 8672e3b..cb7036c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -118,7 +118,6 @@ USER ubuntu # ----------------------------------------------------------------------------- COPY --chown=ubuntu:ubuntu . $BASE_PATH/parflow/src -RUN pip3 install -r $BASE_PATH/parflow/src/pftools/python/requirements_all.txt RUN $CMAKE \ -S $BASE_PATH/parflow/src \ From 6696ae89f21dfd497a9cdb83b6e04212fb9880e6 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 12:44:16 -0400 Subject: [PATCH 08/13] Clone parflow repo --- .devcontainer/Dockerfile | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index cb7036c..9159f71 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -117,7 +117,9 @@ USER ubuntu # Install Parflow # ----------------------------------------------------------------------------- -COPY --chown=ubuntu:ubuntu . $BASE_PATH/parflow/src +RUN git clone -b master --depth 1 --single-branch \ + https://github.com/parflow/parflow.git \ + $BASE_PATH/parflow/src RUN $CMAKE \ -S $BASE_PATH/parflow/src \ From 1bfdd18911edcd270ee0081f65fbc112d5aea22b Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 13:53:46 -0400 Subject: [PATCH 09/13] Update Ubuntu version --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 9159f71..090079e 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -ARG BASE_IMAGE=ubuntu:20.04 +ARG BASE_IMAGE=ubuntu:24.04 FROM ${BASE_IMAGE} SHELL ["/bin/bash", "+o", "pipefail", "-c"] From 2a80312ad9577ebbf42a3cf4c088c62fae882ee6 Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 14:00:36 -0400 Subject: [PATCH 10/13] Fix user creation bug --- .devcontainer/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 090079e..fecec5c 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -31,8 +31,8 @@ RUN apt-get update && \ tk-dev && \ rm -rf /var/lib/apt/lists/* -RUN groupadd -g 1000 ubuntu && \ - useradd -u 1000 -g ubuntu -m -N -s /bin/bash ubuntu +RUN getent group ubuntu >/dev/null || groupadd -g 1000 ubuntu && \ + id -u ubuntu >/dev/null 2>&1 || useradd -u 1000 -g ubuntu -m -N -s /bin/bash ubuntu USER ubuntu WORKDIR /home/ubuntu/ From 43b90c02b64b44a24767a95c1df760e4242309eb Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 14:20:52 -0400 Subject: [PATCH 11/13] Create separate virtual environment --- .devcontainer/Dockerfile | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index fecec5c..4e7729b 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -130,7 +130,6 @@ RUN $CMAKE \ -D HYPRE_ROOT=$HYPRE_DIR \ -D PARFLOW_ENABLE_HYPRE=TRUE \ -D PARFLOW_HAVE_CLM=TRUE \ - -D PARFLOW_ENABLE_PYTHON=TRUE \ -D PARFLOW_ENABLE_TIMING=TRUE \ -D PARFLOW_AMPS_LAYER=mpi1 \ -D PARFLOW_AMPS_SEQUENTIAL_IO=TRUE \ @@ -147,16 +146,20 @@ USER ubuntu ENV HOME=/home/ubuntu # ----------------------------------------------------------------------------- -# Python packages for notebooks/utilities +# Python virtual environment for notebooks/utilities # ----------------------------------------------------------------------------- -RUN pip3 install \ - "subsettools>=2.0.1" \ - "hf_hydrodata>=1.4.3" \ - "matplotlib>=3.7.2" \ - "bokeh>=3.3.0" \ - jupyter \ - ipykernel +ENV VIRTUAL_ENV=/home/ubuntu/.venv +RUN python3 -m venv "$VIRTUAL_ENV" && \ + "$VIRTUAL_ENV/bin/pip" install --upgrade pip setuptools wheel && \ + "$VIRTUAL_ENV/bin/pip" install \ + "subsettools>=2.0.1" \ + "hf_hydrodata>=1.4.3" \ + "matplotlib>=3.7.2" \ + "bokeh>=3.3.0" \ + jupyter \ + ipykernel +ENV PATH="$VIRTUAL_ENV/bin:$PATH" ENV PARFLOW_DIR=/opt/parflow/ ENV LD_LIBRARY_PATH=/opt/parflow/lib:/opt/hypre/lib:/usr/include/:$LD_LIBRARY_PATH From 1ff3e92d07ab6908fe2be224c701fb5b2fc2113e Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 15:14:57 -0400 Subject: [PATCH 12/13] Update LD_LIBRARY_PATH --- .devcontainer/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 4e7729b..420c5d3 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -162,5 +162,5 @@ RUN python3 -m venv "$VIRTUAL_ENV" && \ ENV PATH="$VIRTUAL_ENV/bin:$PATH" ENV PARFLOW_DIR=/opt/parflow/ -ENV LD_LIBRARY_PATH=/opt/parflow/lib:/opt/hypre/lib:/usr/include/:$LD_LIBRARY_PATH +ENV LD_LIBRARY_PATH=/opt/hdf5/lib:/opt/netcdf/lib:/opt/parflow/lib:/opt/hypre/lib:/usr/include:$LD_LIBRARY_PATH WORKDIR /home/ubuntu/ \ No newline at end of file From 9e6e2045592452ae93fdff69471fa5a78855d50b Mon Sep 17 00:00:00 2001 From: George Artavanis Date: Thu, 30 Apr 2026 15:44:44 -0400 Subject: [PATCH 13/13] Add extensions --- .devcontainer/devcontainer.json | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9e1acc3..a79053b 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -4,5 +4,15 @@ "dockerfile": "Dockerfile", "context": ".." }, - "postCreateCommand": "python -m ipykernel install --user --name subsetting-shortcourse --display-name \"Python (Subsetting ShortCourse)\"" -} + "customizations": { + "vscode": { + "extensions": [ + "ms-python.python", + "ms-python.vscode-pylance", + "ms-toolsai.jupyter" + ] + } + }, + "postCreateCommand": "python -m ipykernel install --user --name subsetting-shortcourse --display-name \"Python (Subsetting ShortCourse)\"", + "remoteUser": "ubuntu" +} \ No newline at end of file