📦 Mini Me
090bb3c parent: fddce9e added
10-publish-python-toolchain-kit.sh +57 -0 | new file mode 100755 | ||
| @@ -0,0 +1,57 @@ | ||
| 1 | +#!/bin/bash | |
| 2 | +: <<'COMMENT' | |
| 3 | +Publish the python-toolchain kit (a mixin) to Docker Hub as an OCI image. | |
| 4 | +Doc: https://docs.docker.com/ai/sandboxes/customize/author/distribute/ | |
| 5 | + | |
| 6 | +1. docker login (once, with the Docker Hub account) | |
| 7 | +2. Update TAG in release.env (shared with 01-release.tag.sh) | |
| 8 | +3. Run this script: ./10-publish-python-toolchain-kit.sh | |
| 9 | + - DOCKER_HUB_NAMESPACE=foo ./10-publish-python-toolchain-kit.sh to push under another namespace | |
| 10 | + - SIGN=1 ./10-publish-python-toolchain-kit.sh to sign the kit after the push | |
| 11 | + (keyless, `sbx kit sign`) | |
| 12 | + | |
| 13 | +Then anyone can add it to a sandbox: | |
| 14 | + sbx run --name mm-demo docker.io/<NAMESPACE>/mini-me-kit:<TAG> \ | |
| 15 | + --kit docker.io/<NAMESPACE>/python-toolchain-kit:<TAG> | |
| 16 | +COMMENT | |
| 17 | + | |
| 18 | +set -euo pipefail | |
| 19 | + | |
| 20 | +set -o allexport | |
| 21 | +source release.env | |
| 22 | +set +o allexport | |
| 23 | + | |
| 24 | +NAMESPACE="${DOCKER_HUB_NAMESPACE:-k33g}" | |
| 25 | +KIT_DIR="./kits/python-toolchain" | |
| 26 | +KIT_FILE="${KIT_DIR}/python-toolchain.yaml" | |
| 27 | +# Docker Hub tags are usually written without the leading "v": v0.0.2 -> 0.0.2 | |
| 28 | +VERSION="${TAG#v}" | |
| 29 | +IMAGE="docker.io/${NAMESPACE}/python-toolchain-kit" | |
| 30 | +PLATFORMS="linux/amd64,linux/arm64" | |
| 31 | + | |
| 32 | +echo "Publishing ${IMAGE}:${VERSION} (and :latest) for ${PLATFORMS}" | |
| 33 | + | |
| 34 | +# A multi-platform push needs a builder that can do it: the default "docker" | |
| 35 | +# driver cannot (unless the containerd image store is on), so use a | |
| 36 | +# docker-container builder, created once and reused afterwards. | |
| 37 | +BUILDER="sandbox-kit-builder" | |
| 38 | +if ! docker buildx inspect "${BUILDER}" >/dev/null 2>&1; then | |
| 39 | + docker buildx create --name "${BUILDER}" --driver docker-container >/dev/null | |
| 40 | +fi | |
| 41 | + | |
| 42 | +# The descriptor (python-toolchain.yaml) is passed as the "Dockerfile": its | |
| 43 | +# `# syntax=docker/sandbox-kit:3` line selects the kit frontend, which builds | |
| 44 | +# the overlay from python-toolchain.dockerfile and packs the kit metadata with it. | |
| 45 | +docker buildx build "${KIT_DIR}" -f "${KIT_FILE}" \ | |
| 46 | + --builder "${BUILDER}" \ | |
| 47 | + --platform "${PLATFORMS}" \ | |
| 48 | + -t "${IMAGE}:${VERSION}" \ | |
| 49 | + -t "${IMAGE}:latest" \ | |
| 50 | + --push | |
| 51 | + | |
| 52 | +if [ "${SIGN:-0}" = "1" ]; then | |
| 53 | + sbx kit sign "${IMAGE}:${VERSION}" | |
| 54 | +fi | |
| 55 | + | |
| 56 | +echo "✅ Published ${IMAGE}:${VERSION}" | |
| 57 | +echo "💡 Try it: sbx run --name mm-demo docker.io/${NAMESPACE}/${REPO}:${VERSION} --kit ${IMAGE}:${VERSION}" | |
| new file mode 100755 | |||
| @@ -0,0 +1,57 @@ | |||
| 1 | +#!/bin/bash | ||
| 2 | +: <<'COMMENT' | ||
| 3 | +Publish the python-toolchain kit (a mixin) to Docker Hub as an OCI image. | ||
| 4 | +Doc: https://docs.docker.com/ai/sandboxes/customize/author/distribute/ | ||
| 5 | + | ||
| 6 | +1. docker login (once, with the Docker Hub account) | ||
| 7 | +2. Update TAG in release.env (shared with 01-release.tag.sh) | ||
| 8 | +3. Run this script: ./10-publish-python-toolchain-kit.sh | ||
| 9 | + - DOCKER_HUB_NAMESPACE=foo ./10-publish-python-toolchain-kit.sh to push under another namespace | ||
| 10 | + - SIGN=1 ./10-publish-python-toolchain-kit.sh to sign the kit after the push | ||
| 11 | + (keyless, `sbx kit sign`) | ||
| 12 | + | ||
| 13 | +Then anyone can add it to a sandbox: | ||
| 14 | + sbx run --name mm-demo docker.io/<NAMESPACE>/mini-me-kit:<TAG> \ | ||
| 15 | + --kit docker.io/<NAMESPACE>/python-toolchain-kit:<TAG> | ||
| 16 | +COMMENT | ||
| 17 | + | ||
| 18 | +set -euo pipefail | ||
| 19 | + | ||
| 20 | +set -o allexport | ||
| 21 | +source release.env | ||
| 22 | +set +o allexport | ||
| 23 | + | ||
| 24 | +NAMESPACE="${DOCKER_HUB_NAMESPACE:-k33g}" | ||
| 25 | +KIT_DIR="./kits/python-toolchain" | ||
| 26 | +KIT_FILE="${KIT_DIR}/python-toolchain.yaml" | ||
| 27 | +# Docker Hub tags are usually written without the leading "v": v0.0.2 -> 0.0.2 | ||
| 28 | +VERSION="${TAG#v}" | ||
| 29 | +IMAGE="docker.io/${NAMESPACE}/python-toolchain-kit" | ||
| 30 | +PLATFORMS="linux/amd64,linux/arm64" | ||
| 31 | + | ||
| 32 | +echo "Publishing ${IMAGE}:${VERSION} (and :latest) for ${PLATFORMS}" | ||
| 33 | + | ||
| 34 | +# A multi-platform push needs a builder that can do it: the default "docker" | ||
| 35 | +# driver cannot (unless the containerd image store is on), so use a | ||
| 36 | +# docker-container builder, created once and reused afterwards. | ||
| 37 | +BUILDER="sandbox-kit-builder" | ||
| 38 | +if ! docker buildx inspect "${BUILDER}" >/dev/null 2>&1; then | ||
| 39 | + docker buildx create --name "${BUILDER}" --driver docker-container >/dev/null | ||
| 40 | +fi | ||
| 41 | + | ||
| 42 | +# The descriptor (python-toolchain.yaml) is passed as the "Dockerfile": its | ||
| 43 | +# `# syntax=docker/sandbox-kit:3` line selects the kit frontend, which builds | ||
| 44 | +# the overlay from python-toolchain.dockerfile and packs the kit metadata with it. | ||
| 45 | +docker buildx build "${KIT_DIR}" -f "${KIT_FILE}" \ | ||
| 46 | + --builder "${BUILDER}" \ | ||
| 47 | + --platform "${PLATFORMS}" \ | ||
| 48 | + -t "${IMAGE}:${VERSION}" \ | ||
| 49 | + -t "${IMAGE}:latest" \ | ||
| 50 | + --push | ||
| 51 | + | ||
| 52 | +if [ "${SIGN:-0}" = "1" ]; then | ||
| 53 | + sbx kit sign "${IMAGE}:${VERSION}" | ||
| 54 | +fi | ||
| 55 | + | ||
| 56 | +echo "✅ Published ${IMAGE}:${VERSION}" | ||
| 57 | +echo "💡 Try it: sbx run --name mm-demo docker.io/${NAMESPACE}/${REPO}:${VERSION} --kit ${IMAGE}:${VERSION}" | ||
modified
README.md +2 -0 | @@ -118,6 +118,7 @@ Add them to any of the kits above with `--kit`: | ||
| 118 | 118 | |---|---|---| |
| 119 | 119 | | `./kits/go-toolchain` | `go`, `gofmt`, `gopls` | `go_version` | |
| 120 | 120 | | `./kits/rust-toolchain` | `cargo`, `rustc`, `rustfmt`, `clippy`, `rust-analyzer`, plus `gcc` (linker, C build scripts) | `rust_version` | |
| 121 | +| `./kits/python-toolchain` | `python3`, `pip`, `uv`, `uvx`, `ruff`, `ty`, `basedpyright` (standalone CPython, tools installed with uv) | `python_version`, `uv_version` (+ `ruff_version`, `ty_version`, `basedpyright_version`: `none` to leave one out) | | |
| 121 | 122 | | `./kits/nushell` | `nu` (static binary) | `nushell_version` | |
| 122 | 123 | |
| 123 | 124 | ```bash |
| @@ -204,6 +205,7 @@ sbx env rm | ||
| 204 | 205 | ./07-publish-mini-me-agent-kit.sh # ./mini-me-agent -> k33g/mini-me-agent-kit |
| 205 | 206 | ./08-publish-vscode-ssh-kit.sh # ./kits/vscode-ssh -> k33g/vscode-ssh-kit |
| 206 | 207 | ./09-publish-zed-ssh-kit.sh # ./kits/zed-ssh -> k33g/zed-ssh-kit |
| 208 | + ./10-publish-python-toolchain-kit.sh # ./kits/python-toolchain -> k33g/python-toolchain-kit | |
| 207 | 209 | ``` |
| 208 | 210 | - `DOCKER_HUB_NAMESPACE=<namespace>` to push under another namespace (default: `k33g`) |
| 209 | 211 | - `SIGN=1` to sign the kit after the push (`sbx kit sign`) |
| @@ -118,6 +118,7 @@ Add them to any of the kits above with `--kit`: | |||
| 118 | |---|---|---| | 118 | |---|---|---| |
| 119 | | `./kits/go-toolchain` | `go`, `gofmt`, `gopls` | `go_version` | | 119 | | `./kits/go-toolchain` | `go`, `gofmt`, `gopls` | `go_version` | |
| 120 | | `./kits/rust-toolchain` | `cargo`, `rustc`, `rustfmt`, `clippy`, `rust-analyzer`, plus `gcc` (linker, C build scripts) | `rust_version` | | 120 | | `./kits/rust-toolchain` | `cargo`, `rustc`, `rustfmt`, `clippy`, `rust-analyzer`, plus `gcc` (linker, C build scripts) | `rust_version` | |
| 121 | +| `./kits/python-toolchain` | `python3`, `pip`, `uv`, `uvx`, `ruff`, `ty`, `basedpyright` (standalone CPython, tools installed with uv) | `python_version`, `uv_version` (+ `ruff_version`, `ty_version`, `basedpyright_version`: `none` to leave one out) | | ||
| 121 | | `./kits/nushell` | `nu` (static binary) | `nushell_version` | | 122 | | `./kits/nushell` | `nu` (static binary) | `nushell_version` | |
| 122 | 123 | ||
| 123 | ```bash | 124 | ```bash |
| @@ -204,6 +205,7 @@ sbx env rm | |||
| 204 | ./07-publish-mini-me-agent-kit.sh # ./mini-me-agent -> k33g/mini-me-agent-kit | 205 | ./07-publish-mini-me-agent-kit.sh # ./mini-me-agent -> k33g/mini-me-agent-kit |
| 205 | ./08-publish-vscode-ssh-kit.sh # ./kits/vscode-ssh -> k33g/vscode-ssh-kit | 206 | ./08-publish-vscode-ssh-kit.sh # ./kits/vscode-ssh -> k33g/vscode-ssh-kit |
| 206 | ./09-publish-zed-ssh-kit.sh # ./kits/zed-ssh -> k33g/zed-ssh-kit | 207 | ./09-publish-zed-ssh-kit.sh # ./kits/zed-ssh -> k33g/zed-ssh-kit |
| 208 | + ./10-publish-python-toolchain-kit.sh # ./kits/python-toolchain -> k33g/python-toolchain-kit | ||
| 207 | ``` | 209 | ``` |
| 208 | - `DOCKER_HUB_NAMESPACE=<namespace>` to push under another namespace (default: `k33g`) | 210 | - `DOCKER_HUB_NAMESPACE=<namespace>` to push under another namespace (default: `k33g`) |
| 209 | - `SIGN=1` to sign the kit after the push (`sbx kit sign`) | 211 | - `SIGN=1` to sign the kit after the push (`sbx kit sign`) |
modified
kits/go-toolchain/go-toolchain.yaml +1 -1 | @@ -4,7 +4,7 @@ kind: mixin | ||
| 4 | 4 | displayName: Go toolchain |
| 5 | 5 | description: Go toolchain and gopls (language server) |
| 6 | 6 | licenses: [MIT] |
| 7 | -version: "0.7.0" | |
| 7 | +version: "0.8.0" | |
| 8 | 8 | |
| 9 | 9 | args: |
| 10 | 10 | go_version: |
| @@ -4,7 +4,7 @@ kind: mixin | |||
| 4 | displayName: Go toolchain | 4 | displayName: Go toolchain |
| 5 | description: Go toolchain and gopls (language server) | 5 | description: Go toolchain and gopls (language server) |
| 6 | licenses: [MIT] | 6 | licenses: [MIT] |
| 7 | -version: "0.7.0" | 7 | +version: "0.8.0" |
| 8 | 8 | ||
| 9 | args: | 9 | args: |
| 10 | go_version: | 10 | go_version: |
modified
kits/nushell/nushell.yaml +1 -1 | @@ -4,7 +4,7 @@ kind: mixin | ||
| 4 | 4 | displayName: Nushell |
| 5 | 5 | description: Nushell (nu), a structured-data shell |
| 6 | 6 | licenses: [MIT] |
| 7 | -version: "0.7.0" | |
| 7 | +version: "0.8.0" | |
| 8 | 8 | |
| 9 | 9 | args: |
| 10 | 10 | nushell_version: |
| @@ -4,7 +4,7 @@ kind: mixin | |||
| 4 | displayName: Nushell | 4 | displayName: Nushell |
| 5 | description: Nushell (nu), a structured-data shell | 5 | description: Nushell (nu), a structured-data shell |
| 6 | licenses: [MIT] | 6 | licenses: [MIT] |
| 7 | -version: "0.7.0" | 7 | +version: "0.8.0" |
| 8 | 8 | ||
| 9 | args: | 9 | args: |
| 10 | nushell_version: | 10 | nushell_version: |
added
kits/python-toolchain/python-context.md +10 -0 | new file mode 100644 | ||
| @@ -0,0 +1,10 @@ | ||
| 1 | +## Python | |
| 2 | + | |
| 3 | +`python3`, `pip`, `uv`, `uvx`, `ruff`, `ty` and `basedpyright` are installed | |
| 4 | +(`/usr/local/python`, `/usr/local/uv-tools`). Manage projects with `uv` | |
| 5 | +(`uv init`, `uv add`, `uv sync`, `uv run`) and run tests with `uv run pytest`: | |
| 6 | +`pip` cannot install into the system Python (PEP 668), use a project or a venv. | |
| 7 | +Run `ruff check`, `ruff format` and `ty check` (or `basedpyright`) before | |
| 8 | +reporting a task complete. Prefer a language server (`ty server`, | |
| 9 | +`basedpyright-langserver`, `ruff server`) for navigation and refactoring over | |
| 10 | +text search. Packages come from PyPI; other hosts may be blocked. | |
| new file mode 100644 | |||
| @@ -0,0 +1,10 @@ | |||
| 1 | +## Python | ||
| 2 | + | ||
| 3 | +`python3`, `pip`, `uv`, `uvx`, `ruff`, `ty` and `basedpyright` are installed | ||
| 4 | +(`/usr/local/python`, `/usr/local/uv-tools`). Manage projects with `uv` | ||
| 5 | +(`uv init`, `uv add`, `uv sync`, `uv run`) and run tests with `uv run pytest`: | ||
| 6 | +`pip` cannot install into the system Python (PEP 668), use a project or a venv. | ||
| 7 | +Run `ruff check`, `ruff format` and `ty check` (or `basedpyright`) before | ||
| 8 | +reporting a task complete. Prefer a language server (`ty server`, | ||
| 9 | +`basedpyright-langserver`, `ruff server`) for navigation and refactoring over | ||
| 10 | +text search. Packages come from PyPI; other hosts may be blocked. | ||
added
kits/python-toolchain/python-toolchain.dockerfile +76 -0 | new file mode 100644 | ||
| @@ -0,0 +1,76 @@ | ||
| 1 | +# syntax=docker/dockerfile:1 | |
| 2 | + | |
| 3 | +ARG UV_VERSION | |
| 4 | + | |
| 5 | +# --- uv: static binaries, from Astral's own image ---------------------------- | |
| 6 | +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv | |
| 7 | + | |
| 8 | +# --- build stage: a standalone CPython and the tools, installed by uv -------- | |
| 9 | +FROM debian:trixie-slim AS build | |
| 10 | +ARG PYTHON_VERSION | |
| 11 | +ARG RUFF_VERSION=latest | |
| 12 | +ARG TY_VERSION=latest | |
| 13 | +ARG BASEDPYRIGHT_VERSION=latest | |
| 14 | + | |
| 15 | +# A heredoc RUN does not stop at the first failing line by itself: every | |
| 16 | +# script starts with `set -eu`. | |
| 17 | +RUN <<EOF | |
| 18 | +set -eu | |
| 19 | +apt-get update | |
| 20 | +apt-get install -y --no-install-recommends ca-certificates | |
| 21 | +rm -rf /var/lib/apt/lists/* | |
| 22 | +EOF | |
| 23 | + | |
| 24 | +COPY --from=uv /uv /uvx /out/usr/local/bin/ | |
| 25 | + | |
| 26 | +# Everything is installed at the path it has on the workload: the tool venvs | |
| 27 | +# and their entry points refer to their interpreter by absolute path. | |
| 28 | +# python-build-standalone only needs glibc, so it does not depend on the | |
| 29 | +# workload distro (the older shell templates have no python3 at all). | |
| 30 | +ENV PATH=/out/usr/local/bin:${PATH} \ | |
| 31 | + UV_PYTHON_INSTALL_DIR=/usr/local/python \ | |
| 32 | + UV_TOOL_DIR=/usr/local/uv-tools \ | |
| 33 | + UV_TOOL_BIN_DIR=/out/usr/local/bin \ | |
| 34 | + UV_LINK_MODE=copy \ | |
| 35 | + UV_COMPILE_BYTECODE=1 \ | |
| 36 | + UV_NO_CACHE=1 | |
| 37 | +RUN <<EOF | |
| 38 | +set -eu | |
| 39 | +uv python install "${PYTHON_VERSION}" | |
| 40 | +python="$(uv python find --managed-python "${PYTHON_VERSION}")" | |
| 41 | +# Its real path, not the minor-version link uv may hand back. | |
| 42 | +python="$(readlink -f "${python}")" | |
| 43 | +ln -s "${python}" /out/usr/local/bin/python3 | |
| 44 | +ln -s python3 /out/usr/local/bin/python | |
| 45 | +# pip runs as a module: python-build-standalone ships it, and this way it | |
| 46 | +# always belongs to the interpreter above. | |
| 47 | +cat > /out/usr/local/bin/pip <<'SH' | |
| 48 | +#!/bin/sh | |
| 49 | +exec /usr/local/bin/python3 -m pip "$@" | |
| 50 | +SH | |
| 51 | +chmod +x /out/usr/local/bin/pip | |
| 52 | +ln -s pip /out/usr/local/bin/pip3 | |
| 53 | +EOF | |
| 54 | + | |
| 55 | +# `latest` stays unpinned (not reproducible), a version pins the tool, and | |
| 56 | +# `none` leaves it out (basedpyright bundles Node.js: about 280 MB). | |
| 57 | +RUN <<EOF | |
| 58 | +set -eu | |
| 59 | +python="$(readlink -f /out/usr/local/bin/python3)" | |
| 60 | +for tool in "ruff=${RUFF_VERSION}" "ty=${TY_VERSION}" "basedpyright=${BASEDPYRIGHT_VERSION}"; do | |
| 61 | + name="${tool%%=*}" | |
| 62 | + version="${tool#*=}" | |
| 63 | + case "${version}" in | |
| 64 | + none) continue ;; | |
| 65 | + latest) uv tool install --python "${python}" "${name}" ;; | |
| 66 | + *) uv tool install --python "${python}" "${name}==${version}" ;; | |
| 67 | + esac | |
| 68 | +done | |
| 69 | +mkdir -p /usr/local/uv-tools | |
| 70 | +EOF | |
| 71 | + | |
| 72 | +# --- overlay: only the interpreter, the tools and their links land ---------- | |
| 73 | +FROM scratch | |
| 74 | +COPY --from=build /usr/local/python /usr/local/python | |
| 75 | +COPY --from=build /usr/local/uv-tools /usr/local/uv-tools | |
| 76 | +COPY --from=build /out/ / | |
| new file mode 100644 | |||
| @@ -0,0 +1,76 @@ | |||
| 1 | +# syntax=docker/dockerfile:1 | ||
| 2 | + | ||
| 3 | +ARG UV_VERSION | ||
| 4 | + | ||
| 5 | +# --- uv: static binaries, from Astral's own image ---------------------------- | ||
| 6 | +FROM ghcr.io/astral-sh/uv:${UV_VERSION} AS uv | ||
| 7 | + | ||
| 8 | +# --- build stage: a standalone CPython and the tools, installed by uv -------- | ||
| 9 | +FROM debian:trixie-slim AS build | ||
| 10 | +ARG PYTHON_VERSION | ||
| 11 | +ARG RUFF_VERSION=latest | ||
| 12 | +ARG TY_VERSION=latest | ||
| 13 | +ARG BASEDPYRIGHT_VERSION=latest | ||
| 14 | + | ||
| 15 | +# A heredoc RUN does not stop at the first failing line by itself: every | ||
| 16 | +# script starts with `set -eu`. | ||
| 17 | +RUN <<EOF | ||
| 18 | +set -eu | ||
| 19 | +apt-get update | ||
| 20 | +apt-get install -y --no-install-recommends ca-certificates | ||
| 21 | +rm -rf /var/lib/apt/lists/* | ||
| 22 | +EOF | ||
| 23 | + | ||
| 24 | +COPY --from=uv /uv /uvx /out/usr/local/bin/ | ||
| 25 | + | ||
| 26 | +# Everything is installed at the path it has on the workload: the tool venvs | ||
| 27 | +# and their entry points refer to their interpreter by absolute path. | ||
| 28 | +# python-build-standalone only needs glibc, so it does not depend on the | ||
| 29 | +# workload distro (the older shell templates have no python3 at all). | ||
| 30 | +ENV PATH=/out/usr/local/bin:${PATH} \ | ||
| 31 | + UV_PYTHON_INSTALL_DIR=/usr/local/python \ | ||
| 32 | + UV_TOOL_DIR=/usr/local/uv-tools \ | ||
| 33 | + UV_TOOL_BIN_DIR=/out/usr/local/bin \ | ||
| 34 | + UV_LINK_MODE=copy \ | ||
| 35 | + UV_COMPILE_BYTECODE=1 \ | ||
| 36 | + UV_NO_CACHE=1 | ||
| 37 | +RUN <<EOF | ||
| 38 | +set -eu | ||
| 39 | +uv python install "${PYTHON_VERSION}" | ||
| 40 | +python="$(uv python find --managed-python "${PYTHON_VERSION}")" | ||
| 41 | +# Its real path, not the minor-version link uv may hand back. | ||
| 42 | +python="$(readlink -f "${python}")" | ||
| 43 | +ln -s "${python}" /out/usr/local/bin/python3 | ||
| 44 | +ln -s python3 /out/usr/local/bin/python | ||
| 45 | +# pip runs as a module: python-build-standalone ships it, and this way it | ||
| 46 | +# always belongs to the interpreter above. | ||
| 47 | +cat > /out/usr/local/bin/pip <<'SH' | ||
| 48 | +#!/bin/sh | ||
| 49 | +exec /usr/local/bin/python3 -m pip "$@" | ||
| 50 | +SH | ||
| 51 | +chmod +x /out/usr/local/bin/pip | ||
| 52 | +ln -s pip /out/usr/local/bin/pip3 | ||
| 53 | +EOF | ||
| 54 | + | ||
| 55 | +# `latest` stays unpinned (not reproducible), a version pins the tool, and | ||
| 56 | +# `none` leaves it out (basedpyright bundles Node.js: about 280 MB). | ||
| 57 | +RUN <<EOF | ||
| 58 | +set -eu | ||
| 59 | +python="$(readlink -f /out/usr/local/bin/python3)" | ||
| 60 | +for tool in "ruff=${RUFF_VERSION}" "ty=${TY_VERSION}" "basedpyright=${BASEDPYRIGHT_VERSION}"; do | ||
| 61 | + name="${tool%%=*}" | ||
| 62 | + version="${tool#*=}" | ||
| 63 | + case "${version}" in | ||
| 64 | + none) continue ;; | ||
| 65 | + latest) uv tool install --python "${python}" "${name}" ;; | ||
| 66 | + *) uv tool install --python "${python}" "${name}==${version}" ;; | ||
| 67 | + esac | ||
| 68 | +done | ||
| 69 | +mkdir -p /usr/local/uv-tools | ||
| 70 | +EOF | ||
| 71 | + | ||
| 72 | +# --- overlay: only the interpreter, the tools and their links land ---------- | ||
| 73 | +FROM scratch | ||
| 74 | +COPY --from=build /usr/local/python /usr/local/python | ||
| 75 | +COPY --from=build /usr/local/uv-tools /usr/local/uv-tools | ||
| 76 | +COPY --from=build /out/ / | ||
added
kits/python-toolchain/python-toolchain.yaml +52 -0 | new file mode 100644 | ||
| @@ -0,0 +1,52 @@ | ||
| 1 | +# syntax=docker/sandbox-kit:3 | |
| 2 | +schemaVersion: "3" | |
| 3 | +kind: mixin | |
| 4 | +displayName: Python toolchain | |
| 5 | +description: Python (standalone CPython, pip), uv / uvx, ruff (linter, formatter), ty and basedpyright (type checkers, language servers) | |
| 6 | + | |
| 7 | +licenses: [MIT] | |
| 8 | +version: "0.8.0" | |
| 9 | + | |
| 10 | +args: | |
| 11 | + python_version: | |
| 12 | + # A CPython release (e.g. 3.14.9), or a minor version (latest patch, not reproducible). | |
| 13 | + default: "3.14.9" | |
| 14 | + pattern: '^3\.[0-9]+(\.[0-9]+)?$' | |
| 15 | + buildArg: PYTHON_VERSION | |
| 16 | + uv_version: | |
| 17 | + default: "0.13.5" | |
| 18 | + pattern: '^[0-9]+\.[0-9]+\.[0-9]+$' | |
| 19 | + buildArg: UV_VERSION | |
| 20 | + ruff_version: | |
| 21 | + # Pin a release (e.g. 0.17.2) for reproducible builds, or `none` to leave it out. | |
| 22 | + default: latest | |
| 23 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | |
| 24 | + buildArg: RUFF_VERSION | |
| 25 | + ty_version: | |
| 26 | + default: latest | |
| 27 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | |
| 28 | + buildArg: TY_VERSION | |
| 29 | + basedpyright_version: | |
| 30 | + # `none` leaves it out: it bundles Node.js (about 280 MB). | |
| 31 | + default: latest | |
| 32 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | |
| 33 | + buildArg: BASEDPYRIGHT_VERSION | |
| 34 | + | |
| 35 | +provides: ["python@${{ kit.args.python_version }}", "uv@${{ kit.args.uv_version }}"] | |
| 36 | + | |
| 37 | +capabilities: | |
| 38 | + # Runtime access with the tool: PyPI (index and packages), and the GitHub | |
| 39 | + # release hosts uv downloads other Python versions from. | |
| 40 | + # Add private indexes here (or in a kit set) if you need them. | |
| 41 | + - type: com.docker.sandbox/network-policy@1 | |
| 42 | + config: | |
| 43 | + runtime: | |
| 44 | + allow: | |
| 45 | + - pypi.org | |
| 46 | + - files.pythonhosted.org | |
| 47 | + - github.com | |
| 48 | + - objects.githubusercontent.com | |
| 49 | + - release-assets.githubusercontent.com | |
| 50 | + # - type: com.docker.sandbox/agent-context@1 | |
| 51 | + # config: | |
| 52 | + # contentFile: ./python-context.md | |
| new file mode 100644 | |||
| @@ -0,0 +1,52 @@ | |||
| 1 | +# syntax=docker/sandbox-kit:3 | ||
| 2 | +schemaVersion: "3" | ||
| 3 | +kind: mixin | ||
| 4 | +displayName: Python toolchain | ||
| 5 | +description: Python (standalone CPython, pip), uv / uvx, ruff (linter, formatter), ty and basedpyright (type checkers, language servers) | ||
| 6 | + | ||
| 7 | +licenses: [MIT] | ||
| 8 | +version: "0.8.0" | ||
| 9 | + | ||
| 10 | +args: | ||
| 11 | + python_version: | ||
| 12 | + # A CPython release (e.g. 3.14.9), or a minor version (latest patch, not reproducible). | ||
| 13 | + default: "3.14.9" | ||
| 14 | + pattern: '^3\.[0-9]+(\.[0-9]+)?$' | ||
| 15 | + buildArg: PYTHON_VERSION | ||
| 16 | + uv_version: | ||
| 17 | + default: "0.13.5" | ||
| 18 | + pattern: '^[0-9]+\.[0-9]+\.[0-9]+$' | ||
| 19 | + buildArg: UV_VERSION | ||
| 20 | + ruff_version: | ||
| 21 | + # Pin a release (e.g. 0.17.2) for reproducible builds, or `none` to leave it out. | ||
| 22 | + default: latest | ||
| 23 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | ||
| 24 | + buildArg: RUFF_VERSION | ||
| 25 | + ty_version: | ||
| 26 | + default: latest | ||
| 27 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | ||
| 28 | + buildArg: TY_VERSION | ||
| 29 | + basedpyright_version: | ||
| 30 | + # `none` leaves it out: it bundles Node.js (about 280 MB). | ||
| 31 | + default: latest | ||
| 32 | + pattern: '^(latest|none|[0-9]+\.[0-9]+\.[0-9]+)$' | ||
| 33 | + buildArg: BASEDPYRIGHT_VERSION | ||
| 34 | + | ||
| 35 | +provides: ["python@${{ kit.args.python_version }}", "uv@${{ kit.args.uv_version }}"] | ||
| 36 | + | ||
| 37 | +capabilities: | ||
| 38 | + # Runtime access with the tool: PyPI (index and packages), and the GitHub | ||
| 39 | + # release hosts uv downloads other Python versions from. | ||
| 40 | + # Add private indexes here (or in a kit set) if you need them. | ||
| 41 | + - type: com.docker.sandbox/network-policy@1 | ||
| 42 | + config: | ||
| 43 | + runtime: | ||
| 44 | + allow: | ||
| 45 | + - pypi.org | ||
| 46 | + - files.pythonhosted.org | ||
| 47 | + - github.com | ||
| 48 | + - objects.githubusercontent.com | ||
| 49 | + - release-assets.githubusercontent.com | ||
| 50 | + # - type: com.docker.sandbox/agent-context@1 | ||
| 51 | + # config: | ||
| 52 | + # contentFile: ./python-context.md | ||
modified
kits/rust-toolchain/rust-toolchain.yaml +1 -1 | @@ -5,7 +5,7 @@ displayName: Rust toolchain | ||
| 5 | 5 | description: Rust toolchain (cargo, rustc, rustfmt, clippy) and rust-analyzer (language server) |
| 6 | 6 | |
| 7 | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | |
| 8 | +version: "0.8.0" | |
| 9 | 9 | |
| 10 | 10 | args: |
| 11 | 11 | rust_version: |
| @@ -5,7 +5,7 @@ displayName: Rust toolchain | |||
| 5 | description: Rust toolchain (cargo, rustc, rustfmt, clippy) and rust-analyzer (language server) | 5 | description: Rust toolchain (cargo, rustc, rustfmt, clippy) and rust-analyzer (language server) |
| 6 | 6 | ||
| 7 | licenses: [MIT] | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | 8 | +version: "0.8.0" |
| 9 | 9 | ||
| 10 | args: | 10 | args: |
| 11 | rust_version: | 11 | rust_version: |
modified
kits/vscode-ssh/kit.yaml +1 -1 | @@ -18,7 +18,7 @@ description: >- | ||
| 18 | 18 | through the sbx SSH endpoint, with the network policy the VS Code server needs. |
| 19 | 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit |
| 20 | 20 | licenses: [MIT] |
| 21 | -version: "0.7.0" | |
| 21 | +version: "0.8.0" | |
| 22 | 22 | capabilities: |
| 23 | 23 | - type: com.docker.sandbox/sbx@1 |
| 24 | 24 | - type: com.docker.sandbox/network-policy@1 |
| @@ -18,7 +18,7 @@ description: >- | |||
| 18 | through the sbx SSH endpoint, with the network policy the VS Code server needs. | 18 | through the sbx SSH endpoint, with the network policy the VS Code server needs. |
| 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit | 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit |
| 20 | licenses: [MIT] | 20 | licenses: [MIT] |
| 21 | -version: "0.7.0" | 21 | +version: "0.8.0" |
| 22 | capabilities: | 22 | capabilities: |
| 23 | - type: com.docker.sandbox/sbx@1 | 23 | - type: com.docker.sandbox/sbx@1 |
| 24 | - type: com.docker.sandbox/network-policy@1 | 24 | - type: com.docker.sandbox/network-policy@1 |
modified
kits/zed-ssh/kit.yaml +1 -1 | @@ -18,7 +18,7 @@ description: >- | ||
| 18 | 18 | through the sbx SSH endpoint, with the network policy the Zed remote server needs. |
| 19 | 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit |
| 20 | 20 | licenses: [MIT] |
| 21 | -version: "0.7.0" | |
| 21 | +version: "0.8.0" | |
| 22 | 22 | capabilities: |
| 23 | 23 | - type: com.docker.sandbox/sbx@1 |
| 24 | 24 | - type: com.docker.sandbox/network-policy@1 |
| @@ -18,7 +18,7 @@ description: >- | |||
| 18 | through the sbx SSH endpoint, with the network policy the Zed remote server needs. | 18 | through the sbx SSH endpoint, with the network policy the Zed remote server needs. |
| 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit | 19 | sourceUrl: https://rickub.com/bots-garden/mini-me-kit |
| 20 | licenses: [MIT] | 20 | licenses: [MIT] |
| 21 | -version: "0.7.0" | 21 | +version: "0.8.0" |
| 22 | capabilities: | 22 | capabilities: |
| 23 | - type: com.docker.sandbox/sbx@1 | 23 | - type: com.docker.sandbox/sbx@1 |
| 24 | - type: com.docker.sandbox/network-policy@1 | 24 | - type: com.docker.sandbox/network-policy@1 |
modified
mini-me-agent/mini-me-agent.yaml +1 -1 | @@ -5,7 +5,7 @@ displayName: Mini Me Agent | ||
| 5 | 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs |
| 6 | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | |
| 8 | +version: "0.8.0" | |
| 9 | 9 | |
| 10 | 10 | provides: ["mini-me@1.0.0"] |
| 11 | 11 | |
| @@ -5,7 +5,7 @@ displayName: Mini Me Agent | |||
| 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs | 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs |
| 6 | sourceUrl: https://rickub.com/bots-garden/mini-me | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | licenses: [MIT] | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | 8 | +version: "0.8.0" |
| 9 | 9 | ||
| 10 | provides: ["mini-me@1.0.0"] | 10 | provides: ["mini-me@1.0.0"] |
| 11 | 11 | ||
modified
mini-me-editor/mini-me-editor.yaml +1 -1 | @@ -5,7 +5,7 @@ displayName: Mini Me Editor | ||
| 5 | 5 | description: Eclipse Theia web IDE on the workspace, with Mini Me (mm) installed (not launched) |
| 6 | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | |
| 8 | +version: "0.8.0" | |
| 9 | 9 | |
| 10 | 10 | provides: ["mini-me@1.0.0", "theia@${{ kit.args.theia_version }}"] |
| 11 | 11 | |
| @@ -5,7 +5,7 @@ displayName: Mini Me Editor | |||
| 5 | description: Eclipse Theia web IDE on the workspace, with Mini Me (mm) installed (not launched) | 5 | description: Eclipse Theia web IDE on the workspace, with Mini Me (mm) installed (not launched) |
| 6 | sourceUrl: https://rickub.com/bots-garden/mini-me | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | licenses: [MIT] | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | 8 | +version: "0.8.0" |
| 9 | 9 | ||
| 10 | provides: ["mini-me@1.0.0", "theia@${{ kit.args.theia_version }}"] | 10 | provides: ["mini-me@1.0.0", "theia@${{ kit.args.theia_version }}"] |
| 11 | 11 | ||
modified
mini-me/mini-me.yaml +1 -1 | @@ -5,7 +5,7 @@ displayName: Mini Me | ||
| 5 | 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs |
| 6 | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | |
| 8 | +version: "0.8.0" | |
| 9 | 9 | |
| 10 | 10 | provides: ["mini-me@1.0.0"] |
| 11 | 11 | |
| @@ -5,7 +5,7 @@ displayName: Mini Me | |||
| 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs | 5 | description: Mini Me (mm), a minimalist coding agent for local LLMs |
| 6 | sourceUrl: https://rickub.com/bots-garden/mini-me | 6 | sourceUrl: https://rickub.com/bots-garden/mini-me |
| 7 | licenses: [MIT] | 7 | licenses: [MIT] |
| 8 | -version: "0.7.0" | 8 | +version: "0.8.0" |
| 9 | 9 | ||
| 10 | provides: ["mini-me@1.0.0"] | 10 | provides: ["mini-me@1.0.0"] |
| 11 | 11 | ||
modified
release.env +2 -2 | @@ -1,8 +1,8 @@ | ||
| 1 | 1 | # ./01-release.tag.sh commit, tag, push |
| 2 | 2 | MINI_ME_VERSION="1.0.0" |
| 3 | -PREVIOUS_TAG="v0.0.6" | |
| 3 | +PREVIOUS_TAG="v0.0.7" | |
| 4 | 4 | |
| 5 | -TAG="v0.0.7" | |
| 5 | +TAG="v0.0.8" | |
| 6 | 6 | ABOUT="Mini Me" |
| 7 | 7 | OWNER="bots-garden" |
| 8 | 8 | REPO="mini-me-kit" |
| @@ -1,8 +1,8 @@ | |||
| 1 | # ./01-release.tag.sh commit, tag, push | 1 | # ./01-release.tag.sh commit, tag, push |
| 2 | MINI_ME_VERSION="1.0.0" | 2 | MINI_ME_VERSION="1.0.0" |
| 3 | -PREVIOUS_TAG="v0.0.6" | 3 | +PREVIOUS_TAG="v0.0.7" |
| 4 | 4 | ||
| 5 | -TAG="v0.0.7" | 5 | +TAG="v0.0.8" |
| 6 | ABOUT="Mini Me" | 6 | ABOUT="Mini Me" |
| 7 | OWNER="bots-garden" | 7 | OWNER="bots-garden" |
| 8 | REPO="mini-me-kit" | 8 | REPO="mini-me-kit" |
modified
sbxenv.vscode.yaml +5 -5 | @@ -8,11 +8,11 @@ name: vscode-mm | ||
| 8 | 8 | agent: vscode-ssh-kit |
| 9 | 9 | |
| 10 | 10 | kits: |
| 11 | - - docker.io/k33g/vscode-ssh-kit:0.0.7 | |
| 12 | - - docker.io/k33g/nushell-kit:0.0.7 | |
| 13 | - - docker.io/k33g/mini-me-agent-kit:0.0.7 | |
| 14 | - - docker.io/k33g/go-toolchain-kit:0.0.7 | |
| 15 | - - docker.io/k33g/rust-toolchain-kit:0.0.7 | |
| 11 | + - docker.io/k33g/vscode-ssh-kit:0.0.9 | |
| 12 | + - docker.io/k33g/nushell-kit:0.0.9 | |
| 13 | + - docker.io/k33g/mini-me-agent-kit:0.0.9 | |
| 14 | + - docker.io/k33g/go-toolchain-kit:0.0.9 | |
| 15 | + - docker.io/k33g/rust-toolchain-kit:0.0.9 | |
| 16 | 16 | |
| 17 | 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. |
| 18 | 18 | workspace: ./demo |
| @@ -8,11 +8,11 @@ name: vscode-mm | |||
| 8 | agent: vscode-ssh-kit | 8 | agent: vscode-ssh-kit |
| 9 | 9 | ||
| 10 | kits: | 10 | kits: |
| 11 | - - docker.io/k33g/vscode-ssh-kit:0.0.7 | 11 | + - docker.io/k33g/vscode-ssh-kit:0.0.9 |
| 12 | - - docker.io/k33g/nushell-kit:0.0.7 | 12 | + - docker.io/k33g/nushell-kit:0.0.9 |
| 13 | - - docker.io/k33g/mini-me-agent-kit:0.0.7 | 13 | + - docker.io/k33g/mini-me-agent-kit:0.0.9 |
| 14 | - - docker.io/k33g/go-toolchain-kit:0.0.7 | 14 | + - docker.io/k33g/go-toolchain-kit:0.0.9 |
| 15 | - - docker.io/k33g/rust-toolchain-kit:0.0.7 | 15 | + - docker.io/k33g/rust-toolchain-kit:0.0.9 |
| 16 | 16 | ||
| 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. | 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. |
| 18 | workspace: ./demo | 18 | workspace: ./demo |
modified
sbxenv.zed.yaml +5 -5 | @@ -8,11 +8,11 @@ name: zed-mm | ||
| 8 | 8 | agent: zed-ssh-kit |
| 9 | 9 | |
| 10 | 10 | kits: |
| 11 | - - docker.io/k33g/zed-ssh-kit:0.0.7 | |
| 12 | - - docker.io/k33g/nushell-kit:0.0.7 | |
| 13 | - - docker.io/k33g/mini-me-agent-kit:0.0.7 | |
| 14 | - - docker.io/k33g/go-toolchain-kit:0.0.7 | |
| 15 | - - docker.io/k33g/rust-toolchain-kit:0.0.7 | |
| 11 | + - docker.io/k33g/zed-ssh-kit:0.0.9 | |
| 12 | + - docker.io/k33g/nushell-kit:0.0.9 | |
| 13 | + - docker.io/k33g/mini-me-agent-kit:0.0.9 | |
| 14 | + - docker.io/k33g/go-toolchain-kit:0.0.9 | |
| 15 | + - docker.io/k33g/rust-toolchain-kit:0.0.9 | |
| 16 | 16 | |
| 17 | 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. |
| 18 | 18 | workspace: ./demo |
| @@ -8,11 +8,11 @@ name: zed-mm | |||
| 8 | agent: zed-ssh-kit | 8 | agent: zed-ssh-kit |
| 9 | 9 | ||
| 10 | kits: | 10 | kits: |
| 11 | - - docker.io/k33g/zed-ssh-kit:0.0.7 | 11 | + - docker.io/k33g/zed-ssh-kit:0.0.9 |
| 12 | - - docker.io/k33g/nushell-kit:0.0.7 | 12 | + - docker.io/k33g/nushell-kit:0.0.9 |
| 13 | - - docker.io/k33g/mini-me-agent-kit:0.0.7 | 13 | + - docker.io/k33g/mini-me-agent-kit:0.0.9 |
| 14 | - - docker.io/k33g/go-toolchain-kit:0.0.7 | 14 | + - docker.io/k33g/go-toolchain-kit:0.0.9 |
| 15 | - - docker.io/k33g/rust-toolchain-kit:0.0.7 | 15 | + - docker.io/k33g/rust-toolchain-kit:0.0.9 |
| 16 | 16 | ||
| 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. | 17 | # Mounted at the same path as on the host, so VS Code opens that same path remotely. |
| 18 | workspace: ./demo | 18 | workspace: ./demo |