-
Notifications
You must be signed in to change notification settings - Fork 1
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
Job lifecycle notifications #30
Draft
AdrianoKF
wants to merge
21
commits into
main
Choose a base branch
from
monitoring
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
+6,635
−4
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AdrianoKF
changed the title
feat(watcher): Add rudimentary notification tooling
Job lifecycle monitoring and notifications
Jul 16, 2024
AdrianoKF
changed the title
Job lifecycle monitoring and notifications
Job lifecycle notifications
Jul 16, 2024
The `watcher` Go application uses the Kubernetes client API to monitor jobs in the current namespace and send notifications for major lifecycle events. Jobs need to be annotated in order to be eligible for notifications: Use`x-jobby.io/notify-channel: [slack|webhook]` to determine the notification channel (HTTP webhook or Slack), and then control the destinations with `x-jobby.io/slack-channel-ids` (comma-separated) or `x-jobby.io/webhook-urls` (comma-separated) annotations. If using the Slack notification channel, pass the Slack API token through the `WATCHER_SLACK_API_TOKEN` env variable.
This allows setting metadata for jobs submitted to Kubernetes (i.e., Kueue `Job`, `RayJob` resources). In particular, the feature can be used to configure lifecycle notifications for those jobs.
janwillemkl
approved these changes
Jul 16, 2024
This commit changes the monitoring logic to observe the lifecycle of Kueue workloads instead of raw K8s Job resources. This allows the code to gracefully handle other workload types, such as Ray jobs, without any changes. Also, the code has been decomposed into separate packages for improved readability (although there are still a lot of rough edges).
AdrianoKF
force-pushed
the
main
branch
3 times, most recently
from
August 2, 2024 09:23
2da1a0b
to
9bb9f8b
Compare
Codecov ReportAttention: Patch coverage is
✅ All tests successful. No failed tests found. Additional details and impacted files@@ Coverage Diff @@
## main #30 +/- ##
==========================================
- Coverage 56.42% 51.64% -4.78%
==========================================
Files 61 68 +7
Lines 2997 3286 +289
==========================================
+ Hits 1691 1697 +6
- Misses 1306 1589 +283
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
AdrianoKF
force-pushed
the
monitoring
branch
from
September 12, 2024 08:41
3338817
to
89e300c
Compare
AdrianoKF
added
enhancement
New feature or request
backend
Related to the backend / server component.
labels
Sep 12, 2024
AdrianoKF
force-pushed
the
monitoring
branch
from
September 17, 2024 08:43
2dc24fc
to
d440da8
Compare
AdrianoKF
force-pushed
the
monitoring
branch
from
September 17, 2024 08:47
d440da8
to
957c71f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The
watcher
Go application uses the Kubernetes client API to monitor jobs in the current namespace and send notifications for major lifecycle events.See the README for additional details.
Original PR description follows:
Jobs need to be annotated in order to be eligible for notifications:
Use
x-jobby.io/notify-channel: [slack|webhook]
to determine the notification channel (HTTP webhook or Slack), and then control the destinations withx-jobby.io/slack-channel-ids
(comma-separated) orx-jobby.io/webhook-urls
(comma-separated) annotations.If using the Slack notification channel, pass the Slack API token through the
WATCHER_SLACK_API_TOKEN
env variable.Notification Channels
The code uses the
notify
package, which supports are variety of destinations.So far, the following have been implemented:
webhook
: HTTP (POST) webhooks to a URLslack
: Slack message to one or multiple channels, requires a Slack API tokenNotification Types
The following notifications have been implemented (so far, only Kubernetes/Kueue
Job
s are supported):Usage Example
The following job options set up Slack notifications for lifecycle events in a job:
Deployment
See
watcher/README.md
for details.