Skip to content

feat: Add non-interactive sessions#1095

Open
eikek wants to merge 33 commits intomainfrom
eikek/non-interactive-session
Open

feat: Add non-interactive sessions#1095
eikek wants to merge 33 commits intomainfrom
eikek/non-interactive-session

Conversation

@eikek
Copy link
Copy Markdown
Member

@eikek eikek commented Mar 27, 2026

A session can now be either interactive (the default) or non-interactive which is indicated by a new property in the CRD: sessionType. It is either Interactive or NonInteractive.

When a non-interactive session is requested, the session is not mapped to a stateful set, but to a job. Additionally, no Service and no Ingress is applied. The "hibernation" feature of a session is mapped to a suspended job.

The session spec should contain the two timeouts used for non-interactive sessions: MaxAge and MaxHibernatedTime. The former is pushed into the jobs ActiveDeadlineSeconds that defines the maximum runtime. If that limit is reached, the job is tried to terminate and the session goes into "Hibernated" state. From there the MaxHibernatedTime functions the same as for interactive sessions: once this is reached, the session and all related resources are removed. This is done by setting the TTLSecondsAfterFinished timeout on the Job spec. It is important, that the job lifetime (ActiveDeadlineSeconds) is not shorter than the amalthea session, otherwise the session will re-create the job when it is removed by kubernetes due to this timeout.

The overall amalthea status is derived from the associated Pod, which is assumed to be a single one. This is true for non-interactive sessions as well, as the config ensures only one pod running for the job. Then only the GetPod function is adopted to return the Pod of the Job in case of a non-interactive session.

Comment thread internal/controller/amaltheasession_controller.go Outdated
@eikek eikek force-pushed the eikek/non-interactive-session branch from d710128 to 008a000 Compare March 31, 2026 08:35
@eikek eikek force-pushed the eikek/non-interactive-session branch 2 times, most recently from ba76f86 to ac5311e Compare April 16, 2026 08:05
@eikek eikek marked this pull request as ready for review April 22, 2026 09:02
@eikek eikek requested review from a team and olevski as code owners April 22, 2026 09:02
@eikek eikek requested a review from leafty April 22, 2026 09:03
@eikek eikek force-pushed the eikek/non-interactive-session branch from d8ef15e to 16d5ec0 Compare April 22, 2026 13:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants