Skip to content

feat: add preempt reason#4640

Merged
JamesMurkin merged 36 commits intoarmadaproject:masterfrom
williamvega:williamvega/add-preempt-reason
Feb 17, 2026
Merged

feat: add preempt reason#4640
JamesMurkin merged 36 commits intoarmadaproject:masterfrom
williamvega:williamvega/add-preempt-reason

Conversation

@williamvega
Copy link
Collaborator

@williamvega williamvega commented Jan 28, 2026

What type of PR is this?

Feature

What this PR does / why we need it

Currently the reason provided when preempting a job does not get stored, and the response to the UI is hardcoded for preempted jobs. This change adds the reason to the scheduler db runs table and appends the user to the run reason provided.

image

Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
…schedulerb

Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
@williamvega williamvega changed the title williamvega/add preempt reason feat: add preempt reason Jan 28, 2026
@williamvega williamvega marked this pull request as ready for review January 28, 2026 19:21
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
commit fb2d1d8
Author: Ian Hockett <32877705+ianhockett@users.noreply.github.com>
Date:   Fri Jan 30 06:04:17 2026 -0600

    fix: mage checkDeps false positive docker suffix (armadaproject#4636)
    Bug fix
    Previously, the mage target `checkDeps` would fail on the docker version
    if there is _any_ suffix. This is the default behavior of the `semver`
    package, which ignores prereleases. This meant that a valid version of
    docker that was using a build _variant_ (rancher desktop, community
    edition, enterprise edition) would fail, even though the version is well
    within the constraint. This change updates the version of the `semver`
    package to `3.4.0` which enables setting `IncludePrerelease` to true on
    the constraints object, which includes prerelease versions in the
    version check.

    Signed-off-by: Ian Hockett <ian@hockett.net>
    Co-authored-by: Maurice Yap <mauriceyap@hotmail.co.uk>

commit 8d666ba
Author: Dejan Zele Pejchev <pejcev.dejan@gmail.com>
Date:   Thu Jan 29 22:15:59 2026 +0000

    feat: add terminated generated column to runs table and optimize join queries (armadaproject#4642)

    <!-- Thanks for sending a pull request! Here are some tips for you: -->

    Enhancement

    Added a `terminated` auto-generated column to the `runs` table, computed
    as `cancelled OR succeeded OR failed`. The `jobs` table already had this
    pattern.

    This consolidates terminal-state checks into a single column,
    eliminating the risk of queries checking an inconsistent subset of
    booleans.

    Join queries were also updated to filter on the `runs` table before
    joining to `jobs`, and new indexes on terminated replace the old
    multi-boolean indexes.
    <!--
    *Automatically closes linked issue when PR is merged.
    Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
    _If PR is about `failing-tests or flakes`, please post the related
    issues/tests in a comment and do not use `Fixes`_*
    -->
    Fixes #

Signed-off-by: williamvega <williamvega1006@gmail.com>
Signed-off-by: williamvega <williamvega1006@gmail.com>
@williamvega williamvega marked this pull request as draft February 2, 2026 15:47
Signed-off-by: williamvega <williamvega1006@gmail.com>
@williamvega
Copy link
Collaborator Author

williamvega commented Feb 2, 2026

image

Small change to upsert.go after merging in changes from #4642, which maintains the column order on insert. Passes tests, please let me know if there is anything else to test.

@williamvega williamvega marked this pull request as ready for review February 2, 2026 21:25
mauriceyap
mauriceyap previously approved these changes Feb 4, 2026
Signed-off-by: williamvega <williamvega1006@gmail.com>
@williamvega williamvega marked this pull request as ready for review February 10, 2026 22:07
batch := &pgx.Batch{}
for reason, jobIds := range reasonToJobIds {
for i := 0; i < len(jobIds); i += batchSize {
end := min(i+batchSize, len(jobIds))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you could probably simplify this with https://github.com/armadaproject/armada/blob/master/internal/common/slices/slices.go#L13

However that is just a nitpick

@JamesMurkin JamesMurkin merged commit a4c8b53 into armadaproject:master Feb 17, 2026
16 checks passed
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.

3 participants