Skip to content

Commit

Permalink
update libs
Browse files Browse the repository at this point in the history
  • Loading branch information
cboettig committed Feb 12, 2024
1 parent 7ee61cb commit ed4d19a
Show file tree
Hide file tree
Showing 6 changed files with 71 additions and 31 deletions.
28 changes: 18 additions & 10 deletions images/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,25 +9,33 @@ RUN /rocker_scripts/install_jupyter.sh
RUN /rocker_scripts/experimental/install_dev_osgeo.sh
RUN chown -R rstudio:staff ${VIRTUAL_ENV} && chmod -R g+rw ${VIRTUAL_ENV}

COPY install.R /tmp/install.R
COPY jupyter-requirements.txt /tmp/jupyter-requirements.txt
COPY spatial-requirements.txt /tmp/spatial-requirements.txt
COPY rl-requirements.txt /tmp/rl-requirements.txt
# install codeserver
RUN curl -fsSL https://code-server.dev/install.sh | sh && rm -rf .cache

COPY apt.txt apt.txt
RUN apt-get update -qq && xargs sudo apt-get -y install < apt.txt

COPY install.R /tmp/install.R
RUN Rscript /tmp/install.R


# some git preferences
RUN git config --system pull.rebase false && \
git config --system credential.helper 'cache --timeout=30000'


USER ${NB_USER}
WORKDIR /home/${NB_USER}

RUN usermod -s /bin/bash ${NB_USER}
RUN python3 -m pip install -r /tmp/jupyter-requirements.txt
RUN python3 -m pip install -r /tmp/spatial-requirements.txt
RUN python3 -m pip install -r /tmp/rl-requirements.txt
COPY jupyter-requirements.txt /tmp/jupyter-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/jupyter-requirements.txt
COPY spatial-requirements.txt /tmp/spatial-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/spatial-requirements.txt
COPY rl-requirements.txt /tmp/rl-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/rl-requirements.txt

## no need to register the environment
#RUN python3 -m ipykernel install --user --name=spatial

# some git preferences
RUN git config --global pull.rebase false && \
git config --global credential.helper 'cache --timeout=30000'

31 changes: 16 additions & 15 deletions images/Dockerfile.gpu
Original file line number Diff line number Diff line change
Expand Up @@ -4,34 +4,35 @@ ENV NB_USER rstudio
ENV VIRTUAL_ENV /opt/venv
ENV PATH ${VIRTUAL_ENV}/bin:$PATH


RUN /rocker_scripts/install_jupyter.sh
RUN chown -R ${NB_USER}:staff ${VIRTUAL_ENV} && chmod -R g+rw ${VIRTUAL_ENV}

# install codeserver
RUN curl -fsSL https://code-server.dev/install.sh | sh
RUN curl -fsSL https://code-server.dev/install.sh | sh && rm -rf .cache

COPY install.R /tmp/install.R
COPY jupyter-requirements.txt /tmp/jupyter-requirements.txt
COPY spatial-requirements.txt /tmp/spatial-requirements.txt
COPY rl-requirements.txt /tmp/rl-requirements.txt
RUN /rocker_scripts/experimental/install_dev_osgeo.sh

RUN Rscript /tmp/install.R
COPY apt.txt apt.txt
RUN apt-get update -qq && xargs sudo apt-get -y install < apt.txt

RUN apt-get update -qq && apt-get -y install vim
COPY install.R /tmp/install.R
RUN Rscript /tmp/install.R && rm /tmp/install.R

# some git preferences
RUN git config --system pull.rebase false && \
git config --system credential.helper 'cache --timeout=30000'

USER ${NB_USER}
WORKDIR /home/${NB_USER}

RUN usermod -s /bin/bash ${NB_USER}
RUN python3 -m pip install -r /tmp/jupyter-requirements.txt
RUN python3 -m pip install -r /tmp/spatial-requirements.txt
RUN python3 -m pip install -r /tmp/rl-requirements.txt
COPY jupyter-requirements.txt /tmp/jupyter-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/jupyter-requirements.txt
COPY spatial-requirements.txt /tmp/spatial-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/spatial-requirements.txt
COPY rl-requirements.txt /tmp/rl-requirements.txt
RUN python3 -m pip install --no-cache-dir -r /tmp/rl-requirements.txt

## no need to register the environment
#RUN python3 -m ipykernel install --user --name=spatial

# some git preferences
RUN git config --global pull.rebase false && \
git config --global credential.helper 'cache --timeout=30000'

5 changes: 5 additions & 0 deletions images/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
vim
cmake
nano
exuberant-ctags

17 changes: 11 additions & 6 deletions images/install.R
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
#! /usr/local/bin/Rscript
# install R dependencies

## Ensure spatial packages are installed from source
# We could use renv.lock approach here instead, but will force re-creation of environment from scratch
# Does not provide a good way to ensure that sf/terra/gdalcubes are installed from source while other packages can be binary
# Likewise, pak insists on installing old gdal from apt instead of respecting system library source builds
# install.packages("pak")
install.packages(c("rstac", "spData", "earthdatalogin", "quarto", "aws.s3", "tmap", "pak"))
remotes::install_github('r-tmap/tmap')
install.packages("pak")
pak::pkg_install(c("rstac", "spData", "earthdatalogin", "quarto", "aws.s3", "pak", "duckdbfs", "minioclient"))
pak::pkg_install("r-tmap/tmap")

#remotes::install_github('r-tmap/tmap', upgrade="never", repos="https://cloud.r-project.org", dep=TRUE)


pak::pkg_install("igraph")
pak::pkg_install("ropensci-review-tools/pkgcheck")

#pak::pkg_install("httpgd")
#pak::pkg_install(c("IRkernel", "languageserver"))
#IRkernel::installspec()
# pak::pkg_install("httpgd")
pak::pkg_install(c("IRkernel", "languageserver"))
IRkernel::installspec()

1 change: 1 addition & 0 deletions images/rl-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,5 @@ ray[rllib,tune]
stable-baselines3
sb3-contrib
huggingface_sb3
darts[all]

20 changes: 20 additions & 0 deletions images/spatial_install.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#! /usr/local/bin/Rscript
# install R dependencies

## Ensure spatial packages are installed from source
Sys.setenv(GITHUB_PAT="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")
remotes::install_github('r-tmap/tmap', upgrade="never", repos="https://cloud.r-project.org", dep=TRUE)

# We could use renv.lock approach here instead, but will force re-creation of environment from scratch
# Does not provide a good way to ensure that sf/terra/gdalcubes are installed from source while other packages can be binary
# Likewise, pak insists on installing old gdal from apt instead of respecting system library source builds
install.packages("pak")
pak::pkg_install(c("rstac", "spData", "earthdatalogin", "quarto", "aws.s3", "pak", "duckdbfs", "minioclient"))

pak::pkg_install("igraph")
pak::pkg_install("ropensci-review-tools/pkgcheck")

pak::pkg_install("httpgd")
pak::pkg_install(c("IRkernel", "languageserver"))
IRkernel::installspec()

0 comments on commit ed4d19a

Please sign in to comment.