From ec0951a17fa43db6fa5f586c7645079ff219fcba Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Wed, 19 Jun 2024 10:51:02 -0700 Subject: [PATCH 1/2] Simple install of extensions, extensions dir set by conda code-server --- ci/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ci/Dockerfile b/ci/Dockerfile index c2b8a41..bbe35bf 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -7,9 +7,6 @@ COPY --chown=jovyan:jovyan . /home/jovyan/.kernels USER root ENV QUARTO_CLI=https://github.com/quarto-dev/quarto-cli/releases/download/v1.3.433/quarto-1.3.433-linux-amd64.deb - -ENV VSCODE_EXT_DIR=/opt/code-server/extensions -RUN mkdir -p ${VSCODE_EXT_DIR} && chown -R ${NB_USER}: ${VSCODE_EXT_DIR} RUN wget -O /tmp/quarto.deb ${QUARTO_CLI} && dpkg -i /tmp/quarto.deb && rm -rf /tmp/quarto.deb && apt-get clean @@ -19,8 +16,8 @@ WORKDIR ${HOME}/.kernels RUN chmod +x install-kernels.sh && cd /home/jovyan/.kernels && ./install-kernels.sh environments -RUN echo "extensions-dir: $VSCODE_EXT_DIR" >> $HOME/.config/code-server/config.yaml && \ - EXT_LIST="ms-python.python quarto.quarto" && \ +# Install VSCode extensions. These get installed to $CONDA_PREFIX/envs/notebook/share/code-server/extensions/ +RUN EXT_LIST="ms-python.python quarto.quarto" && \ for EXT in $EXT_LIST; do code-server --install-extension $EXT; done ENV JUPYTERHUB_HTTP_REFERER=https://openscapes.2i2c.cloud/ From ff83d03c054b5b47b5107c082b1dab31d0c7ea58 Mon Sep 17 00:00:00 2001 From: Andy Teucher Date: Wed, 19 Jun 2024 15:04:22 -0700 Subject: [PATCH 2/2] move extension list to file, add install script --- ci/Dockerfile | 4 +--- ci/install-vscode-ext.sh | 15 +++++++++++++++ ci/vscode-extensions.txt | 3 +++ 3 files changed, 19 insertions(+), 3 deletions(-) create mode 100755 ci/install-vscode-ext.sh create mode 100644 ci/vscode-extensions.txt diff --git a/ci/Dockerfile b/ci/Dockerfile index bbe35bf..f15231f 100644 --- a/ci/Dockerfile +++ b/ci/Dockerfile @@ -16,9 +16,7 @@ WORKDIR ${HOME}/.kernels RUN chmod +x install-kernels.sh && cd /home/jovyan/.kernels && ./install-kernels.sh environments -# Install VSCode extensions. These get installed to $CONDA_PREFIX/envs/notebook/share/code-server/extensions/ -RUN EXT_LIST="ms-python.python quarto.quarto" && \ - for EXT in $EXT_LIST; do code-server --install-extension $EXT; done +RUN chmod +x install-vscode-ext.sh && ./install-vscode-ext.sh vscode-extensions.txt ENV JUPYTERHUB_HTTP_REFERER=https://openscapes.2i2c.cloud/ diff --git a/ci/install-vscode-ext.sh b/ci/install-vscode-ext.sh new file mode 100755 index 0000000..4de7fb1 --- /dev/null +++ b/ci/install-vscode-ext.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +# Install VSCode extensions. +# These get installed to $CONDA_PREFIX/envs/notebook/share/code-server/extensions/ + +ext_file="$1" + +echo "Checking for '$ext_file'..." + +if test -f "$ext_file" +then + for EXT in $(cat "$ext_file") + do code-server --install-extension $EXT + done +fi diff --git a/ci/vscode-extensions.txt b/ci/vscode-extensions.txt new file mode 100644 index 0000000..822df8a --- /dev/null +++ b/ci/vscode-extensions.txt @@ -0,0 +1,3 @@ +ms-python.python +ms-toolsai.jupyter +quarto.quarto \ No newline at end of file