diff --git a/flavors/tempsed-wadden-sea/cell-build.Dockerfile b/flavors/tempsed-wadden-sea/cell-build.Dockerfile new file mode 100644 index 0000000..5145e42 --- /dev/null +++ b/flavors/tempsed-wadden-sea/cell-build.Dockerfile @@ -0,0 +1,12 @@ +FROM mambaorg/micromamba:2.0.7 + +RUN micromamba install -y -n base -c conda-forge conda-pack && \ + micromamba clean --all --yes + +ARG CONDA_ENV_FILE +COPY --chown=mambauser:mambauser ${CONDA_ENV_FILE?} environment.yaml +RUN micromamba create -y -n venv -f environment.yaml && \ + micromamba clean --all --yes + +COPY ./flavors/tempsed-wadden-sea/install_packages.R . +RUN micromamba run -n venv bash -c "Rscript install_packages.R" diff --git a/flavors/tempsed-wadden-sea/environment.yaml b/flavors/tempsed-wadden-sea/environment.yaml new file mode 100644 index 0000000..00028a6 --- /dev/null +++ b/flavors/tempsed-wadden-sea/environment.yaml @@ -0,0 +1,55 @@ +name: tempsed-wadden-sea +channels: + - conda-forge +dependencies: + # naavre-fl-*-cell-build + - r-jsonlite=1.9.1 + - r-optparse=1.7.5 + # naavre-fl-*-jupyter + - ipykernel=6.29.5 + - r-irkernel=1.3.2 + # user packages for all flavors + - git=2.49.0 + - jq>=1.8 + - minio=7.2.15 + - pip=25.0.1 + - python>=3.8 + - r=4.4 + - r-secretsprovider + - r-getpass + - r-aws.s3 + # user packages for this flavor + - r-dplyr + - r-tidyr + - r-purrr + - r-lubridate + - r-ggplot2 + - r-sf + - r-terra + - r-zoo + - r-data.table + - r-fasttime + - r-rcpp + - r-rcpproll + - r-ggrepel + - r-generics + - r-cli + - r-rcpparmadillo + - r-pak + - r-devtools + - r-remotes + - pandas + - geopandas + - matplotlib + - rasterio + # Dependencies for TempSED + - r-desolve + - r-rootsolve + - r-plot3d + - r-shape + - pip: + # user packages for all flavors + - SecretsProvider + # user packages for this flavor + - rws-ddlpy + diff --git a/flavors/tempsed-wadden-sea/flavor_config.yaml b/flavors/tempsed-wadden-sea/flavor_config.yaml new file mode 100644 index 0000000..0108db8 --- /dev/null +++ b/flavors/tempsed-wadden-sea/flavor_config.yaml @@ -0,0 +1,5 @@ +flavor_name: tempsed-wadden-sea +build_jupyter: True +build_cell_base: True +free_disk_space: False +aliases: [] diff --git a/flavors/tempsed-wadden-sea/install_packages.R b/flavors/tempsed-wadden-sea/install_packages.R new file mode 100644 index 0000000..7a0469b --- /dev/null +++ b/flavors/tempsed-wadden-sea/install_packages.R @@ -0,0 +1,15 @@ +install.packages("ReacTran", repos="https://cran.r-project.org", dependencies = FALSE) +library("ReacTran") + +install.packages("grDevices", repos="https://cran.r-project.org", dependencies = FALSE) +library("grDevices") + +install.packages("heatwaveR", repos="https://cran.r-project.org", dependencies = FALSE) +library("heatwaveR") + +install.packages("tidyterra", repos="https://cran.r-project.org", dependencies = FALSE) +library("tidyterra") + +devtools::install_github('TempSED/TempSED', build_vignettes = TRUE, dependencies = FALSE) +require('TempSED') + diff --git a/flavors/tempsed-wadden-sea/jupyter.Dockerfile b/flavors/tempsed-wadden-sea/jupyter.Dockerfile new file mode 100644 index 0000000..af32b5f --- /dev/null +++ b/flavors/tempsed-wadden-sea/jupyter.Dockerfile @@ -0,0 +1,23 @@ +FROM quay.io/jupyter/minimal-notebook:lab-4.3.6 + +COPY --chown=jovyan:jovyan ./docker/jupyter.requirements.txt requirements.txt +RUN pip install -r requirements.txt + +# nb_conda_kernels for auto-discovery of kernels in other conda environments +RUN mamba install --yes "nb_conda_kernels>=2.5.0" && \ + mamba clean --all --yes + +# Disable "Would you like to get notified about official Jupyter news?" +# https://jupyterlab.readthedocs.io/en/stable/user/announcements.html +RUN jupyter labextension disable "@jupyterlab/apputils-extension:announcements" + +ARG CONDA_ENV_FILE +COPY --chown=jovyan:jovyan ${CONDA_ENV_FILE?} environment.yaml +RUN mamba env create --yes -f environment.yaml && \ + mamba clean --all --yes +RUN echo '{"CondaKernelSpecManager": {"env_filter": "/opt/conda$", "conda_only": true}}' >> /home/jovyan/.jupyter/jupyter_config.json + +RUN mkdir -p /tmp/data + +COPY ./flavors/tempsed-wadden-sea/install_packages.R . +RUN mamba run -n tempsed-wadden-sea bash -c "Rscript install_packages.R" diff --git a/flavors/tempsed-wadden-sea/tests/tests.sh b/flavors/tempsed-wadden-sea/tests/tests.sh new file mode 100644 index 0000000..b67ed79 --- /dev/null +++ b/flavors/tempsed-wadden-sea/tests/tests.sh @@ -0,0 +1,7 @@ +#!/bin/bash +set -e +# activate environment in cell-test or in jupyter image +source /venv/bin/activate || eval "$(conda shell.bash activate tempsed-wadden-sea)" +dir="${0%/*}" +find "$dir" -name "*.py" -print0 | xargs --null -I "{}" python "{}" +find "$dir" -name "*.R" -print0 | xargs --null -I "{}" Rscript "{}"