Skip to content

Commit f1ec4de

Browse files
authored
Update troute cfe nom (#258)
* fix python version mismatch * update t-route to ngiab branch
1 parent a925f99 commit f1ec4de

File tree

1 file changed

+24
-23
lines changed

1 file changed

+24
-23
lines changed

docker/Dockerfile

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,35 @@
11
FROM rockylinux:9.1 AS base
22
ENV TROUTE_REPO=CIROH-UA/t-route
3-
ENV TROUTE_BRANCH=datastream
3+
ENV TROUTE_BRANCH=ngiab
44
ENV NGEN_REPO=CIROH-UA/ngen
55
ENV NGEN_BRANCH=ngiab
66

7-
# Install system dependencies
7+
# Install final dependencies to make sure ngen is build and deployed with matching versions
8+
# Needed here for build caching
89
RUN echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
910
RUN dnf update -y && \
1011
dnf install -y epel-release && \
1112
dnf config-manager --set-enabled crb && \
1213
dnf install -y \
13-
sudo vim gcc gcc-c++ make cmake ninja-build tar git gcc-gfortran libgfortran sqlite sqlite-devel \
14+
vim libgfortran sqlite \
15+
bzip2 expat udunits2 zlib \
16+
mpich hdf5 netcdf netcdf-fortran netcdf-cxx netcdf-cxx4-mpich
17+
18+
FROM base AS build_base
19+
# no dnf update to keep devel packages consistent with versions installed in base
20+
RUN echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
21+
RUN dnf install -y epel-release && \
22+
dnf config-manager --set-enabled crb && \
23+
dnf install -y \
24+
sudo gcc gcc-c++ make cmake ninja-build tar git gcc-gfortran libgfortran sqlite sqlite-devel \
1425
python3 python3-devel python3-pip gdal gdal-devel \
15-
bzip2 expat expat-devel flex bison udunits2 udunits2-devel zlib-devel \
16-
wget mpich mpich-devel hdf5 hdf5-devel netcdf netcdf-devel \
17-
netcdf-fortran netcdf-fortran-devel netcdf-cxx netcdf-cxx-devel lld
26+
expat-devel flex bison udunits2-devel zlib-devel \
27+
wget mpich-devel hdf5-devel netcdf-devel \
28+
netcdf-fortran-devel netcdf-cxx-devel lld
1829

1930

2031

21-
FROM base AS boost_build
32+
FROM build_base AS boost_build
2233
RUN wget https://archives.boost.io/release/1.79.0/source/boost_1_79_0.tar.gz
2334
RUN tar -xzf boost_1_79_0.tar.gz
2435
WORKDIR /boost_1_79_0
@@ -61,7 +72,7 @@ RUN ./compiler.sh no-e
6172
# install / build using UV because it's so much faster
6273
# no build isolation needed because of cython namespace issues
6374
RUN uv pip install --config-setting='--build-option=--use-cython' src/troute-network/
64-
RUN uv build --wheel --config-setting='--build-option=--use-cython' src/troute-network/
75+
RUN uv build --wheel --config-setting='--build-option=--use-cython' src/troute-network/
6576
RUN uv pip install --no-build-isolation --config-setting='--build-option=--use-cython' src/troute-routing/
6677
RUN uv build --wheel --no-build-isolation --config-setting='--build-option=--use-cython' src/troute-routing/
6778
RUN uv build --wheel --no-build-isolation src/troute-config/
@@ -97,7 +108,7 @@ ARG COMMON_BUILD_ARGS="-DNGEN_WITH_EXTERN_ALL=ON \
97108
-DCMAKE_BUILD_TYPE=Release \
98109
-DCMAKE_INSTALL_PREFIX=. \
99110
-DCMAKE_CXX_FLAGS='-fuse-ld=lld'"
100-
# lld is the linker, it's faster than the default
111+
# lld is the linker, it's faster than the default
101112

102113

103114
# Build Ngen serial
@@ -108,8 +119,8 @@ ARG MPI_BUILD_ARGS="-DNGEN_WITH_MPI:BOOL=ON \
108119
-DNetCDF_ROOT=/usr/lib64/mpich \
109120
-DCMAKE_PREFIX_PATH=/usr/lib64/mpich \
110121
-DCMAKE_LIBRARY_PATH=/usr/lib64/mpich/lib"
111-
# the two in the command below can't be here because the $() isn't evaulated properly
112-
122+
# the two in the command below can't be here because the $() isn't evaulated properly
123+
113124

114125
# Install the mpi enabled netcdf library and build Ngen parallel with it
115126
RUN dnf install -y netcdf-cxx4-mpich-devel
@@ -149,17 +160,7 @@ ENTRYPOINT ["./HelloNGEN.sh"]
149160

150161

151162

152-
FROM rockylinux:9.1 AS final
153-
# Install only necessary runtime dependencies
154-
RUN echo "max_parallel_downloads=10" >> /etc/dnf/dnf.conf
155-
RUN dnf update -y && \
156-
dnf install -y epel-release && \
157-
dnf config-manager --set-enabled crb && \
158-
dnf install -y \
159-
vim libgfortran sqlite gdal \
160-
bzip2 expat udunits2 zlib \
161-
mpich hdf5 netcdf netcdf-fortran netcdf-cxx netcdf-cxx4-mpich && \
162-
dnf clean all
163+
FROM base AS final
163164

164165
WORKDIR /ngen
165166

@@ -190,7 +191,7 @@ RUN chmod a+x /dmod/bin/* /ngen/HelloNGEN.sh
190191
# This mess is parsing the version number
191192
RUN uv pip install numpy==$(/dmod/bin/ngen --info | grep -e 'NumPy Version: ' | cut -d ':' -f 2 | uniq | xargs)
192193

193-
# now that the only version of numpy is the one that NGen expects,
194+
# now that the only version of numpy is the one that NGen expects,
194195
# we can add the venv to the path so ngen can find it
195196
ENV PATH="/ngen/.venv/bin:${PATH}"
196197

0 commit comments

Comments
 (0)