-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #31 from Ortec-Finance/remove-job-deadline
Remove job deadline
- Loading branch information
Showing
5 changed files
with
55 additions
and
2 deletions.
There are no files selected for viewing
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# Broker Scale to Zero | ||
By enabling this component you will have all services of Sailfish scaled to zero, when no message is received | ||
|
||
## Prerequistes | ||
- `sailfish-gateway` component | ||
- Not use `ephemeral-broker` component | ||
|
||
The ScaledObject enabled by the `broker-scale-to-zero` component triggers a scaleup of the broker when it detects the `sailfish-gateway` pod! | ||
|
||
Do not use the `ephemeral-broker` component as that might result in data loss. | ||
|
||
|
||
## Configuring your workloads | ||
### The Gateway | ||
The Gateway workload must be configured to wait for the broker to be up and running. This can be done by simply pinging the broker in a loop until successful. | ||
|
||
### Additional Queues | ||
When you have additional queues, this must be considered when using this component. The `sailfish-amq-broker-autoscaler` `ScaledObject` triggers are designed to keep the broker up after the gateway is finished and scaled down. | ||
|
||
The ScaledJobs outside of the runner and run-manager must be added to the `triggers` of the `ScaledObject` as otherwise the broker might be scaled down when these queues are needed to be accessed. | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# The Job Paradigm | ||
Sailfish uses ScaledJobs to scale compute based on an Queue. | ||
For your workloads to comply with this paradigm we need to consider a few symptoms | ||
|
||
--- | ||
|
||
## The Problems | ||
|
||
### Overshoot | ||
The ScaledJobs tends to overshoot the need of jobs, this is due to delays between a job being picked up and the AMQ Broker signaling it via its Prometheus Metrics. This can sometimes result in more instances of Runners spawning per Task. Additionally, if your workloads are configured to not terminate after the completion of one Task, it can amplify this issue | ||
|
||
### The Nature of a Job | ||
A Kubernetes Job, is not supposed to be terminated from the outside. It's meant to run to completion and Kubernetes respects that by never terminating it unless it is evicted. | ||
|
||
### Keeping Runners warm | ||
For some workloads it can be beneficial to keep the Runners warm as the initialization can be time-consuming. | ||
|
||
--- | ||
|
||
## The Solution | ||
To comply with these symptoms you have to design your workloads to have a stop condition, so that they can terminate gracefully. You can do this by after each computation trigger a self-destruct timer with a short grace period of ~30s. | ||
|
||
With this grace-period, we can have a Runner capable of picking up multiple tasks which prevents the initialization time penalty. | ||
|
||
|
||
### Python | ||
TODO: Code Examples | ||
|
||
### C# | ||
TODO: Code Examples | ||
|
||
|
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
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