lablup / lablup/backend.ai-webui

Session launcher preemption controls: 3-tier jobPriority (High/Normal/Low) + isPreemptible toggle

Open
#9,546 0 comments 0 reactions 0 assignees View on GitHub
preemption
Dominant language
TypeScript
Stars
133
Forks
81
Avg merge
1d 11h
Merged PRs (30d)
344

Description

## Background

`EnqueueSessionInput` accepts `jobPriority: Int! = 0` (uncapped, negatives allowed, strict-less-than comparison — equal values never preempt each other) and `isPreemptible: Boolean! = true`. Both are **creation-time only**; core has no mutation to change them on an existing session, and no user-triggered preempt API (scheduler-only).

## Design decision — 3-tier UI over a raw integer

Present `jobPriority` as a 3-tier selector instead of a number input:

- **Low = -10 / Normal = 0 / High = 10** (Normal MUST map to 0 so untouched sessions equal the backend default)
- Wire format stays `Int` — this is a UI convention only; do not request a backend enum
- Sessions created via CLI/API with non-tier values render as "Custom (n)" in detail views — do not bucket them into tiers
- No numeric escape hatch in v1 (prevents priority inflation); add later if needed
- Label must not collide with the existing global-queue `priority` (0–100) — e.g. "preemption tier" vs "priority"

## Scope

1. Launcher advanced section: tier selector (default Normal) + "allow this session to be preempted" switch (default ON).
1. Copy must state the default scope: ranks the user's **own** sessions only (`victimScope` defaults to USER) and has no effect unless the target resource group has preemption enabled. Consider hiding/disabling when the selected resource group has `PreemptionConfig.enabled = false`.
1. Session detail: read-only display of `metadata.jobPriority` (as tier or Custom (n)) and `isPreemptible`; optional small badge in session list for `isPreemptible = false`.

## Version gates

- `jobPriority` read field + honored `isPreemptible` require a manager with core fixes 13239/13264 (26.8.x) — gate accordingly.

## Acceptance criteria

- Tier selector maps exactly to -10/0/10; non-tier values shown as Custom (n); copy correctly scoped; `bash scripts/verify.sh` passes.

JIRA Issue: FR-3890

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by locating the launcher advanced section and session detail views, then trace EnqueueSessionInput and the session metadata fields for jobPriority and isPreemptible. Check the manager version gate for core fixes 13239/13264 and the selected resource group's PreemptionConfig.enabled state. Done means exact -10/0/10 mapping, Custom (n) display, correctly scoped copy, and a passing bash scripts/verify.sh.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.