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
2 changes: 1 addition & 1 deletion src/r-apt/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "R (via apt)",
"id": "r-apt",
"version": "0.4.2",
"version": "0.5.0",
"description": "Installs the latest R, some R packages, and needed dependencies. Note: May require source code compilation for some R packages.",
"documentationURL": "https://github.com/rocker-org/devcontainer-features/tree/main/src/r-apt",
"options": {
Expand Down
24 changes: 9 additions & 15 deletions src/r-apt/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,18 +38,6 @@ if [ "${architecture}" != "amd64" ] && [ "${architecture}" != "arm64" ]; then
exit 1
fi

# Only debian testing supports arm64
# shellcheck source=/dev/null
source /etc/os-release
if [ "${ID}" = "ubuntu" ] && [ "${architecture}" != "amd64" ]; then
echo "(!) Ubuntu $architecture unsupported"
exit 1
fi
if [ "${ID}" = "debian" ] && [ "${architecture}" != "amd64" ] && [ "${USE_TESTING}" != "true" ]; then
echo "(!) To use Debian $architecture, please set useTesting option to true"
exit 1
fi

# Determine the appropriate non-root user
if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then
USERNAME=""
Expand Down Expand Up @@ -144,13 +132,15 @@ usermod -a -G staff "${USERNAME}"

check_packages curl ca-certificates

# shellcheck source=/dev/null
source /etc/os-release
if [ "${ID}" = "ubuntu" ]; then
echo "Set up for Ubuntu..."
curl -fsSL https://cloud.r-project.org/bin/linux/ubuntu/marutter_pubkey.asc | tee -a /etc/apt/trusted.gpg.d/cran_ubuntu_key.asc >/dev/null
echo "deb [arch=amd64] https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-ubuntu.list
echo "deb https://cloud.r-project.org/bin/linux/ubuntu ${UBUNTU_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-ubuntu.list
echo "Set up r2u..."
curl -fsSL https://eddelbuettel.github.io/r2u/assets/dirk_eddelbuettel_key.asc | tee -a /etc/apt/trusted.gpg.d/cranapt_key.asc >/dev/null
echo "deb [arch=amd64] https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" >/etc/apt/sources.list.d/cranapt.list
echo "deb https://r2u.stat.illinois.edu/ubuntu ${UBUNTU_CODENAME} main" >/etc/apt/sources.list.d/cranapt.list
# Pinning
cat <<EOF >"/etc/apt/preferences.d/99cranapt"
Package: *
Expand All @@ -167,7 +157,7 @@ elif [ "${ID}" = "debian" ]; then
else
echo "Set up for Debian ${VERSION_CODENAME}..."
curl -fsSL "https://keyserver.ubuntu.com/pks/lookup?op=get&search=0x95c0faf38db3ccad0c080a7bdc78b2ddeabc47b7" | tee -a /etc/apt/trusted.gpg.d/cran_debian_key.asc >/dev/null
echo "deb [arch=amd64] http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-debian.list
echo "deb http://cloud.r-project.org/bin/linux/debian ${VERSION_CODENAME}-cran40/" >/etc/apt/sources.list.d/cran-debian.list
fi
# On Debian, renv, languageserver and httpgd are not available via apt
# shellcheck disable=SC2206
Expand All @@ -176,6 +166,10 @@ elif [ "${ID}" = "debian" ]; then
APT_PACKAGES=(${APT_PACKAGES[@]/r-cran-languageserver})
# shellcheck disable=SC2206
APT_PACKAGES=(${APT_PACKAGES[@]/r-cran-httpgd})
else
echo "(!) Unsupported distribution: ${ID}"
echo " This script is designed only for Debian and Ubuntu."
exit 1
fi

apt-get update -y
Expand Down
31 changes: 16 additions & 15 deletions test/r-apt/scenarios.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,21 +41,22 @@
}
}
},
"all-on-not-testing": {
"image": "debian:stable-slim",
"features": {
"r-apt": {
"useTesting": false,
"vscodeRSupport": "full",
"installDevTools": true,
"installREnv": true,
"installRMarkdown": true,
"installVscDebugger": true,
"installJupyterlab": true,
"installRadian": true
}
}
},
// TODO: some packages are not available on stable for now
// "all-on-not-testing": {
// "image": "debian:stable-slim",
// "features": {
// "r-apt": {
// "useTesting": false,
// "vscodeRSupport": "full",
// "installDevTools": true,
// "installREnv": true,
// "installRMarkdown": true,
// "installVscDebugger": true,
// "installJupyterlab": true,
// "installRadian": true
// }
// }
// },
// TODO: enable tesing on debian
// "bspm-debian": {
// "image": "mcr.microsoft.com/devcontainers/base:debian",
Expand Down