From 48536cbea57039361c777c457a0cbc7cb42f513b Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 22:49:26 -0800 Subject: [PATCH 1/6] build without cache for refresh --- .github/workflows/test-build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 0dc65ed..e4c9396 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -24,4 +24,4 @@ jobs: - name: Render run: | - quarto render --no-cache + quarto render --cache-refresh From ff01ab45dfa0883836f11e4d1e499efeb2264aed Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 22:54:09 -0800 Subject: [PATCH 2/6] actually build from scratch to test --- .github/workflows/test-build.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-build.yaml b/.github/workflows/test-build.yaml index 15a9e3e..abff0dd 100644 --- a/.github/workflows/test-build.yaml +++ b/.github/workflows/test-build.yaml @@ -24,4 +24,5 @@ jobs: - name: Render run: | - quarto render --cache-refresh + rm -rf _freeze + quarto render From 0cd68e43e0c1f9cb918327babca47fa20df09ff0 Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 22:57:59 -0800 Subject: [PATCH 3/6] testing --- .devcontainer/devcontainer.json | 53 ++------------------------ .devcontainer/full-devcontainer.json | 53 ++++++++++++++++++++++++++ .devcontainer/jupyter-requirements.txt | 1 + .devcontainer/jupyterhub.Dockerfile | 8 ++-- 4 files changed, 61 insertions(+), 54 deletions(-) create mode 100644 .devcontainer/full-devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index e0b59ad..5748966 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,53 +1,6 @@ { "image": "ghcr.io/boettiger-lab/nasa-tops:latest", "runArgs": [ "--security-opt", "seccomp=unconfined" ], - "name": "NASA TOPS Environment", - // build image as a github-action and grab instead; faster. - // "build": { - // "dockerfile": "Dockerfile" - //}, - "waitFor": "onCreateCommand", - "features": { - "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}, - // Install JupyterLab and IRkernel. - // More info: https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver - "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { - "version": "none", - "installJupyterlab": true - } - }, - "customizations": { - "codespaces": { - "openFiles": ["README.md"] - }, - "vscode": { - "settings": { - "r.rterm.linux": "/usr/local/bin/radian", - "r.bracketedPaste": true, - "r.plot.useHttpgd": true, - "[r]": { - "editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?" - } - }, - "extensions": [ - "reditorsupport.r", - "rdebugger.r-debugger", - "ms-toolsai.jupyter", - "ms-python.python" - ] - } - }, - // Forward the RStudio ports - "forwardPorts": [8787], - "portsAttributes": { - "8787": { - "label": "Rstudio", - "requireLocalPort": true, - "onAutoForward": "ignore" - } - }, - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "bash .devcontainer/setup.sh", - "postAttachCommand": "sudo rstudio-server start &> /dev/null && bash .devcontainer/welcome.sh", - "remoteUser": "rstudio" - } + "name": "NASA TOPS Environment" +} + diff --git a/.devcontainer/full-devcontainer.json b/.devcontainer/full-devcontainer.json new file mode 100644 index 0000000..e0b59ad --- /dev/null +++ b/.devcontainer/full-devcontainer.json @@ -0,0 +1,53 @@ +{ + "image": "ghcr.io/boettiger-lab/nasa-tops:latest", + "runArgs": [ "--security-opt", "seccomp=unconfined" ], + "name": "NASA TOPS Environment", + // build image as a github-action and grab instead; faster. + // "build": { + // "dockerfile": "Dockerfile" + //}, + "waitFor": "onCreateCommand", + "features": { + "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}, + // Install JupyterLab and IRkernel. + // More info: https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver + "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { + "version": "none", + "installJupyterlab": true + } + }, + "customizations": { + "codespaces": { + "openFiles": ["README.md"] + }, + "vscode": { + "settings": { + "r.rterm.linux": "/usr/local/bin/radian", + "r.bracketedPaste": true, + "r.plot.useHttpgd": true, + "[r]": { + "editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?" + } + }, + "extensions": [ + "reditorsupport.r", + "rdebugger.r-debugger", + "ms-toolsai.jupyter", + "ms-python.python" + ] + } + }, + // Forward the RStudio ports + "forwardPorts": [8787], + "portsAttributes": { + "8787": { + "label": "Rstudio", + "requireLocalPort": true, + "onAutoForward": "ignore" + } + }, + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/setup.sh", + "postAttachCommand": "sudo rstudio-server start &> /dev/null && bash .devcontainer/welcome.sh", + "remoteUser": "rstudio" + } diff --git a/.devcontainer/jupyter-requirements.txt b/.devcontainer/jupyter-requirements.txt index 1cc0219..6dba969 100644 --- a/.devcontainer/jupyter-requirements.txt +++ b/.devcontainer/jupyter-requirements.txt @@ -25,6 +25,7 @@ jupyterlab-git jupyter-tensorboard-proxy jupyter-resource-usage jupyter-vscode-proxy +jupyter-rsession-proxy jupyter-book jupyterlab_myst gh-scoped-creds diff --git a/.devcontainer/jupyterhub.Dockerfile b/.devcontainer/jupyterhub.Dockerfile index f967fde..4b14522 100644 --- a/.devcontainer/jupyterhub.Dockerfile +++ b/.devcontainer/jupyterhub.Dockerfile @@ -1,4 +1,4 @@ -## devcontainer-focused Rocker +# devcontainer-focused Rocker FROM ghcr.io/rocker-org/devcontainer/tidyverse:4.3 ## latest version of geospatial libs @@ -19,7 +19,7 @@ RUN chown ${NB_USER}:staff -R ${R_HOME}/site-library RUN git config --system pull.rebase false && \ git config --system credential.helper 'cache --timeout=36000' -## codeserver +# codeserver RUN curl -fsSL https://code-server.dev/install.sh | sh USER rstudio @@ -28,10 +28,10 @@ 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 +RUN python -m pip install --no-cache-dir -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 +RUN python -m pip install --no-cache-dir -r requirements.txt && rm requirements.txt COPY install.R install.R RUN Rscript install.R && rm install.R From 912d6bfd2220c7ebdd1bc5838a2be7b83a43a7e5 Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 23:05:56 -0800 Subject: [PATCH 4/6] organizing --- _quarto.yml | 6 ++---- {contents => drafts}/ace.qmd | 0 {contents => drafts}/bii_hexes.html | 0 3 files changed, 2 insertions(+), 4 deletions(-) rename {contents => drafts}/ace.qmd (100%) rename {contents => drafts}/bii_hexes.html (100%) diff --git a/_quarto.yml b/_quarto.yml index c9fc04c..22edb13 100644 --- a/_quarto.yml +++ b/_quarto.yml @@ -33,17 +33,15 @@ website: - text: JuypterHub icon: cloud href: https://openscapes.2i2c.cloud/ - - section: Recipes + - section: Tutorials contents: - text: Introduction icon: play-btn href: contents/intro.qmd - - text: Biodiversity Priorities - icon: tree-fill - href: contents/ace.qmd - text: NASA EarthData icon: rocket href: contents/earthdata.qmd + - section: Recipes - section: Background contents: - text: Portable Environments diff --git a/contents/ace.qmd b/drafts/ace.qmd similarity index 100% rename from contents/ace.qmd rename to drafts/ace.qmd diff --git a/contents/bii_hexes.html b/drafts/bii_hexes.html similarity index 100% rename from contents/bii_hexes.html rename to drafts/bii_hexes.html From ebb416305aa3973afd291778f8065309003113ab Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 23:27:39 -0800 Subject: [PATCH 5/6] wip --- .devcontainer/install.R | 2 +- .devcontainer/jupyterhub.Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.devcontainer/install.R b/.devcontainer/install.R index 760d0fc..33d5fb6 100755 --- a/.devcontainer/install.R +++ b/.devcontainer/install.R @@ -4,7 +4,7 @@ # 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", "pak")) +install.packages(c("rstac", "spData", "earthdatalogin", "quarto", "pak", "decor")) pak::pkg_install('github::r-tmap/tmap') # vscode and jupyter plugins diff --git a/.devcontainer/jupyterhub.Dockerfile b/.devcontainer/jupyterhub.Dockerfile index 4b14522..319baad 100644 --- a/.devcontainer/jupyterhub.Dockerfile +++ b/.devcontainer/jupyterhub.Dockerfile @@ -20,7 +20,7 @@ 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 +RUN curl -fsSL https://code-server.dev/install.sh | sh && rm -rf .cache USER rstudio WORKDIR /home/rstudio From be3918421ffc9ade27047bf02d674933343c87d6 Mon Sep 17 00:00:00 2001 From: Carl Date: Sat, 3 Feb 2024 23:55:39 -0800 Subject: [PATCH 6/6] codespaces jupyter not a real hub --- .devcontainer/devcontainer.json | 53 ++++++++++++++++++++++++++-- .devcontainer/full-devcontainer.json | 53 ---------------------------- 2 files changed, 50 insertions(+), 56 deletions(-) delete mode 100644 .devcontainer/full-devcontainer.json diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 5748966..e0b59ad 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,6 +1,53 @@ { "image": "ghcr.io/boettiger-lab/nasa-tops:latest", "runArgs": [ "--security-opt", "seccomp=unconfined" ], - "name": "NASA TOPS Environment" -} - + "name": "NASA TOPS Environment", + // build image as a github-action and grab instead; faster. + // "build": { + // "dockerfile": "Dockerfile" + //}, + "waitFor": "onCreateCommand", + "features": { + "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}, + // Install JupyterLab and IRkernel. + // More info: https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver + "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { + "version": "none", + "installJupyterlab": true + } + }, + "customizations": { + "codespaces": { + "openFiles": ["README.md"] + }, + "vscode": { + "settings": { + "r.rterm.linux": "/usr/local/bin/radian", + "r.bracketedPaste": true, + "r.plot.useHttpgd": true, + "[r]": { + "editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?" + } + }, + "extensions": [ + "reditorsupport.r", + "rdebugger.r-debugger", + "ms-toolsai.jupyter", + "ms-python.python" + ] + } + }, + // Forward the RStudio ports + "forwardPorts": [8787], + "portsAttributes": { + "8787": { + "label": "Rstudio", + "requireLocalPort": true, + "onAutoForward": "ignore" + } + }, + // Use 'postCreateCommand' to run commands after the container is created. + "postCreateCommand": "bash .devcontainer/setup.sh", + "postAttachCommand": "sudo rstudio-server start &> /dev/null && bash .devcontainer/welcome.sh", + "remoteUser": "rstudio" + } diff --git a/.devcontainer/full-devcontainer.json b/.devcontainer/full-devcontainer.json deleted file mode 100644 index e0b59ad..0000000 --- a/.devcontainer/full-devcontainer.json +++ /dev/null @@ -1,53 +0,0 @@ -{ - "image": "ghcr.io/boettiger-lab/nasa-tops:latest", - "runArgs": [ "--security-opt", "seccomp=unconfined" ], - "name": "NASA TOPS Environment", - // build image as a github-action and grab instead; faster. - // "build": { - // "dockerfile": "Dockerfile" - //}, - "waitFor": "onCreateCommand", - "features": { - "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {}, - // Install JupyterLab and IRkernel. - // More info: https://github.com/rocker-org/devcontainer-templates/tree/main/src/r-ver - "ghcr.io/rocker-org/devcontainer-features/r-rig:1": { - "version": "none", - "installJupyterlab": true - } - }, - "customizations": { - "codespaces": { - "openFiles": ["README.md"] - }, - "vscode": { - "settings": { - "r.rterm.linux": "/usr/local/bin/radian", - "r.bracketedPaste": true, - "r.plot.useHttpgd": true, - "[r]": { - "editor.wordSeparators": "`~!@#%$^&*()-=+[{]}\\|;:'\",<>/?" - } - }, - "extensions": [ - "reditorsupport.r", - "rdebugger.r-debugger", - "ms-toolsai.jupyter", - "ms-python.python" - ] - } - }, - // Forward the RStudio ports - "forwardPorts": [8787], - "portsAttributes": { - "8787": { - "label": "Rstudio", - "requireLocalPort": true, - "onAutoForward": "ignore" - } - }, - // Use 'postCreateCommand' to run commands after the container is created. - "postCreateCommand": "bash .devcontainer/setup.sh", - "postAttachCommand": "sudo rstudio-server start &> /dev/null && bash .devcontainer/welcome.sh", - "remoteUser": "rstudio" - }