Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preempt/Cancel on executor #4022

Merged
merged 15 commits into from
Nov 5, 2024
Merged

Conversation

MustafaI
Copy link
Contributor

@MustafaI MustafaI commented Oct 23, 2024

Summary of changes:

  • Adding armadactl functionality to cancel/preempt by executor
  • Adding cancelOnExecutor and preemptOnExecutor rpcs to Executor Service
    • Allows users to cancel/preempt jobs on executors by queue name and priority class

}

cmd.Flags().StringSliceP("match-queues", "q", []string{}, "Cancel jobs on executor matching the specified queue names. If no queues are provided, jobs across all queues will be cancelled.")
return cmd
Copy link
Collaborator

@robertdavidsmith robertdavidsmith Nov 4, 2024

Choose a reason for hiding this comment

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

Suggest

  • rename --match-queues to just --queues
  • for consistency, if --queues requires a command line argument, then priority classes should require a --priority-classes arg.
  • comment should specify what the delimiter is if you want to cancel multiple queues


return a.PreemptOnExecutor(onExecutor, matchQueues, onPriorityClasses)
},
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Similar to last comment

queueMsg = "all"
}

fmt.Fprintf(a.Out, "Requesting preemption of jobs matching executor: %s, queues: %s, priority-classes: %s\n", executor, queueMsg, priorityClasses)
Copy link
Collaborator

Choose a reason for hiding this comment

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

You need to string.join(priorityClasses) as you did with queues

ON jr.job_id = j.job_id
WHERE jr.executor = $1
AND j.queue = ANY($2::text[])
AND jr.succeeded = false AND jr.failed = false AND jr.cancelled = false
Copy link
Collaborator

Choose a reason for hiding this comment

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

Also AND jr.preempted = false

@MustafaI MustafaI merged commit 7fe5217 into master Nov 5, 2024
28 checks passed
@MustafaI MustafaI deleted the mustafai/job-controls-on-executor branch November 5, 2024 12:32
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