Skip to main content

backend.ai-krunner-static-gnu

Backend.AI Kernel Runner Package for glibc-based Kernels

This package contains a statically built Python distribution and 3rd-party libraries required to run our krunner module inside containers whose images are provided by users.

The krunner wheel itself can be installed into any Python environments (the content of this plugin package is agnostic to platforms and architectures as it's a mere declaration of the plugin interface), but we still apply the binary wheel platform tags so that setuptools could distinguish the target CPU architecture as follows:

Where is Backend.AI running? What is the user container's base image? The krunner wheel used
manylinux (x86-64) manylinux (x86-64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
manylinux (x86-64) musllinux (x86-64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
manylinux (aarch64) manylinux (aarch64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
manylinux (aarch64) musllinux (aarch64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
musllinux (x86-64) manylinux (x86-64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
musllinux (x86-64) musllinux (x86-64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
musllinux (aarch64) manylinux (aarch64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
musllinux (aarch64) musllinux (aarch64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
macOS (x86-64) manylinux (x86-64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
macOS (x86-64) musllinux (x86-64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
macOS (aarch64) manylinux (aarch64) backend.ai_krunner_static_gnu-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
macOS (aarch64) musllinux (aarch64) backend.ai_krunner_alpine-X.X.X-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl

We named the krunner package based on musl 1.2 as "alpine" because practically Alpine linux is the only distribution which actively uses musl and it is currently not possible to build static CPython which can import 3rd-party dynamic modules on top of the musl ecosystem.

Notice about source distribution

This package is to distribute prebuilt binaries, so the source distribution does not have prebuilt binaries and does not work as intended. Just refer this repository on how we build stuffs.

How to read below

  • {distro} is a string like static-gnu, alpine, etc. depending on which repository you are in.
  • {distro_} is a string same to {distro} but with hyphens replaced with underscores for Python package names and paths. (e.g., static_gnu, alpine)

Development

$ git clone https://github.com/lablup/backend.ai-krunner-{distro} krunner-{distro}
$ cd krunner-{distro}
$ uv sync

To build wheels locally, replace ARCH in MANIFEST.in with the current architecture (e.g., "aarch64" or "x86_64"). Then:

$ uv run python scripts/build.py
$ uv build

How to update

  1. Modify Dockerfile and/or other contents.
  • To update the Python version, update src/ai/backend/krunner/{distro_}/krunner-python.{distro}.txt and the dockerfiles (both python and wheels) accordingly, including the PYTHON_VERSION environment variable and the download URL of the statically built Python distribution.
  1. Increment the volume version number specified as a label ai.backend.krunner.version in src/ai/backend/krunner/{distro_}/krunner-env.{distro}.dockerfile.
  2. Increment the package version number in src/ai/backend/krunner/{distro_}/__init__.py.
  3. Run uv run python scripts/build.py to confirm if the volume archive build is successfully done.
  4. Repeat the above steps for each distro version. (For static builds, there is only one.)
  5. rm -r dist/* build/* (skip if these directories do not exist and or are empty)
  6. Commit.
  7. Create a signed annotated tag and push the tag to let GitHub Action build and publish wheels.

Note that src/ai/backend/krunner/{distro_}/krunner-version.{distro}.txt files are overwritten by the build script from the label.

WARNING: We should choose x86_64_v2 binaries from the indygreg repository when updating the Python runtime version for CPU compatibility with some of our test setups and customer sites.

Making a minimal glibc-based image compatibile with this krunner package

Use CentOS 7 or later and install this list of packages. Also refer the test script.

Build custom ttyd binary

⚠️ Warning: Use a x86-64 host to build ttyd, because:

  • ttyd uses musl as their C stdlib, not glibc.
  • The musl toochain used by the build script is x86_64 binaries.

libwebsockets>=4.0.0 features auto ping/pong with 5 min default interval. (https://github.com/warmcat/libwebsockets#connection-validity-tracking) And, ws_ping_pong_interval of ttyd is not effective in libwebsockets>=4.0.0. This seems to be the reason why ttyd>=1.6.1 does not set ws_ping_pong_interval for libwebsockets>=4.0.0. (https://github.com/tsl0922/ttyd/blob/master/src/server.c#L456)

To fix this issue, we modify and build the latest version of libwebsockets used by the ttyd build script manually.

# Prepare Ubuntu environment (possibly, through container) and dependencies.
sudo apt-get update
sudo apt-get install -y autoconf automake build-essential cmake curl file libtool

# Download ttyd source.
git clone https://github.com/tsl0922/ttyd.git
cd ttyd

Now let's modify ./scripts/cross-build.sh. Add these two lines under pushd "${BUILD_DIR}/libwebsockets-${LIBWEBSOCKETS_VERSION}":

sed -i 's/context->default_retry.secs_since_valid_ping = 300/context->default_retry.secs_since_valid_ping = 20/g' lib/core/context.c
sed -i 's/context->default_retry.secs_since_valid_hangup = 310/context->default_retry.secs_since_valid_hangup = 30/g' lib/core/context.c

Finally, build the ttyd binary.

# Run build script.
./scripts/cross-build.sh

# Check ttyd binary version.
./build/ttyd --version

Metadata

Release files for backend.ai-krunner-static-gnu 4.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for backend.ai-krunner-static-gnu 4.4.0
File Size Uploaded
backend_ai_krunner_static_gnu-4.4.0.tar.gz 19.6 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for backend.ai-krunner-static-gnu 4.4.0
File Interpreter ABI Platform
backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64, Linux glibc 2.17+ x86-64, Linux musl 1.1+ x86-64 Details
backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64, Linux musl 1.1+ ARM64, Linux glibc 2.17+ ARM64 Details

Total release size: 47.0 MB

Release files / backend_ai_krunner_static_gnu-4.4.0.tar.gz

Download URL backend_ai_krunner_static_gnu-4.4.0.tar.gz
Size 19.6 kB
Tags Source
SHA-256 checksum
How to use checksums
e0a9b82b93479c10e71c3e7123278b52e7d473360220d6862c8fa3174de27a97
BLAKE2b-256 checksum
How to use checksums
06b93bf5362da6a102718f8cc3d1105d05d1b438bcbe225500209994779bccf1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release files / backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl

Download URL backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_x86_64.musllinux_1_1_x86_64.macosx_11_0_x86_64.whl
Size 25.0 MB
Tags Linux glibc 2.17+ x86-64 Linux musl 1.1+ x86-64 Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
c343d8b16b0dde2992c1c6687c1cac9b7c7a49ec1b77c5d75b1dc316ad040811
BLAKE2b-256 checksum
How to use checksums
e38ff8766a961bb87801c6a813992fe8dbc71685bcc1c345be194f3fc25278cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release files / backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl

Download URL backend_ai_krunner_static_gnu-4.4.0-py3-none-manylinux2014_aarch64.musllinux_1_1_aarch64.macosx_11_0_arm64.whl
Size 22.0 MB
Tags Linux glibc 2.17+ ARM64 Linux musl 1.1+ ARM64 Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
4c717665664ded37439d157fc91c015f8f3b3f82cd98ab5e8fdac5f43d5364dc
BLAKE2b-256 checksum
How to use checksums
adb6b45323006c3f96249629e3120c78439d57df07b37489e46e9e41232868d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 9, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

4.4.0 This release

3 release files

4.3.0

3 release files

4.2.0

3 release files

4.1.1

3 release files

4.1.0

3 release files

4.0.2

3 release files

4.0.1

3 release files

4.0.0

3 release files

3.0.0

3 release files

2.1.0

3 release files

2.0.1

3 release files

2.0.0

3 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page