diff --git a/scripts/create_builder.sh b/scripts/create_builder.sh index cd9366a..55a22a2 100755 --- a/scripts/create_builder.sh +++ b/scripts/create_builder.sh @@ -1,4 +1,8 @@ #!/usr/bin/env bash set -euxo pipefail -docker buildx create --name multiarch --driver docker-container --use +if ! docker buildx inspect multiarch &>/dev/null; then + docker buildx create --name multiarch --driver docker-container --use +else + docker buildx use multiarch +fi diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json index e82fdb5..d857f7f 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer-lock.json @@ -20,11 +20,6 @@ "resolved": "ghcr.io/devcontainers/features/git-lfs@sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72", "integrity": "sha256:71c2b371cf12ab7fcec47cf17369c6f59156100dad9abf9e4c593049d789de72" }, - "ghcr.io/devcontainers/features/python": { - "version": "1.7.1", - "resolved": "ghcr.io/devcontainers/features/python@sha256:cf9b6d879790a594b459845b207c5e1762a0c8f954bb8033ff396e497f9c301b", - "integrity": "sha256:cf9b6d879790a594b459845b207c5e1762a0c8f954bb8033ff396e497f9c301b" - }, "ghcr.io/devcontainers/features/rust": { "version": "1.5.0", "resolved": "ghcr.io/devcontainers/features/rust@sha256:0c55e65f2e3df736e478f26ee4d5ed41bae6b54dac1318c443e31444c8ed283c", diff --git a/src/s-core-devcontainer/.devcontainer/devcontainer.json b/src/s-core-devcontainer/.devcontainer/devcontainer.json index 4b774fa..241c872 100644 --- a/src/s-core-devcontainer/.devcontainer/devcontainer.json +++ b/src/s-core-devcontainer/.devcontainer/devcontainer.json @@ -10,7 +10,7 @@ "ppa": "true" }, "ghcr.io/devcontainers/features/git-lfs": { - // Installs the latest version from the Distribution + "version": "3.7.0", "autoPull": "false" // do not automatically pull LFS files when creating the container }, "ghcr.io/devcontainers/features/common-utils": { @@ -26,9 +26,6 @@ // In case we want this, the feature needs to be replaced with a custom installation script. "version": "20" }, - "ghcr.io/devcontainers/features/python": { - "version": "3.12.11" - }, "ghcr.io/devcontainers/features/rust": { "version": "1.83.0", "components": [ @@ -50,7 +47,6 @@ "ghcr.io/devcontainers/features/common-utils", "ghcr.io/devcontainers-community/features/llvm", "ghcr.io/devcontainers/features/rust", - "ghcr.io/devcontainers/features/python", "./s-core-local" ], "remoteUser": "vscode", diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh index f048854..b26366c 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/install.sh @@ -30,6 +30,12 @@ apt-get install -y graphviz="${graphviz_version}*" # Protobuf compiler, via APT (needed by FEO) apt-get install -y protobuf-compiler="${protobuf_compiler_version}*" +# Python, via APT +apt-get install -y python${python_version} python3-pip python3-venv +# The following packages correspond to the list of packages installed by the +# devcontainer feature "python" (cf. https://github.com/devcontainers/features/tree/main/src/python ) +apt-get install -y flake8 python3-autopep8 black python3-yapf mypy pydocstyle pycodestyle bandit pipenv virtualenv python3-pytest pylint + # Bazelisk, directly from GitHub # Using the existing devcontainer feature is not optimal: # - it does not check the SHA256 checksum of the downloaded file diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh index 686bd2f..889306c 100755 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/tests/test_default.sh @@ -13,6 +13,16 @@ check "validate graphviz has the correct version" bash -c "dpkg -s graphviz | gr # Other build-related tools check "validate protoc is working and has the correct version" bash -c "protoc --version | grep 'libprotoc ${protobuf_compiler_version}'" +# Python-related tools (a selected sub-set; others may be added later) +check "validate python3 is working and has the correct version" bash -c "python3 --version | grep '${python_version}'" +check "validate pip3 is working and has the correct version" bash -c "pip3 --version | grep '${python_version}'" +check "validate black is working and has the correct version" bash -c "black --version | grep '${python_version}'" +# cannot grep versions as they do not match the Python version +check "validate virtualenv is working" bash -c "virtualenv --version" +check "validate flake8 is working" bash -c "flake8 --version" +check "validate pytest is working" bash -c "pytest --version" +check "validate pylint is working" bash -c "pylint --version" + # Bazel-related tools check "validate bazelisk is working and has the correct version" bash -c "bazelisk version | grep '${bazelisk_version}'" check "validate bazel is working and has the correct version" bash -c "bazel version | grep '${bazel_version}'" diff --git a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml index ab4436e..f16c5f0 100644 --- a/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml +++ b/src/s-core-devcontainer/.devcontainer/s-core-local/versions.yaml @@ -10,6 +10,9 @@ qemu_system_arm: sshpass: version: 1.09 +python: + version: "3.12" + bazel: # https://github.com/bazelbuild/bazel/releases -- latest version as of 2025-09-24 version: 8.4.1 diff --git a/src/s-core-devcontainer/test-project/test.sh b/src/s-core-devcontainer/test-project/test.sh index e1ff153..329c4c4 100755 --- a/src/s-core-devcontainer/test-project/test.sh +++ b/src/s-core-devcontainer/test-project/test.sh @@ -7,8 +7,7 @@ source "${SCRIPT_DIR}/../../../scripts/test-utils.sh" vscode # Common tooling check "validate git is working and has the correct version" bash -c "git --version | grep '2.49.0'" -check "validate git-lfs is working and has the correct version" bash -c "git lfs version | grep '3.7.0' " -check "validate python3 is working and has the correct version" bash -c "python3 --version | grep '3.12.11'" +check "validate git-lfs is working and has the correct version" bash -c "git lfs version | grep '3.7.0'" # C++ tooling check "validate clangd is working and has the correct version" bash -c "clangd --version | grep '20.1.8'"