Skip to content

Commit

Permalink
uses single rspatial script for both images
Browse files Browse the repository at this point in the history
  • Loading branch information
goergen95 committed Nov 6, 2024
1 parent 9a9e526 commit e3ff8dc
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-mapme.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ on:
pull_request:
branches: [main, master]
env:
tag: 1.4.1
tag: 1.4.2

jobs:

Expand Down
6 changes: 3 additions & 3 deletions dockerfiles/mapme-spatial-dev.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL org.opencontainers.image.title="mapme-spatial-dev" \
org.opencontainers.image.description="A build of spatial libraries for use within MAPME" \
org.opencontainers.image.authors="Darius Görgen <[email protected]>"

COPY scripts/install_rspatial_dev.sh /rocker_scripts/install_rspatial_dev.sh
RUN chmod +x /rocker_scripts/install_rspatial_dev.sh
COPY scripts/install_rspatial.sh /rocker_scripts/install_rspatial.sh
RUN chmod +x /rocker_scripts/install_rspatial.sh
ARG NCPUS=-1
RUN bash /rocker_scripts/install_rspatial_dev.sh -ncpus $NCPUS
RUN bash /rocker_scripts/install_rspatial.sh -n $NCPUS -d
2 changes: 1 addition & 1 deletion dockerfiles/mapme-spatial.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ LABEL org.opencontainers.image.title="mapme-spatial" \
COPY scripts/install_rspatial.sh /rocker_scripts/install_rspatial.sh
RUN chmod +x /rocker_scripts/install_rspatial.sh
ARG NCPUS=-1
RUN bash /rocker_scripts/install_rspatial.sh -ncpus $NCPUS
RUN bash /rocker_scripts/install_rspatial.sh -n $NCPUS
24 changes: 18 additions & 6 deletions scripts/install_rspatial.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
#!/bin/bash
set -e

while getopts ncpus: flag
DEV=0

while getopts "dn:" flag
do
case "${flag}" in
ncpus) NCPUS=${OPTARG};;
n) NCPUS=${OPTARG};;
d) DEV=1;;
esac
done

Expand All @@ -16,11 +19,20 @@ install2.r --deps TRUE --ncpus $NCPUS --type source --repos https://cloud.r-proj
sf \
stars \
terra \
gdalcubes \
mapme.biodiversity
gdalcubes

# install mapme packages
Rscript -e 'remotes::install_github("mapme-initiative/mapme.pipelines", dependencies = TRUE)'
# install mapme.biodiversity dev or cran version
if [ $DEV -eq 1 ]; then
echo "Installing dev version of mapme.biodiversity"
Rscript -e 'remotes::install_github("mapme-initiative/mapme.biodiversity", dependencies = TRUE)'
else
echo "Installing CRAN version of mapme.biodiversity"
install2.r --deps TRUE --ncpus $NCPUS --type source --repos https://cloud.r-project.org \
mapme.biodiversity
fi

# install other mapme packages from github
Rscript -e 'remotes::install_github("mapme-initiative/mapme.pipelines", dependencies = TRUE)'

# install additional r packages
install2.r --error --skipmissing --skipinstalled --ncpus $NCPUS \
Expand Down
57 changes: 0 additions & 57 deletions scripts/install_rspatial_dev.sh

This file was deleted.

0 comments on commit e3ff8dc

Please sign in to comment.