-
Notifications
You must be signed in to change notification settings - Fork 59
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
vdk-meta-jobs: implement a limit on concurrent running jobs (#1681)
What: Create a check that checks for every job if there are more than a configurable amount of concurrent running jobs (15 by default) in a Meta Jobs DAG. If so, the ones that exceed the limit would be delayed. Why: We want to limit the number of concurrent running Meta jobs in order not to overload the SC Tests: unit test is introduced and all the rest are passing Signed-off-by: Yoan Salambashev [[email protected]](mailto:[email protected]) --------- Signed-off-by: Yoan Salambashev <[email protected]>
- Loading branch information
Showing
6 changed files
with
97 additions
and
3 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
2 changes: 2 additions & 0 deletions
2
projects/vdk-plugins/vdk-meta-jobs/tests/jobs/meta-job-exceed-limit/config.ini
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,2 @@ | ||
[owner] | ||
team = team-awesome |
18 changes: 18 additions & 0 deletions
18
projects/vdk-plugins/vdk-meta-jobs/tests/jobs/meta-job-exceed-limit/meta.py
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,18 @@ | ||
# Copyright 2021-2023 VMware, Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
import logging | ||
|
||
from vdk.api.job_input import IJobInput | ||
from vdk.plugin.meta_jobs.meta_job_runner import MetaJobInput | ||
|
||
log = logging.getLogger(__name__) | ||
|
||
|
||
def run(job_input: IJobInput): | ||
log.info(f"Dummy arguments {job_input.get_arguments()}") | ||
|
||
jobs = [ | ||
{"job_name": f"job{i}", "depends_on": [] if i == 1 else ["job1"]} | ||
for i in range(1, 8) | ||
] | ||
MetaJobInput().run_meta_job(jobs) |
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