From 432571e54c003c12ddbdd2ad95527dded720a176 Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 21:24:42 -0800 Subject: [PATCH] wip --- .devcontainer/install.R | 10 ++++--- .devcontainer/jupyter-requirements.txt | 32 ++++++++++++++++++++++ .devcontainer/jupyterhub.Dockerfile | 38 ++++++++++++++++++++++++++ .devcontainer/nasa-requirements.txt | 31 +++++++++++++++++++++ .github/workflows/test-build.yaml | 27 ++++++++++++++++++ 5 files changed, 134 insertions(+), 4 deletions(-) create mode 100644 .devcontainer/jupyter-requirements.txt create mode 100644 .devcontainer/jupyterhub.Dockerfile create mode 100644 .devcontainer/nasa-requirements.txt create mode 100644 .github/workflows/test-build.yaml diff --git a/.devcontainer/install.R b/.devcontainer/install.R index 671eff4..760d0fc 100755 --- a/.devcontainer/install.R +++ b/.devcontainer/install.R @@ -4,8 +4,10 @@ # 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 -install.packages(c("rstac", "spData", "earthdatalogin", "quarto")) -remotes::install_github('r-tmap/tmap') +install.packages(c("rstac", "spData", "earthdatalogin", "quarto", "pak")) +pak::pkg_install('github::r-tmap/tmap') + +# vscode and jupyter plugins +#install.packages(c("IRkernel", "languageserver", "httpgd")) +#IRkernel::installspec() -install.packages(c("IRkernel", "languageserver", "httpgd")) -IRkernel::installspec() diff --git a/.devcontainer/jupyter-requirements.txt b/.devcontainer/jupyter-requirements.txt new file mode 100644 index 0000000..1cc0219 --- /dev/null +++ b/.devcontainer/jupyter-requirements.txt @@ -0,0 +1,32 @@ +ipykernel +ipython +ipywidgets +jupyter +jupyter-console +jupyter-events +jupyter-lsp +jupyter_client +jupyter_core +jupyter_server +jupyter_server_terminals +jupyterlab +jupyterlab-pygments +jupyterlab-widgets +jupyterlab_server +nbclient +nbconvert +nbformat +notebook +notebook_shim +pandocfilters +Glances +# extensions +jupyterlab-git +jupyter-tensorboard-proxy +jupyter-resource-usage +jupyter-vscode-proxy +jupyter-book +jupyterlab_myst +gh-scoped-creds +jupyter-server-proxy + diff --git a/.devcontainer/jupyterhub.Dockerfile b/.devcontainer/jupyterhub.Dockerfile new file mode 100644 index 0000000..f967fde --- /dev/null +++ b/.devcontainer/jupyterhub.Dockerfile @@ -0,0 +1,38 @@ +## devcontainer-focused Rocker +FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.3 + +## latest version of geospatial libs +RUN /rocker_scripts/experimental/install_dev_osgeo.sh +RUN apt-get update -qq && apt-get -y install vim + +# standard python/jupyter setup +ENV NB_USER=rstudio +ENV VIRTUAL_ENV=/opt/venv +ENV PATH=${VIRTUAL_ENV}/bin:${PATH} +RUN /rocker_scripts/install_python.sh && \ + chown ${NB_USER}:staff -R ${VIRTUAL_ENV} + +# podman doesn't not understand group permissions +RUN chown ${NB_USER}:staff -R ${R_HOME}/site-library + +# some teaching preferences +RUN git config --system pull.rebase false && \ + git config --system credential.helper 'cache --timeout=36000' + +## codeserver +RUN curl -fsSL https://code-server.dev/install.sh | sh + +USER rstudio +WORKDIR /home/rstudio +RUN usermod -s /bin/bash rstudio +ENV PATH=$PATH:/home/rstudio/.local/bin + +COPY jupyter-requirements.txt jupyter-requirements.txt +RUN python -m pip install -r jupyter-requirements.txt && rm jupyter-requirements.txt + +COPY nasa-requirements.txt requirements.txt +RUN python -m pip install -r requirements.txt && rm requirements.txt + +COPY install.R install.R +RUN Rscript install.R && rm install.R + diff --git a/.devcontainer/nasa-requirements.txt b/.devcontainer/nasa-requirements.txt new file mode 100644 index 0000000..c8dc3a7 --- /dev/null +++ b/.devcontainer/nasa-requirements.txt @@ -0,0 +1,31 @@ +jupyterhub +jupyterlab +notebook +jupyter-rsession-proxy +jupyter-console==6.6.3 +jupyter-events==0.7.0 +jupyter-lsp==2.2.0 +jupyter_client==8.3.1 +jupyter_core==5.3.2 +jupyter_server==2.7.3 +jupyter_server_terminals==0.4.4 +jupyter-vscode-proxy==0.5 +jupyterlab-pygments==0.2.2 +jupyterlab-widgets==3.0.9 +jupyterlab_server==2.25.0 +nbconvert==7.8.0 +nbformat==5.9.2 +odc-stac==0.3.8 +planetary-computer==1.0.0 +polars +pyarrow +pystac-client==0.7.5 +gh-scoped-creds +scikit-image +hvplot +geoviews +earthaccess +pyresample +contextily +pygeoweaver + diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml new file mode 100644 index 0000000..0dc65ed --- /dev/null +++ b/.github/workflows/test-build.yaml @@ -0,0 +1,27 @@ +on: + workflow_dispatch: + push: + branches: main + schedule: + - cron: "0 0 1 * *" # monthly + +name: Quarto Test Build + +jobs: + build-deploy: + runs-on: ubuntu-latest + container: + image: ghcr.io/eeholmes/earthdata-cloud-cookbook/cookbook:latest + options: --user root --security-opt seccomp=unconfined + permissions: + contents: write + steps: + - name: Quarto-inside-docker permissions + run: git config --system --add safe.directory '*' + + - name: Check out repository + uses: actions/checkout@v3 + + - name: Render + run: | + quarto render --no-cache