Skip to content

Add is_preemptible column to SessionRow #9716

@HyeockJinKim

Description

@HyeockJinKim

Add is_preemptible boolean column to SessionRow with default True. This allows per-session opt-out from preemption independently of priority value.

Preemption condition: is_preemptible == True AND priority <= preemptible_priority (from ScalingGroupOpts).

Scope

  • Add is_preemptible: bool column to SessionRow (default True, nullable=False)
  • Alembic migration for new column
  • Add is_preemptible parameter to session creation flow (registry.py, services/session/)
  • Expose in GraphQL session type and session creation input
  • Pass through scheduler repository types (PendingSessionData, SessionWorkload)

Key Files

  • models/session/row.py — new column
  • models/alembic/versions/ — new migration
  • registry.py — create_session parameter
  • services/session/actions/create_from_params.py
  • repositories/scheduler/types/session.py — PendingSessionData
  • api/gql/session/types.py — GraphQL field

Success Criteria

  • SessionRow.is_preemptible column exists with default True
  • Alembic migration applies cleanly (upgrade + downgrade)
  • Session creation without is_preemptible parameter defaults to True
  • Session creation with is_preemptible=False stores correctly
  • GraphQL query returns is_preemptible field for sessions
  • Existing sessions (before migration) get default True
  • pants lint/check passes for affected packages
  • pants test passes for affected packages

JIRA Issue: BA-4912

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions