This repository was archived by the owner on Sep 24, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 45
Add basic preflight checks as the first component in the pipeline #21
Open
JudeNiroshan
wants to merge
1
commit into
opendatahub-io:main
Choose a base branch
from
JudeNiroshan:preflight-checks
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.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .components import git_clone_op, sdg_op | ||
from .components import preflight_check_op, git_clone_op, sdg_op | ||
from . import faked | ||
|
||
__all__ = ["git_clone_op", "sdg_op", "faked"] | ||
__all__ = ["preflight_check_op", "git_clone_op", "sdg_op", "faked"] |
This file contains hidden or 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 |
---|---|---|
|
@@ -5,6 +5,26 @@ | |
|
||
IMAGE = "quay.io/tcoufal/ilab-sdg:latest" | ||
|
||
@dsl.component(base_image=IMAGE) | ||
def preflight_check_op( | ||
repo_branch: str, | ||
repo_pr: Optional[int], | ||
): | ||
from os import getenv | ||
|
||
if (not repo_branch) and (repo_pr is None or repo_pr <= 0 ): | ||
raise Exception("Both taxonomy repo branch and taxonomy pull request number cannot be empty") | ||
api_key = getenv("api_key") | ||
model = getenv("model") | ||
endpoint = getenv("endpoint") | ||
|
||
if not api_key: | ||
raise Exception("Model Server Auth Key is missing in kfp-model-server secret") | ||
if not model: | ||
raise Exception("Model name is missing in kfp-model-server configMap") | ||
if not endpoint: | ||
raise Exception("Model Server endpoint URL is missing in kfp-model-server configMap") | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This will fail at the first step anyways if these params are not set correctly. Do we want to add in some additional checks here that may cause failures during the training and eval steps later on as well? |
||
@dsl.container_component | ||
def git_clone_op( | ||
taxonomy: dsl.Output[dsl.Dataset], | ||
|
This file contains hidden or 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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
from .components import git_clone_op, sdg_op | ||
from .components import preflight_check_op, git_clone_op, sdg_op | ||
|
||
__all__ = ["git_clone_op", "sdg_op"] | ||
__all__ = ["preflight_check_op", "git_clone_op", "sdg_op"] |
This file contains hidden or 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
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.
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.
This gets checked when you try to create the run. It will give an error if you try to proceed without a PR or branch.
Failed to create a new run: Failed to generate the ExecutionSpec: invalid pipeline job inputs: Invalid input error: input parameter repo_pr requires type double or integer, but the parameter value is not of number value type
Can remove this check