Skip to content

Commit

Permalink
Merge pull request #126 from nmfs-opensci/eeholmes-dev-1
Browse files Browse the repository at this point in the history
get rid of binder stuff
  • Loading branch information
eeholmes authored Oct 30, 2024
2 parents 6cfa515 + 23e491d commit 94fc9f0
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions appendix
Original file line number Diff line number Diff line change
Expand Up @@ -48,29 +48,17 @@ ENV NB_USER=${NB_USER}

## ONBUILD section. These commands are run in child Dockerfiles. These are run right after the FROM image is loaded

ONBUILD RUN echo "py-rocket-base: looking for configuration files to use"

ONBUILD USER ${NB_USER}

# ${REPO_DIR} is owned by ${NB_USER}
ONBUILD COPY --chown=${NB_USER}:${NB_USER} . ${REPO_DIR}/childimage

# repo2docker will load files from a .binder or binder directory if
# present. We check if those directories exist.
ONBUILD RUN echo "Checking for 'binder' or '.binder' subfolder" \
; cd "${REPO_DIR}/childimage/" \
; if [ -d binder ] ; then \
echo "Using 'binder/' build context" \
; elif [ -d .binder ] ; then \
echo "Using '.binder/' build context" \
; else \
echo "Using './' build context" \
; fi

# Copy Desktop files into ${REPO_DIR}/Desktop if they exist. start will copy to Application dir and Desktop
# Will not fail if Desktop dir exists but is empty
ONBUILD RUN echo "Checking for 'Desktop directory'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -d Desktop ; then \
mkdir -p "${REPO_DIR}/Desktop" && \
[ "$(ls -A Desktop 2>/dev/null)" ] && cp -r Desktop/* "${REPO_DIR}/Desktop/"; \
Expand All @@ -81,8 +69,6 @@ ONBUILD RUN echo "Checking for 'Desktop directory'..." \
ONBUILD USER root
ONBUILD RUN echo "Checking for 'apt.txt'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -f "apt.txt" ; then \
package_list=$(grep -v '^\s*#' apt.txt | grep -v '^\s*$' | sed 's/\r//g; s/#.*//; s/^[[:space:]]*//; s/[[:space:]]*$//' | awk '{$1=$1};1') \
&& apt-get update --fix-missing > /dev/null \
Expand All @@ -97,8 +83,6 @@ ONBUILD USER ${NB_USER}
# sometimes package solving will get rid of pip installed packages. Make sure jupyter-remote-desktop-proxy does not disappear
ONBUILD RUN echo "Checking for 'conda-lock.yml' or 'environment.yml'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -f "conda-lock.yml" ; then echo "Using conda-lock.yml" & \
conda-lock install --name ${CONDA_ENV} \
&& pip install --no-deps jupyter-remote-desktop-proxy \
Expand All @@ -118,17 +102,13 @@ ONBUILD RUN echo "Checking for 'conda-lock.yml' or 'environment.yml'..." \
# to avoid wasting space.
ONBUILD RUN echo "Checking for pip 'requirements.txt'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -f "requirements.txt" ; then \
${NB_PYTHON_PREFIX}/bin/pip install --no-cache -r requirements.txt \
; fi

# Add the r packages
ONBUILD RUN echo "Checking for 'install.R" \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -f "install.R" ; then echo "Using install.R" & \
Rscript install.R \
; fi
Expand All @@ -137,8 +117,6 @@ ONBUILD RUN echo "Checking for 'install.R" \
# This is sourced in ${REPO_DIR}/start
ONBUILD RUN echo "Checking for 'start'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder && cp start ${REPO_DIR}/childimage/start \
; [ -d .binder ] && cd .binder && cp start ${REPO_DIR}/childimage/start \
; if test -f "start" ; then \
chmod +x start \
; fi
Expand All @@ -149,8 +127,6 @@ ONBUILD RUN echo "Checking for 'start'..." \
# leave behind.
ONBUILD RUN echo "Checking for 'postBuild'..." \
; cd "${REPO_DIR}/childimage/" \
; [ -d binder ] && cd binder \
; [ -d .binder ] && cd .binder \
; if test -f "postBuild" ; then \
chmod +x postBuild \
&& ./postBuild \
Expand Down

0 comments on commit 94fc9f0

Please sign in to comment.