Skip to content
Open
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
4 changes: 2 additions & 2 deletions .github/workflows/check-ldconfig.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
persist-credentials: false

- name: Set up QEMU
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4

- name: Check ldconfig caches
run: bazel test //python3:check_ldconfig_tests
run: bazel test //python3:check_ldconfig_tests //python:check_ldconfig_tests
4 changes: 2 additions & 2 deletions .github/workflows/update-deb-package-snapshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:

- name: Set up QEMU
if: env.DISTROLESS_DIFF
uses: docker/setup-qemu-action@96fe6ef7f33517b61c61be40b68a1882f3264fb8 # v4
uses: docker/setup-qemu-action@1f40c72289eff860ee54a304f1438e3cff362e0a # v4

- name: Update ldconfig
if: env.DISTROLESS_DIFF
run: bazel run //python3:update_ldconfig
run: bazel run //python3:update_ldconfig //python:update_ldconfig

- name: Run update sboms script
if: env.DISTROLESS_DIFF
Expand Down
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,8 @@
/output/
# ignore user bazelrc
.bazelrc.user
*.log
*.log
.gocache/
/.gotmp

/python/Dockerfile
36 changes: 36 additions & 0 deletions BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ load("//java:config.bzl", "JAVA_ARCHITECTURES", "JAVA_DISTROS", "JAVA_MAJOR_VERS
load("//nodejs:config.bzl", "NODEJS_ARCHITECTURES", "NODEJS_DISTROS", "NODEJS_MAJOR_VERSIONS")
load("//private/oci:defs.bzl", "sign_and_push_all")
load("//private/tools/lifecycle:defs.bzl", "attach_lifecycle_tags")
load("//python:config.bzl", PBS_PYTHON_ARCHITECTURES = "PYTHON_ARCHITECTURES", PBS_PYTHON_DISTROS = "PYTHON_DISTROS", PBS_PYTHON_MAJOR_VERSIONS = "PYTHON_MAJOR_VERSIONS")
load("//python3:config.bzl", "PYTHON_ARCHITECTURES", "PYTHON_DISTROS")
load("//static:config.bzl", "STATIC_ARCHITECTURES", "STATIC_DISTROS")

package(default_visibility = ["//visibility:public"])

exports_files(["MODULE.bazel"])

DEFAULT_DISTRO = "debian13"

VARIANTS = [
Expand Down Expand Up @@ -196,6 +199,37 @@ NODEJS |= {
for (tag_base, debug_mode, user) in VARIANTS
}

###############
# PYTHON (PBS) #
###############
PYTHON = {
"{REGISTRY}/{PROJECT_ID}/python" + version + "-" + distro + ":" + tag_base + "-" + arch: "//python:python" + version.replace(".", "") + debug_mode + "_" + user + "_" + arch + "_" + distro
for version in PBS_PYTHON_MAJOR_VERSIONS
for distro in PBS_PYTHON_DISTROS
for arch in PBS_PYTHON_ARCHITECTURES[distro][version]
for (tag_base, debug_mode, user) in VARIANTS
}

PYTHON |= {
"{REGISTRY}/{PROJECT_ID}/python" + version + "-" + distro + ":" + tag_base: "//python:python" + version.replace(".", "") + debug_mode + "_" + user + "_" + distro
for version in PBS_PYTHON_MAJOR_VERSIONS
for distro in PBS_PYTHON_DISTROS
for (tag_base, debug_mode, user) in VARIANTS
}

PYTHON |= {
"{REGISTRY}/{PROJECT_ID}/python" + version + ":" + tag_base + "-" + arch: "//python:python" + version.replace(".", "") + debug_mode + "_" + user + "_" + arch + "_" + DEFAULT_DISTRO
for version in PBS_PYTHON_MAJOR_VERSIONS
for arch in PBS_PYTHON_ARCHITECTURES[DEFAULT_DISTRO][version]
for (tag_base, debug_mode, user) in VARIANTS
}

PYTHON |= {
"{REGISTRY}/{PROJECT_ID}/python" + version + ":" + tag_base: "//python:python" + version.replace(".", "") + debug_mode + "_" + user + "_" + DEFAULT_DISTRO
for version in PBS_PYTHON_MAJOR_VERSIONS
for (tag_base, debug_mode, user) in VARIANTS
}

###############
# JAVA_BASE #
###############
Expand Down Expand Up @@ -270,6 +304,8 @@ ALL |= PYTHON3

ALL |= NODEJS

ALL |= PYTHON

ALL |= JAVA_BASE

ALL |= JAVA
Expand Down
5 changes: 5 additions & 0 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,10 @@ node = use_extension("//private/extensions:node.bzl", "node")
node.archive()
use_repo(node, "node_versions", "nodejs22_amd64", "nodejs22_arm", "nodejs22_arm64", "nodejs22_ppc64le", "nodejs22_s390x", "nodejs24_amd64", "nodejs24_arm64", "nodejs24_ppc64le", "nodejs24_s390x", "nodejs26_amd64", "nodejs26_arm64", "nodejs26_ppc64le", "nodejs26_s390x")

### PYTHON ###
py = use_extension("//private/extensions:python.bzl", "python")
py.archive()
use_repo(py, "python313_amd64", "python313_arm64", "python313_riscv64", "python313_s390x", "python314_amd64", "python314_arm64", "python314_riscv64", "python314_s390x", "python_versions")

### DEBIAN ###
include("//private/repos/deb:deb.MODULE.bazel")
147 changes: 147 additions & 0 deletions MODULE.bazel.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 64 additions & 1 deletion knife
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,66 @@ function cmd_lint () {
buildifier -mode=$mode $(find . -type f \( -name 'BUILD*' -o -name 'WORKSPACE*' -o -name '*.bzl' \))
}

function cmd_update_python_archives () {
if ! which jq > /dev/null; then
echo "🧱 No jq executable was found"
exit 1
fi
if ! which curl > /dev/null; then
echo "🧱 No curl executable was found"
exit 1
fi

VERBOSE=0
DRY_RUN=0
for arg in "$@"; do
case "$arg" in
--verbose)
VERBOSE=1
;;
--dry-run)
DRY_RUN=1
;;
*)
echo "unknown option: $arg"
exit 1
;;
esac
done
export VERBOSE DRY_RUN

source knife.d/update_python_archives.sh
old_versions=$(get_python_versions)
if ! out=$(generate_python_archives); then
case "$out" in
*MUTATED_PARTIAL*)
echo "update failed mid-mutation; files may be partially updated." >&2
echo "Restore the affected files from version control before retrying." >&2
;;
*)
echo "update failed; no files were mutated (pre-flight validation)." >&2
;;
esac
return 1
fi
if [ "$out" = "NO_CHANGE" ]; then
echo "python archives are up to date"
return 0
fi
if [ "$DRY_RUN" = 1 ]; then
echo "dry-run: no files written"
return 0
fi
echo "updated python archives to release $out"
if ! update_test_versions_python "$old_versions"; then
echo "testdata update failed after the archive update." >&2
echo "Restore the affected files from version control before retrying." >&2
return 1
fi
# The extension changed; refresh the lockfile before building.
echo "Refresh the lockfile before building." >&2
}

function cmd_update_node_archives () {
if ! which jq > /dev/null; then
echo "🧱 No jq executable was found"
Expand Down Expand Up @@ -289,8 +349,11 @@ update-node-archives)
update-node-keys)
cmd_update_node_keys
;;
update-python-archives)
cmd_update_python_archives "${@:2}"
;;
~~nocmd) # no command provided
echo "provide a command: lock, update-snapshots, github-update-snapshots, update-non-snapshots, test, deb-versions, update-node-archives, update-node-keys"
echo "provide a command: lock, update-snapshots, github-update-snapshots, update-non-snapshots, test, deb-versions, update-node-archives, update-node-keys, update-python-archives"
exit 1
;;
*) # unknown command
Expand Down
1 change: 1 addition & 0 deletions knife.d/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports_files(["update_python_archives.sh"])
Loading
Loading