Skip to content

Commit

Permalink
Stop whitebox from downloading during runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
mluck committed Sep 17, 2024
1 parent a19ca57 commit 31efe6f
Show file tree
Hide file tree
Showing 6 changed files with 1,002 additions and 557 deletions.
32 changes: 10 additions & 22 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ 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 rm /etc/apt/sources.list.d/apache-arrow.sources

RUN apt-get update && apt-get install -y git && rm -rf /var/lib/apt/lists/*

Expand Down Expand Up @@ -70,20 +70,12 @@ 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 && apt-get install -y openjdk-21-jdk && rm -rf /var/lib/apt/lists/*
RUN apt update --fix-missing

# An older version of openjdk still exists on the file system but was never cleaned up
# After research, we realized, it just needs file cleanup. Leaving it there is triggering security warnings
# RUN apt-get remove -y openjdk-17-jdk (not installed, just residue left)
RUN rm -rf ./usr/lib/jvm/*java-1.17* && \
rm -rf ./usr/lib/jvm/.java-1.17* && \
rm -rdf ./usr/lib/jvm/java-17*
# RUN rm /etc/apt/sources.list.d/apache-arrow.sources

# RUN apt-get update --fix-missing && apt-get install -y openjdk-19-jdk && rm -rf /var/lib/apt/lists/*

RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt install -y p7zip-full python3-pip time mpich parallel libgeos-dev expect tmux rsync tzdata
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

Expand All @@ -99,9 +91,7 @@ ENV PYTHONUNBUFFERED=TRUE

## ADD TO PATHS ##
ENV PATH="$projectDir:${PATH}"
#ENV PATH=${PATH}:$projectDir:$projectDir/$srcDir:$projectDir/tools
# Jul 17, 2024: Even though PYTHONPATH isn't used, it still seems to want it.
ENV PYTHONPATH=${PATH}:$srcDir:$projectDir/tools
ENV PYTHONPATH=${PYTHONPATH}:$srcDir:$projectDir/unit_tests:$projectDir/tools

## install python 3 modules ##

Expand All @@ -120,12 +110,10 @@ RUN pip3 install pipenv==2024.0.1 && PIP_NO_CACHE_DIR=off pipenv install --syste
# 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

# RUN wbox_path=/usr/local/lib/python3.10/dist-packages/whitebox/WBT && \
# wget -P $wbox_path https://www.whiteboxgeo.com/WBT_Linux/WhiteboxTools_linux_musl.zip && \
# unzip -o $wbox_path/WhiteboxTools_linux_musl.zip -d $wbox_path && \
# cp $wbox_path/whitebox_tools $wbox_path && \
# mkdir $wbox_path/testdata
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
# ----------------------------------

## RUN UMASK TO CHANGE DEFAULT PERMISSIONS ##
Expand Down
2 changes: 1 addition & 1 deletion Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ seaborn = "==0.12.2"
tables = "==3.8.0"
tqdm = "==4.66.3"
urllib3 = "==1.26.19"
whitebox = "==2.3.4"
whitebox = "==2.3.5"
xarray = "==2024.6.0"
zarr = "==2.18.0"

Expand Down
Loading

0 comments on commit 31efe6f

Please sign in to comment.