-
Notifications
You must be signed in to change notification settings - Fork 65
vdk-meta-jobs: Meta Jobs DAG validation #1785
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
vdk-meta-jobs: Meta Jobs DAG validation #1785
Conversation
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
for more information, see https://pre-commit.ci
gabrielgeorgiev1
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good overall, I'm approving it but I'd still appreciate responses for my comments
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In addition to checking for job structure, there are a few other validations you may want to consider on DAG level . (if you are planning to add them in separate PR , then you can ignore this comment)
- Validate that there are not cycles
- As the DAG is a list of jobs it's possible to have duplicate job names. This can lead to confusion and unintended behavior
You can use graphlib.TopologicalSorter for that (at least for 1.)
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/meta_dag.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
for more information, see https://pre-commit.ci
|
Added 2 new classes:
The only thing left to be done now is to add topological sorter validation. |
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
antoniivanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Functionality looks pretty good. I have mostly clean code suggestion.
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
projects/vdk-plugins/vdk-meta-jobs/src/vdk/plugin/meta_jobs/dag_validator.py
Outdated
Show resolved
Hide resolved
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
for more information, see https://pre-commit.ci
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
antoniivanov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Please go over the message description. Make sure they are clear to someone without context . They know what the problem is and how to solve it.
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
for more information, see https://pre-commit.ci
Signed-off-by: Yoan Salambashev <ysalambashev@vmware.com>
Introduce a DagValidator class that properly validates the Meta Jobs DAG before it is built. It checks for:
Rework the test_meta_job tests by introducing a TestMetaJob class that contains all the existing ones as well as some new validation-related ones.
Tested-by: all the existing tests pass and introduced some new unit tests for the different cases
Signed-off-by: Yoan Salambashev ysalambashev@vmware.com