lablup / lablup/backend.ai

Reduce per-release package footprint

Open
#3,344 0 comments 0 reactions 1 assignee Claimed by @achimnol View on GitHub
Dominant language
Python
Stars
670
Forks
183
Avg merge
17h 7m
Merged PRs (30d)
358

Description

Recently we have hit the project size limit of `backend.ai-kernel-binary`. While we have requested the size limit increase ([https://github.com/pypi/support/issues/5012](https://github.com/pypi/support/issues/5012), [https://github.com/pypi/support/issues/4223](https://github.com/pypi/support/issues/4223) ), I think it is better to reduce the overall footprint of our release packages, as we are going to make releases more frequently from this year.

To achieve this, we need to do either:

1. Split the repositories for `backend.ai-kernel-binary` (`src/ai/backend/runner`) and put `backend.ai-agent`’s binary files there such as the socket-relay container image to build and publish them separately, just like `backend.ai-krunner-static-gnu` and `backend.ai-krunner-alpine`.
1. Keep the monorepo architecture as-is but skip publishing the unchanged `backend.ai-kernel-binary` pacakge and alikes. We need to pin the internal dependency version to them to the last published version. This approach would require some custom logic in the `setupgen` pants plugin we have.
### Some background

- `backend.ai-kernel` (`src/ai/backend/kernel` in the core monorepo)\* A small daemon running inside the container to control user processes and app services.
- The update lifecycle is tightly coupled with the agent because it has a communication protocol tightly coupled with the agent implementation, so it should be released together from the mono-repo.
- For the same reason, we are mounting its installation directory into the container when we create a new container to keep it up-to-date and split it from the container images' lifecycle.

- `backend.ai-kernel-binary` (`src/ai/backend/runner` in the core monorepo)\* Intrinsic executables including dropbear, sftp-server, and ttyd which are available to all containers running on Backend.AI.
- `entrypoint.sh`, `jail` and other helper files to be mounted in the containers.
- The update lifecycle is _somewhat_ coupled with the agent. For instance, `entrypoint.sh` needs to be updated when we introduce some new agent features.

- `backend.ai-krunner-*` (separate repositories)\* The statically built Python runtime (from [PSB](https://github.com/astral-sh/python-build-standalone)) + wheel dependency files required to run the kernel runner (`backend.ai-kernel`).
- They are populated as Docker volumes (with a simple versioning scheme) and mounted into the container upon creation.
- Thee update lifecycle is completely decoupled from the agent and other [Backend.AI](http://Backend.AI) packages, but I usually rebuild them when we upgrade the major Python version (e.g., 3.11 → 3.12, refs [https://lablup.atlassian.net/browse/BA-4](https://lablup.atlassian.net/browse/BA-4)) or there are critical bug fixes in the Python release.

JIRA Issue: BA-437

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.