-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/nmfs-opensci/container-images
- Loading branch information
Showing
3 changed files
with
49 additions
and
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Docker Image CI coastwatch patch | ||
on: | ||
workflow_dispatch: null | ||
push: | ||
branches: coastwatch-patch | ||
paths: | ||
- 'images/coastwatch/**' | ||
- '.github/workflows/docker-image-coastwatch_patch.yml' | ||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
permissions: write-all | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Login to GitHub Container Registry | ||
if: github.repository == 'nmfs-opensci/container-images' | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{github.actor}} | ||
password: ${{secrets.GITHUB_TOKEN}} | ||
- name: Build the Docker image | ||
if: github.repository == 'nmfs-opensci/container-images' | ||
run: | | ||
docker build images/coastwatch -f images/coastwatch/Dockerfile --tag ghcr.io/nmfs-opensci/container-images/coastwatch-patch:latest | ||
- name: Publish | ||
if: github.repository == 'nmfs-opensci/container-images' | ||
run: | | ||
docker push ghcr.io/nmfs-opensci/container-images/coastwatch-patch:latest | ||
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,46 +1,18 @@ | ||
# devcontainer-focused Rocker | ||
FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.3 | ||
# switch user to jovyan; later not working | ||
#RUN usermod -l rstudio jovyan | ||
|
||
# some Git preferences | ||
RUN git config --system pull.rebase false && \ | ||
git config --system credential.helper 'cache --timeout=36000' | ||
|
||
# Set up conda | ||
ENV NB_USER=rstudio | ||
ENV CONDA_ENV=/opt/miniforge3 | ||
ENV PATH=${CONDA_ENV}/bin:${PATH} | ||
RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \ | ||
bash Miniforge3-$(uname)-$(uname -m).sh -b -p ${CONDA_ENV} && \ | ||
chown ${NB_USER}:staff -R ${CONDA_ENV} && \ | ||
rm -f Miniforge3*.sh *.deb | ||
|
||
FROM openscapes/rocker:a7596b5 | ||
# Make sure R uses the conda path | ||
USER root | ||
RUN echo "PATH=${PATH}" >>"${R_HOME}/etc/Renviron.site" | ||
|
||
# Initialize conda by default for all users: | ||
RUN conda init --system | ||
|
||
# Standard user setup here | ||
RUN usermod -d /home/jovyan rstudio | ||
USER ${NB_USER} | ||
WORKDIR /home/jovyan | ||
RUN usermod -s /bin/bash ${NB_USER} | ||
USER ${NB_USER} | ||
WORKDIR ${HOME} | ||
|
||
# install into the default environment | ||
# install into the coastwatch packages if missing environment | ||
COPY install.R install.R | ||
RUN Rscript install.R && rm install.R | ||
|
||
# set-up the base coastwatch environment | ||
# make sure we install in the base environment | ||
# make sure we install in the notebook environment which is default in the | ||
# Openscapes image | ||
COPY coastwatch-environment.yml coastwatch-environment.yml | ||
RUN conda env update --name base -f coastwatch-environment.yml && conda clean --all | ||
RUN mamba env update --name notebook -f coastwatch-environment.yml && mamba clean --all | ||
RUN rm coastwatch-environment.yml | ||
|
||
# add the packages needed for jupyterhubs | ||
# need the --name part so that this is put in the coastwatch env | ||
COPY jhub-environment.yml jhub-environment.yml | ||
RUN conda env update --name base -f jhub-environment.yml && conda clean --all | ||
RUN rm jhub-environment.yml | ||
|
||
|
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,10 +1,13 @@ | ||
#! /usr/local/bin/Rscript | ||
# install R dependencies | ||
|
||
list.of.packages <- c("ncdf4", "httr","plyr","lubridate", "parsedate", "rerddap","plotdap", | ||
"rerddapXtracto", "graphics", "maps", "mapdata","RColorBrewer", | ||
"ggplot2","scales","dplyr","utils","Rcurl","raster","colorRamps", | ||
"parsedate","sp","sf","reshape2","jsonlite","rgdal", | ||
"gridGraphics","grid","PBSmapping","date","viridis", | ||
"openair","cmocean", "terra") | ||
install.packages(list.of.packages) | ||
# to match rocker/geospatial:4.2 uses in openscapes/rocker:a7596b5 | ||
repo <- "https://p3m.dev/cran/__linux__/jammy/2023-04-20" | ||
list.of.packages <- c("ncdf4", "httr", "plyr", "lubridate", "parsedate", "rerddap", | ||
"maps", "mapdata", "RColorBrewer", | ||
"ggplot2","scales", "dplyr", "RCurl", "raster", "colorRamps", | ||
"parsedate", "sp", "sf", "reshape2", "jsonlite", | ||
"gridGraphics", "PBSmapping", "date", "viridis", | ||
"openair","cmocean", "terra", | ||
"plotdap", "rerddapXtracto", "rgdal") | ||
install.packages(list.of.packages, repos=repo) |