Backend.AI Kernel Runner based on GNU libc
Reason this release was yanked:
Maybe incompatible with backend.ai-agent relying on this package as "~=2.1"
Project description
backend.ai-krunner-static-gnu
Backend.AI Kernel Runner Package for glibc-based Kernels
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 likestatic-gnu
,static-musl
, 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
,static_musl
)
Development
$ git clone https://github.com/lablup/backend.ai-krunner-{distro} krunner-{distro}
$ cd krunner-{distro}
$ pyenv virtualenv 3.9.6 venv-krunner # you may share the same venv with other krunner projects
$ pyenv local venv-krunner
$ pip install -U pip setuptools
$ pip install -U click -e .
How to update
- Modify Dockerfile and/or other contents.
- To update the Python version, update
src/ai/backend/krunner/{distro_}/krunner-python.{distro}.txt
and the dockerfiles accordingly, including thePYTHON_VERSION
environment variable and the download URL of the statically built Python distribution.
- Increment the volume version number specified as a label
ai.backend.krunner.version
insrc/ai/backend/krunner/{distro_}/krunner-env.{distro}.dockerfile
- Run
scripts/build.py
. - Repeat the above steps for each distro version. (For static builds, there is only one.)
- Increment the package version number in
src/ai/backend/krunner/{distro_}/__init__.py
rm -r dist/* build/*
(skip if these directories do not exist and or are empty)python setup.py sdist bdist_wheel
twine upload dist/*
Note that src/ai/backend/krunner/{distro_}/krunner-version.{distro}.txt
files are
overwritten by the build script from the label.
Build custom ttyd binary
⚠️ Warning: Use a x86-64 host to build ttyd, because:
- ttyd uses
musl
as their C stdlib, notglibc
. - 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for backend.ai-krunner-static-gnu-2.1.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b7b79979b075d1d4366b207442b4755d6d37ec0ddbe4cc5c1c3904fb0e73f5a9 |
|
MD5 | 9850a1680d1b11a7a4a401368bfac035 |
|
BLAKE2b-256 | ea53429e06e12184418ffdd00f513cf225cc9c31b89950a73e4fcba0e22d7392 |
Hashes for backend.ai_krunner_static_gnu-2.1.0-py3-none-manylinux2014_x86_64.macosx_11_0_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70444c3d0d4fd5119bfe6bcdd62eb28873274b402c667fbc7f67134394035df5 |
|
MD5 | e1635a8d17ee199b26ffb58fefcb2210 |
|
BLAKE2b-256 | 387edeb12a9a37ec0e1c225b7fc4d0911650659d7a7852db4a5b7d3aa001e45a |
Hashes for backend.ai_krunner_static_gnu-2.1.0-py3-none-manylinux2014_aarch64.macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ee99f4e4ef563c137b06269b7585673f087485afb4473f500a02d8f129ce1d7b |
|
MD5 | b617749297c15d1cef40687524e6a2ec |
|
BLAKE2b-256 | 03df392efdf19b1ead154481fbf6273459bf55128431881f52318deaebab2a0a |