-
Notifications
You must be signed in to change notification settings - Fork 26
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
Feature/vertex compiler #411
Conversation
@@ -41,7 +41,7 @@ classifiers = [ | |||
] | |||
|
|||
[tool.poetry.dependencies] | |||
python = ">= 3.8" | |||
python = ">= 3.8 < 3.12" |
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.
kfp(v2) only supports up to python 3.12
"type": "String", | ||
def from_fondant_component_spec(cls, fondant_component: ComponentSpec): | ||
"""Generate a Kubeflow component spec from a ComponentOp.""" | ||
input_definitions = { |
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.
split now between artifacts and parameters
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.
Thanks Geroges! Really nice work, looking clean ✨
Still a bit concerned on how this will end up integrating with KFP. Just out of curiosity, what would break with your current implementation if you switch back to v1 and import from v2?
"bool": "Boolean", | ||
"dict": "JsonObject", | ||
"list": "JsonArray", | ||
"str": "STRING", |
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.
Perhaps we can import this dict and use it?
We can maybe do the same for V1 as well instead of defining our own custom one
https://github.com/kubeflow/pipelines/blob/2b05ec867fad84e24fe73ef7515e3b5849297e79/sdk/python/kfp/dsl/types/type_utils.py#L86
FYI I just stumbled on this when trying to look out for the v2 types since I couldn't find them in the docs
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.
I'll add it as a task
src/fondant/compiler.py
Outdated
|
||
else: | ||
component_task = kubeflow_component_op( | ||
metadata=metadata, |
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.
Why not follow the same approach as the KFP compiler and set the input manifest as optional?
|
||
component_op = component["fondant_component_op"] | ||
# convert ComponentOp to Kubeflow component | ||
kubeflow_component_op = self.kfp.components.load_component_from_text( |
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.
It seems like this is the only difference between the two compiler (the SDK changed for this function). Can we perhaps reuse the same function instead of defining it twice. Seems like there is quite a bit of overlap
if is_kubeflow_output: | ||
# Save to the expected base path directory | ||
safe_component_name = self.spec.name.replace(" ", "_").lower() | ||
save_path_base_path = ( |
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.
Are we then no longer saving the manifest relative to the basepath? We need it for data exploration
#368 (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.
Added as task
0fc188c
to
bc197e9
Compare
I'll add it as a task |
@@ -0,0 +1,31 @@ | |||
name: LAION retrieval |
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.
Why are different component spcs added?
VALID_PIPELINE / "kubeflow_pipeline.yml", | ||
) as truth: | ||
assert yaml.safe_load(src) == yaml.safe_load(truth) | ||
# @pytest.mark.usefixtures("_freeze_time") |
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.
Can you re-introduce this again?
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.
ahh ok never mind it's because of the new API, would tackle it in another ticket
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.
yes indeed I don't want to keep adding to this PR.
added as a task: #393
description=info["description"], | ||
type=info["type"], | ||
default=info["default"] if "default" in info else None, | ||
args = {} |
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.
A lof of repeated code between input and output arguments, can be one put in one function
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.
Agreed but this will probably be removed once we use the component spec as base for building the arguments and not the KubeflowComponentSpec.
) | ||
|
||
# Set image pull policy to always | ||
component_task.container.set_image_pull_policy("Always") |
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.
might be nice to keep the image pull policy (unless it's another function in v2 in which case we can tackle it separately or create a task for it)
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.
added as a task: #393
@@ -83,7 +83,7 @@ def now(cls): | |||
@pytest.fixture(params=TEST_PIPELINES) | |||
def setup_pipeline(request, tmp_path, monkeypatch): | |||
pipeline = Pipeline( | |||
pipeline_name="test_pipeline", | |||
pipeline_name="testpipeline", |
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.
any special reason for this name change?
src/fondant/component_spec.py
Outdated
"--output_manifest_path", | ||
"{{$.outputs.artifacts['output_manifest_path'].uri}}", | ||
], | ||
"command": ["python3", "main.py"], |
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.
Shouldn't we use here fondant execute main
instead?
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.
ah really ? Where do we do that ? I just took over the way we did it for kfpv1.
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.
We changed while resolving this: #362
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.
See comment above
cdca57b
to
4aaf2ed
Compare
"implementation": { | ||
"container": { | ||
"image": fondant_component.image, | ||
"command": [ |
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.
I think this is the command that you replaced, we're using this now for the components based on this PR https://github.com/ml6team/fondant/commits/main?before=82b5131ac8e72c620917d65c31c80b0b903e4d83+35&branch=main&qualified_name=refs%2Fheads%2Fmain
Can you replace and check if all still runs fine?
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.
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.
updated
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.
Thanks Georges!
No description provided.