-
Notifications
You must be signed in to change notification settings - Fork 29
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b1a5ba0
commit 82b5e42
Showing
121 changed files
with
7,970 additions
and
5,362 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,5 +13,4 @@ config/** | |
config/*.swp | ||
.vscode/ | ||
**/.DS_Store | ||
**/*_pytest.py | ||
.private/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -31,3 +31,4 @@ repos: | |
hooks: | ||
- id: isort | ||
name: isort (python) | ||
args: ["--profile", "black"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
cff-version: 1.2.0 | ||
message: "If you use this software, please cite it as below." | ||
message: "If you use this software, please cite it as below. To ensure you have latest and correct version, please look at the changelog.md at 'https://github.com/NOAA-OWP/inundation-mapping/blob/dev/docs/CHANGELOG.md'" | ||
authors: | ||
- family-names: "NOAA Office of Water Prediction" | ||
title: "Inundation Mapping" | ||
url: "https://github.com/NOAA-OWP/inundation-mapping" | ||
version: 4.4.2.1 | ||
date-released: 2023 | ||
version: 4.5.10.0 | ||
date-released: 2024 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,129 @@ | ||
## Temporary image to build the libraries and only save the needed artifacts | ||
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.4 AS builder | ||
WORKDIR /opt/builder | ||
ARG dataDir=/data | ||
ARG projectDir=/foss_fim | ||
ARG depDir=/dependencies | ||
ARG taudemVersion=98137bb6541a0d0077a9c95becfed4e56d0aa0ac | ||
ARG taudemVersion2=81f7a07cdd3721617a30ee4e087804fddbcffa88 | ||
ENV taudemDir=$depDir/taudem/bin | ||
ENV taudemDir2=$depDir/taudem_accelerated_flowDirections/taudem/build/bin | ||
|
||
# remove reference to missing repo | ||
# RUN rm /etc/apt/sources.list.d/apache-arrow.sources | ||
|
||
RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/* | ||
|
||
RUN git clone https://github.com/dtarb/taudem.git | ||
RUN git clone https://github.com/fernandoa123/cybergis-toolkit.git taudem_accelerated_flowDirections | ||
|
||
RUN apt-get update --fix-missing && apt-get install -y cmake mpich \ | ||
libgtest-dev libboost-test-dev libnetcdf-dev && rm -rf /var/lib/apt/lists/* | ||
|
||
## Compile Main taudem repo ## | ||
RUN mkdir -p taudem/bin | ||
RUN cd taudem \ | ||
&& git checkout $taudemVersion \ | ||
&& cd src \ | ||
&& make | ||
|
||
## Compile taudem repo with accelerated flow directions ## | ||
RUN cd taudem_accelerated_flowDirections/taudem \ | ||
&& git checkout $taudemVersion2 \ | ||
&& mkdir build \ | ||
&& cd build \ | ||
&& cmake .. \ | ||
&& make | ||
|
||
RUN mkdir -p $taudemDir | ||
RUN mkdir -p $taudemDir2 | ||
|
||
## Move needed binaries to the next stage of the image | ||
RUN cd taudem/bin && mv -t $taudemDir flowdircond streamnet gagewatershed catchhydrogeo dinfdistdown | ||
RUN cd taudem_accelerated_flowDirections/taudem/build/bin && mv -t $taudemDir2 d8flowdir dinfflowdir | ||
|
||
|
||
############################################################################################### | ||
# Base Image that has GDAL, PROJ, etc | ||
FROM ghcr.io/osgeo/gdal:ubuntu-small-3.8.4 | ||
ARG dataDir=/data | ||
ENV projectDir=/foss_fim | ||
ARG depDir=/dependencies | ||
ENV inputsDir=$dataDir/inputs | ||
ENV outputsDir=/outputs | ||
ENV srcDir=$projectDir/src | ||
ENV toolsDir=$projectDir/tools | ||
ENV workDir=/fim_temp | ||
ENV taudemDir=$depDir/taudem/bin | ||
ENV taudemDir2=$depDir/taudem_accelerated_flowDirections/taudem/build/bin | ||
|
||
## ADDING FIM GROUP ## | ||
ARG GroupID=1370800235 | ||
ARG GroupName=fim | ||
RUN addgroup --gid $GroupID $GroupName | ||
ENV GID=$GroupID | ||
ENV GN=$GroupName | ||
|
||
RUN mkdir -p $workDir | ||
RUN mkdir -p $depDir | ||
COPY --from=builder $depDir $depDir | ||
|
||
# remove reference to missing repo | ||
# RUN rm /etc/apt/sources.list.d/apache-arrow.sources | ||
|
||
RUN apt-get update --fix-missing && rm -rf /var/lib/apt/lists/* | ||
RUN apt update --fix-missing | ||
|
||
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y p7zip-full python3-pip time mpich parallel libgeos-dev expect tmux rsync tzdata wget | ||
|
||
RUN apt auto-remove | ||
|
||
## adding AWS CLI (for bash) ## | ||
RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-x86_64.zip" -o "awscliv2.zip" && \ | ||
unzip awscliv2.zip && \ | ||
./aws/install | ||
|
||
## adding environment variables for numba and python ## | ||
ENV LC_ALL=C.UTF-8 | ||
ENV LANG=C.UTF-8 | ||
ENV PYTHONUNBUFFERED=TRUE | ||
|
||
## ADD TO PATHS ## | ||
ENV PATH="$projectDir:${PATH}" | ||
ENV PYTHONPATH="${PYTHONPATH}:${projectDir}:${srcDir}:${srcDir}/utils:${projectDir}/data:${toolsDir}" | ||
|
||
## install python 3 modules ## | ||
COPY Pipfile . | ||
COPY Pipfile.lock . | ||
RUN pip3 install pipenv==2024.0.1 && PIP_NO_CACHE_DIR=off pipenv install --system --deploy --ignore-pipfile | ||
|
||
# ---------------------------------- | ||
# Mar 2023 / Sep 2024 | ||
# There are some nuances in the whitebox python downloads in that the first time it loads | ||
# it goes to the internet and downloads the latest/greatest WBT (whiteboxtools) engine which is | ||
# required for the whitebox python library to work. We don't want to have FIM attempting a download | ||
# each time a container is opened and the whitebox engine is called. | ||
# Instead we will setup the WBT engine at time of docker build (same as Taudem and AWS). | ||
# Whitebox code detects that the engine it there and makes no attempt to update it. | ||
# We download and unzip it to the same file folder that pip deployed the whitebox library. | ||
# Whitebox also attempts to always download a folder called testdata regardless of use. | ||
# We added an empty folder to fake out whitebox_tools.py so it doesn't try to download the folder | ||
ENV WBT_PATH=/usr/local/lib/python3.10/dist-packages/whitebox/WBT | ||
RUN wget -P $WBT_PATH https://www.whiteboxgeo.com/WBT_Linux/WhiteboxTools_linux_musl.zip && \ | ||
unzip -o $WBT_PATH/WhiteboxTools_linux_musl.zip -d $WBT_PATH && \ | ||
cp $WBT_PATH/WhiteboxTools_linux_amd64/WBT/whitebox_tools $WBT_PATH | ||
# ---------------------------------- | ||
|
||
# The containiner will auto use this account to run | ||
ARG RuntimeUser=svc_user | ||
RUN useradd -u 8877 -g $GroupName -s /bin/bash $RuntimeUser | ||
RUN chmod 777 $workDir | ||
RUN mkdir -p "/home/${RuntimeUser}" | ||
RUN chmod 777 /home/$RuntimeUser | ||
|
||
## RUN UMASK TO CHANGE DEFAULT PERMISSIONS ## | ||
ADD ./src/entrypoint.sh / | ||
ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] | ||
|
||
## This results in the default user being the svc_user user | ||
USER $RuntimeUser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,23 @@ | ||
Licensed under the Apache License, Version 2.0 (the "License"); | ||
you may not use this file except in compliance with the License. | ||
You may obtain a copy of the License at | ||
|
||
http://www.apache.org/licenses/LICENSE-2.0 | ||
|
||
Unless required by applicable law or agreed to in writing, software | ||
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations under the License. | ||
|
||
----------------- | ||
|
||
“Software code created by U.S. Government employees is not subject to copyright | ||
in the United States (17 U.S.C. §105). The United States/Department of Commerce | ||
reserve all rights to seek and obtain copyright protection in countries other | ||
than the United States for Software authored in its entirety by the Department | ||
of Commerce. To this end, the Department of Commerce hereby grants to Recipient | ||
a royalty-free, nonexclusive license to use, copy, and create derivative works | ||
of the Software outside of the United States.” | ||
|
||
----------------- |
Oops, something went wrong.