Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 9 additions & 32 deletions .github/.devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,38 +10,15 @@
},
"remoteUser": "vscode",
"features": {
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": {
"version": "release",
"vscodeRSupport": "none",
"installDevTools": "false",
"installREnv": "true",
"installRMarkdown": "false"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "latest",
"enableShared": "true"
},
"ghcr.io/julialang/devcontainer-features/julia:1": {
"channel": "release"
},
"./quarto-computing-dependencies": {
"dependencies": "all"
},
"ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
"version": "prerelease",
"installTinyTex": "true",
"installChromium": "false"
}
"rDeps": "rmarkdown,httpgd",
"pythonDeps": "jupyter,papermill",
"juliaDeps": "IJulia"
}//,
// "ghcr.io/rocker-org/devcontainer-features/quarto-cli:1": {
// "version": "prerelease",
// "installTinyTex": "true",
// "installChromium": "false"
// }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,52 @@
"name": "Install Computing Dependencies for Quarto",
"description": "Install R, Python, and Julia dependencies for Quarto.",
"options": {
"dependencies": {
"rDeps": {
"type": "string",
"enum": ["all", "r", "python", "julia"],
"default": "all",
"description": "Specify what dependencies to install."
}
"default": "rmarkdown",
"description": "Specify what R dependencies to install."
},
"pythonDeps": {
"type": "string",
"default": "jupyter,papermill",
"description": "Specify what Python dependencies to install."
},
"juliaDeps": {
"type": "string",
"default": "IJulia",
"description": "Specify what Julia dependencies to install."
}
},
"dependsOn": {
"ghcr.io/devcontainers/features/common-utils": {},
"ghcr.io/rocker-org/devcontainer-features/r-rig": {},
"ghcr.io/devcontainers/features/python": {},
"ghcr.io/julialang/devcontainer-features/julia": {}
"ghcr.io/devcontainers/features/common-utils:2": {
"installZsh": "true",
"username": "vscode",
"userUid": "1000",
"userGid": "1000",
"upgradePackages": "true"
},
"ghcr.io/devcontainers/features/git:1": {
"version": "latest",
"ppa": "false"
},
"ghcr.io/rocker-org/devcontainer-features/r-rig:1": {
"version": "release",
"vscodeRSupport": "none",
"installDevTools": "false",
"installREnv": "true",
"installRMarkdown": "false"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "latest",
"enableShared": "true"
},
"ghcr.io/julialang/devcontainer-features/julia:1": {
"channel": "release"
}
},
"installsAfter": [
"ghcr.io/devcontainers/features/common-utils",
"ghcr.io/devcontainers/features/git",
"ghcr.io/rocker-org/devcontainer-features/r-rig",
"ghcr.io/devcontainers/features/python",
"ghcr.io/julialang/devcontainer-features/julia"
Expand Down
37 changes: 16 additions & 21 deletions .github/.devcontainer/quarto-computing-dependencies/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ set -e

export DEBIAN_FRONTEND=noninteractive

DEPENDENCIES=${DEPENDENCIES:-"all"}

USERNAME=${USERNAME:-${_REMOTE_USER:-"automatic"}}

R_DEPS=${RDEPS:-"rmarkdown"}
PYTHON_DEPS=${PYTHONDEPS:-"jupyter,papermill"}
JULIA_DEPS=${JULIADEPS:-"IJulia"}

set -e

if [ "$(id -u)" -ne 0 ]; then
Expand All @@ -33,30 +35,23 @@ elif [ "${USERNAME}" = "none" ] || ! id -u "${USERNAME}" >/dev/null 2>&1; then
fi

quarto_r_deps() {
su "${USERNAME}" -c "Rscript -e 'pak::pkg_install(\"rmarkdown\")'"
local deps=$1
deps=$(echo "${deps}" | sed 's/,/","/g')
su "${USERNAME}" -c "Rscript -e 'pak::pkg_install(c(\"${deps}\"))'"
}

quarto_python_deps() {
su "${USERNAME}" -c "python3 -m pip install jupyter papermill"
local deps=$1
deps=$(echo "${deps}" | sed 's/,/ /g')
python3 -m pip install ${deps}
}

quarto_julia_deps() {
su "${USERNAME}" -c "~/.juliaup/bin/julia -e 'using Pkg; Pkg.add(\"IJulia\")'"
local deps=$1
deps=$(echo "${deps}" | sed 's/,/","/g')
su "${USERNAME}" -c "~/.juliaup/bin/julia -e 'using Pkg; Pkg.add.([\"${deps}\"])'"
}

case ${DEPENDENCIES} in
all)
quarto_r_deps
quarto_python_deps
quarto_julia_deps
;;
r)
quarto_r_deps
;;
python)
quarto_python_deps
;;
julia)
quarto_julia_deps
;;
esac
quarto_r_deps ${R_DEPS}
quarto_python_deps ${PYTHON_DEPS}
quarto_julia_deps ${JULIA_DEPS}