-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #154 from nmfs-opensci/eeholmes-patch-1
add install vscode extensions
- Loading branch information
Showing
4 changed files
with
57 additions
and
6 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 |
---|---|---|
@@ -1,3 +1,10 @@ | ||
LABEL org.opencontainers.image.maintainers="[email protected]" | ||
LABEL org.opencontainers.image.author="[email protected]" | ||
LABEL org.opencontainers.image.source=https://github.com/nmfs-opensci/py-rocket-base | ||
LABEL org.opencontainers.image.description="JupyterHub image with Python 3.11 and Tidyverse based R 4.4 and RStudio" | ||
LABEL org.opencontainers.image.licenses=Apache2.0 | ||
LABEL org.opencontainers.image.version=2024.11.06 | ||
|
||
USER root | ||
|
||
# Clean up extra files in ${REPO_DIR} | ||
|
@@ -48,6 +55,9 @@ RUN mkdir -p /pyrocket_scripts && cp -r ${REPO_DIR}/scripts/* /pyrocket_scripts/ | |
RUN chown -R root:staff /pyrocket_scripts && \ | ||
chmod -R 775 /pyrocket_scripts | ||
|
||
# Some basic VS Code extensions | ||
RUN /pyrocket_scripts/install-vscode-ext.sh ${REPO_DIR}/vscode-extensions.txt | ||
|
||
# Convert NB_USER to ENV (from ARG) so that it passes to the child dockerfile | ||
ENV NB_USER=${NB_USER} | ||
|
||
|
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,37 @@ | ||
#!/bin/bash | ||
|
||
# Install VSCode extensions. | ||
# These get installed to $CONDA_PREFIX/envs/notebook/share/code-server/extensions/ | ||
|
||
# Check if a filename argument is provided | ||
if [ -z "$1" ]; then | ||
echo "Error: install-vscode-extensions.sh requires an input file of extension names (typically called vscode-extensions.txt)." >&2 | ||
echo "Usage: RUN /pyrocket_scripts/install-vscode-extensions.sh <filename>" | ||
exit 1 | ||
fi | ||
|
||
# Check the user and output which user the script is running as | ||
if [[ $(id -u) -eq 0 ]]; then | ||
echo "Running install-vscode-extensions.sh as root." | ||
else | ||
echo "Running install-vscode-extensions.sh as ${NB_USER}." | ||
fi | ||
|
||
ext_file="$1" | ||
|
||
# Verify that ext_file exists and is a file | ||
if [ ! -f "${ext_file}" ]; then | ||
echo " Error: Specified file '$ext_file' does not exist." | ||
exit 1 | ||
fi | ||
|
||
# Install each extension listed in the file | ||
while IFS= read -r EXT; do | ||
if code-server --install-extension "$EXT"; then | ||
echo " Successfully installed extension: $EXT" | ||
else | ||
echo " Failed to install extension: $EXT" >&2 | ||
fi | ||
done < "$ext_file" | ||
|
||
echo " Success! install-vscode-extensions.sh" |
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
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,3 @@ | ||
ms-python.python | ||
ms-toolsai.jupyter | ||
quarto.quarto |