Repository navigation
feat(BA-8594): add the kernel group tables and the kernel's group foreign key - #15919
Merged
Merged
Conversation
fregataa
added a commit
that referenced
this pull request
Oct 20, 2026
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU
fregataa
marked this pull request as draft
October 20, 2026 10:19
fregataa
force-pushed
the
feat/BA-8594-kernel-group-tables
branch
2 times, most recently
from
October 20, 2026 10:36
beeec31 to
d0bce67
Compare
fregataa
marked this pull request as ready for review
October 20, 2026 11:03
fregataa
force-pushed
the
feat/BA-8594-kernel-group-tables
branch
2 times, most recently
from
October 20, 2026 11:19
2a729b8 to
690ac5e
Compare
seedspirit
reviewed
Oct 21, 2026
| # runtime default. Not a slot: the agent sets it as ShmSize and allocates nothing. | ||
| shmem: Mapped[int | None] = mapped_column("shmem", sa.BigInteger, nullable=True) | ||
| startup_command: Mapped[str | None] = mapped_column("startup_command", sa.Text, nullable=True) | ||
| bootstrap_script: Mapped[str | None] = mapped_column("bootstrap_script", sa.Text, nullable=True) |
Contributor
There was a problem hiding this comment.
How about using BootstrapScriptID here?
Contributor
There was a problem hiding this comment.
Alternatively, how about managing bootstrap_script and similar items as separate options rather than as part of the kernel group row?
Member
Author
There was a problem hiding this comment.
We decided to add bootstrap script revision and bootstrap script revision id will be added
jopemachine
reviewed
Oct 21, 2026
fregataa
force-pushed
the
feat/BA-8594-kernel-group-tables
branch
from
October 21, 2026 05:44
690ac5e to
d89b453
Compare
HyeockJinKim
requested changes
Oct 21, 2026
| ), | ||
| index=True, | ||
| nullable=True, | ||
| ) |
Collaborator
There was a problem hiding this comment.
Shouldn't this be deleted along with the rest, rather than using SET_NULL?
Comment on lines
+78
to
+82
| sa.ForeignKeyConstraint( | ||
| ["kernel_group_id"], | ||
| ["kernel_groups.id"], | ||
| name=op.f("fk_kernel_group_resource_slots_kernel_group_id_kernel_groups"), | ||
| ondelete="CASCADE", |
Collaborator
There was a problem hiding this comment.
Shouldn't we restrict it with RESTRICT and clean it up? Since we're linking to external resources.
fregataa
force-pushed
the
feat/BA-8594-kernel-group-tables
branch
2 times, most recently
from
October 21, 2026 09:36
50560b2 to
47bcd33
Compare
…eign key Add kernel_groups (one row per session role with the shared execution spec), kernel_group_resource_slots (the request, one row per slot) and kernel_group_environ (one row per key, key format checked), plus a nullable kernels.kernel_group_id. Schema only; the enqueue write and the backfill of existing sessions follow separately. Register the new model modules for the component and scenario test sandboxes so the kernels foreign key resolves there. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU
Drop the bootstrap_script column; a group will reference a bootstrap script revision instead once revisions exist (BA-8658). Name the role key kernel_group_role like the other natural keys, and chain the migration after system_session_environ, which landed on main. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU
Move the environment variable name regex to manager/data/environ so system_session_environ and kernel_group_environ declare the same CHECK from one constant. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU
…rows reference kernels.kernel_group_id and kernel_group_resource_slots.kernel_group_id block the group's deletion; only its environ rows go with it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU
…me name constraint Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_0128bKAiecc6WfVK9VBRjxBv
fregataa
force-pushed
the
feat/BA-8594-kernel-group-tables
branch
from
October 22, 2026 02:28
47bcd33 to
a759460
Compare
HyeockJinKim
approved these changes
Oct 22, 2026
jopemachine
added a commit
that referenced
this pull request
Oct 22, 2026
…ated key pattern main gained `ai.backend.manager.data.environ.types.ENVIRON_KEY_PATTERN` (#15919), so the copy this branch added under `common/data/environ` goes and both users import main's. main itself carries two heads, 51d33226c0a5 and c9e1b7a4d2f0, both on 3b8e1d6c9a47; an empty merge revision joins them and this branch's revision moves on top of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
kernel_groups: one row per session role, holding the execution spec its kernels share (image_id,shmem,startup_command,bootstrap_script,preopen_ports,requested_starts_at,batch_timeout_sec), unique on(session_id, role).kernel_group_resource_slots(the request, one row per slot,idprimary key and unique on(kernel_group_id, slot_name)) andkernel_group_environ(one row per key,(kernel_group_id, key)primary key, key format CHECK matchingsystem_session_environ).kernels.kernel_group_idforeign key,KernelGroupID/KernelGroupResourceSlotID/KernelGroupRoleincommon/data/entity, andNaturalKeyColumnsoroleandslot_nameread back as theirNaturalKeykind.Schema only. The enqueue write that creates the group rows and the backfill of existing sessions follow in separate PRs.
shmemis a column on the group, not a slot: it is a carve-out of the requestedmemthat the agent only applies asShmSize.Test plan
alembic upgrade head/downgradeon a local halfstack DB: tables and thekernelscolumn are created and dropped, existing kernels keepkernel_group_id = NULLalembic checkreports no drift for the new tables against the Row declarationspants check/pants testResolves BA-8594
🤖 Generated with Claude Code
https://claude.ai/code/session_01RsGNdkS3wbsaS2isxoVGfU