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 .github/workflows/test-all.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
run: npm install -g @devcontainers/cli@0.12.1

- name: " Testing '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} -c `pwd`
2 changes: 1 addition & 1 deletion .github/workflows/test-manual.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
run: npm install -g @devcontainers/cli@0.12.1

- name: "Testing '${{ github.event.inputs.features }}' against '${{ github.event.inputs.baseImage }}'"
run: devcontainer features test --features ${{ github.event.inputs.features }} --base-image ${{ github.event.inputs.baseImage }} --collection-folder `pwd` --log-level ${{ github.event.inputs.logLevel }}
2 changes: 1 addition & 1 deletion .github/workflows/test-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
run: npm install -g @devcontainers/cli@0.12.1

- name: "Testing '${{ matrix.features }}' against '${{ matrix.baseImage }}'"
run: devcontainer features test -f ${{ matrix.features }} -i ${{ matrix.baseImage }} -c `pwd`
2 changes: 1 addition & 1 deletion .github/workflows/test-scenarios.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
- uses: actions/checkout@v2

- name: "Install latest devcontainer CLI"
run: npm install -g @devcontainers/cli
run: npm install -g @devcontainers/cli@0.12.1

- name: "Running predefined test scenarios"
run: devcontainer features test --scenarios `pwd`/test-scenarios -c `pwd`
2 changes: 1 addition & 1 deletion src/anaconda/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "anaconda",
"version": "1.0.0",
"version": "1.0.1",
"name": "Anaconda",
"options": {
"version": {
Expand Down
2 changes: 1 addition & 1 deletion src/anaconda/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ if ! conda --version &> /dev/null ; then
chown -R "${USERNAME}:conda" "${CONDA_DIR}"
chmod -R g+r+w "${CONDA_DIR}"

find "${CONDA_DIR}" -type d | xargs -n 1 chmod g+s
find "${CONDA_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
echo "Installing Anaconda..."

CONDA_VERSION=$VERSION
Expand Down
2 changes: 1 addition & 1 deletion src/dotnet/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "dotnet",
"version": "1.0.2",
"version": "1.0.3",
"name": "Dotnet CLI",
"description": "Installs the .NET CLI. Provides option of installing sdk or runtime, and option of versions to install. Uses latest version of .NET sdk as defaults to install.",
"options": {
Expand Down
4 changes: 2 additions & 2 deletions src/dotnet/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ install_using_apt_from_microsoft_repo() {
install_using_default_apt_repo() {
DOTNET_PACKAGE="dotnet6"

apt_get_update_if_needed
apt_get_update

if [[ "${DOTNET_VERSION}" = "latest" ]] || [[ "${DOTNET_VERSION}" = "lts" ]] || [[ ${DOTNET_VERSION} = "6"* ]]; then
if ! (apt-get install -yq ${DOTNET_PACKAGE}); then
Expand Down Expand Up @@ -460,7 +460,7 @@ if [ "${CHANGE_OWNERSHIP}" = "true" ]; then

chown -R "${USERNAME}:dotnet" "${TARGET_DOTNET_ROOT}"
chmod -R g+r+w "${TARGET_DOTNET_ROOT}"
find "${TARGET_DOTNET_ROOT}" -type d | xargs -n 1 chmod g+s
find "${TARGET_DOTNET_ROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi

echo "Done!"
2 changes: 1 addition & 1 deletion src/go/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "go",
"version": "1.0.1",
"version": "1.0.2",
"name": "Go",
"description": "Installs Go and common Go utilities. Auto-detects latest version and installs needed dependencies.",
"options": {
Expand Down
4 changes: 2 additions & 2 deletions src/go/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ EOF

chown -R "${USERNAME}:golang" "${TARGET_GOROOT}" "${TARGET_GOPATH}"
chmod -R g+r+w "${TARGET_GOROOT}" "${TARGET_GOPATH}"
find "${TARGET_GOROOT}" -type d | xargs -n 1 chmod g+s
find "${TARGET_GOPATH}" -type d | xargs -n 1 chmod g+s
find "${TARGET_GOROOT}" -type d -print0 | xargs -n 1 -0 chmod g+s
find "${TARGET_GOPATH}" -type d -print0 | xargs -n 1 -0 chmod g+s

echo "Done!"

2 changes: 1 addition & 1 deletion src/hugo/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "hugo",
"version": "1.0.0",
"version": "1.0.1",
"name": "Hugo",
"options": {
"version": {
Expand Down
2 changes: 1 addition & 1 deletion src/hugo/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ if ! hugo version &> /dev/null ; then

chown -R "${USERNAME}:hugo" "${HUGO_DIR}"
chmod -R g+r+w "${HUGO_DIR}"
find "${HUGO_DIR}" -type d | xargs -n 1 chmod g+s
find "${HUGO_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
fi

echo "Done!"
2 changes: 1 addition & 1 deletion src/java/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "java",
"version": "1.0.3",
"version": "1.0.4",
"name": "Java (via SDKMAN!)",
"description": "Installs Java, SDKMAN! (if not installed), and needed dependencies.",
"options": {
Expand Down
2 changes: 1 addition & 1 deletion src/java/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ if [ ! -d "${SDKMAN_DIR}" ]; then
# Install SDKMAN
curl -sSL "https://get.sdkman.io?rcupdate=false" | bash
chown -R "${USERNAME}:sdkman" ${SDKMAN_DIR}
find ${SDKMAN_DIR} -type d | xargs -d '\n' chmod g+s
find ${SDKMAN_DIR} -type d -print0 | xargs -d '\n' -0 chmod g+s
# Add sourcing of sdkman into bashrc/zshrc files (unless disabled)
updaterc "export SDKMAN_DIR=${SDKMAN_DIR}\n. \${SDKMAN_DIR}/bin/sdkman-init.sh"
fi
Expand Down
2 changes: 1 addition & 1 deletion src/oryx/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "oryx",
"version": "1.0.0",
"version": "1.0.1",
"name": "Oryx",
"description": "Installs the oryx CLI",
"containerEnv": {
Expand Down
6 changes: 3 additions & 3 deletions src/oryx/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ updaterc "export ORYX_SDK_STORAGE_BASE_URL=https://oryx-cdn.microsoft.io && expo

chown -R "${USERNAME}:oryx" "${ORYX_INSTALL_DIR}" "${BUILD_SCRIPT_GENERATOR}" "${ORYX}"
chmod -R g+r+w "${ORYX_INSTALL_DIR}" "${BUILD_SCRIPT_GENERATOR}" "${ORYX}"
find "${ORYX_INSTALL_DIR}" -type d | xargs -n 1 chmod g+s
find "${BUILD_SCRIPT_GENERATOR}" -type d | xargs -n 1 chmod g+s
find "${ORYX}" -type d | xargs -n 1 chmod g+s
find "${ORYX_INSTALL_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s
find "${BUILD_SCRIPT_GENERATOR}" -type d -print0 | xargs -n 1 -0 chmod g+s
find "${ORYX}" -type d -print0 | xargs -n 1 -0 chmod g+s

echo "Done!"
2 changes: 1 addition & 1 deletion src/php/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "php",
"version": "1.0.2",
"version": "1.0.3",
"name": "PHP",
"options": {
"version": {
Expand Down
2 changes: 1 addition & 1 deletion src/php/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -220,6 +220,6 @@ fi

chown -R "${USERNAME}:php" "${PHP_DIR}"
chmod -R g+r+w "${PHP_DIR}"
find "${PHP_DIR}" -type d | xargs -n 1 chmod g+s
find "${PHP_DIR}" -type d -print0 | xargs -n 1 -0 chmod g+s

echo "Done!"
2 changes: 1 addition & 1 deletion src/python/devcontainer-feature.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"id": "python",
"version": "1.0.2",
"version": "1.0.3",
"name": "Python",
"description": "Installs the provided version of Python, as well as PIPX, and other common Python utilities. JupyterLab is conditionally installed with the python feature. Note: May require source code compilation.",
"options": {
Expand Down
26 changes: 16 additions & 10 deletions src/python/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
PYTHON_VERSION=${VERSION:-"latest"} # 'system' checks the base image first, else installs 'latest'
INSTALL_PYTHON_TOOLS=${INSTALLTOOLS:-"true"}
OPTIMIZE_BUILD_FROM_SOURCE=${OPTIMIZE:-"false"}
PYTHON_INSTALL_PATH=${INSTALL_PATH:-"/usr/local/python"}
PYTHON_INSTALL_PATH=${INSTALLPATH:-"/usr/local/python"}
OVERRIDE_DEFAULT_VERSION=${OVERRIDEDEFAULTVERSION:-"true"}

export PIPX_HOME=${PIPX_HOME:-"/usr/local/py-utils"}
Expand Down Expand Up @@ -335,7 +335,12 @@ install_python() {
# If the os-provided versions are "good enough", detect that and bail out.
if [ ${PYTHON_VERSION} = "os-provided" ] || [ ${PYTHON_VERSION} = "system" ]; then
check_packages python3 python3-doc python3-pip python3-venv python3-dev python3-tk
PYTHON_INSTALL_PATH="/usr"
PYTHON_ROOT="/usr/bin"

ln -s "${PYTHON_ROOT}/python3" "${PYTHON_ROOT}/python"
ln -s "${PYTHON_ROOT}/pydoc3" "${PYTHON_ROOT}/pydoc"
ln -s "${PYTHON_ROOT}/python3-config" "${PYTHON_ROOT}/python-config"

should_install_from_source=false
elif [ "$(dpkg --print-architecture)" = "amd64" ] && [ "${USE_ORYX_IF_AVAILABLE}" = "true" ] && type oryx > /dev/null 2>&1; then
install_using_oryx $version || should_install_from_source=true
Expand Down Expand Up @@ -366,9 +371,7 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
CURRENT_PATH="${PYTHON_INSTALL_PATH}/current"

install_python ${PYTHON_VERSION}

updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi"


# Additional python versions to be installed but not be set as default.
if [ ! -z "${ADDITIONAL_VERSIONS}" ]; then
OLDIFS=$IFS
Expand All @@ -381,11 +384,14 @@ if [ "${PYTHON_VERSION}" != "none" ]; then
IFS=$OLDIFS
fi

chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}"
chmod -R g+r+w "${PYTHON_INSTALL_PATH}"
find "${PYTHON_INSTALL_PATH}" -type d | xargs -n 1 chmod g+s
if [ ${PYTHON_VERSION} != "os-provided" ] && [ ${PYTHON_VERSION} != "system" ]; then
updaterc "if [[ \"\${PATH}\" != *\"${CURRENT_PATH}/bin\"* ]]; then export PATH=${CURRENT_PATH}/bin:\${PATH}; fi"
Comment thread
samruddhikhandale marked this conversation as resolved.
chown -R "${USERNAME}:python" "${PYTHON_INSTALL_PATH}"
chmod -R g+r+w "${PYTHON_INSTALL_PATH}"
find "${PYTHON_INSTALL_PATH}" -type d -print0 | xargs -0 -n 1 chmod g+s

PATH="${INSTALL_PATH}/bin:${PATH}"
PATH="${INSTALL_PATH}/bin:${PATH}"
fi
fi

# Install Python tools if needed
Expand All @@ -403,7 +409,7 @@ if [[ "${INSTALL_PYTHON_TOOLS}" = "true" ]] && [[ $(python --version) != "" ]];
mkdir -p ${PIPX_BIN_DIR}
chown -R "${USERNAME}:pipx" ${PIPX_HOME}
chmod -R g+r+w "${PIPX_HOME}"
find "${PIPX_HOME}" -type d | xargs -n 1 chmod g+s
find "${PIPX_HOME}" -type d -print0 | xargs -0 -n 1 chmod g+s

# Update pip if not using os provided python
if [[ $(python --version) != "" ]] || [[ ${PYTHON_VERSION} != "os-provided" ]] && [[ ${PYTHON_VERSION} != "system" ]] && [[ ${PYTHON_VERSION} != "none" ]]; then
Expand Down
16 changes: 16 additions & 0 deletions test-scenarios/install_os_provided_python.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/bin/bash

set -e

# Optional: Import test library
source dev-container-features-test-lib

check "python3 is installed" python3 --version
check "python is installed" python --version
check "pip is installed" pip --version
check "pip is installed" pip3 --version

check "node is installed" node --version

# Report result
reportResults
9 changes: 8 additions & 1 deletion test-scenarios/scenarios.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{
"install_os_provided_python": {
"image": "mcr.microsoft.com/devcontainers/base:0-bullseye",
"features": {
"node": "latest",
"python": "os-provided"
}
},
"install_gradle_and_maven": {
"image": "ubuntu:focal",
"features": {
Expand Down Expand Up @@ -28,7 +35,7 @@
}
},
"install_jupyterlab": {
"image": "mcr.microsoft.com/vscode/devcontainers/base:focal",
"image": "mcr.microsoft.com/devcontainers/base:focal",
"remoteUser": "vscode",
"features": {
"common-utils": {
Expand Down