Skip to content
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

chore(v2): standardize MLMD data model. Fixes #5669 #6054

Merged
merged 17 commits into from
Jul 20, 2021

Conversation

Bobgy
Copy link
Contributor

@Bobgy Bobgy commented Jul 15, 2021

Description of your changes:
Fixes #5669
Fixes #5985
Fixes #5986

Checklist:

@neuromage
Copy link
Contributor

/retest

"--run_id",
"$(KFP_RUN_ID)",
"--run_resource",
"workflows.argoproj.io/$(WORKFLOW_NAME)",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need this workflows.argoproj.io/ here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's meant to make the field vendor-neutral, it can also be a tekton pipeline with KFP-tekton

@@ -275,16 +281,21 @@ func (l *Launcher) executeWithoutCacheEnabled(ctx context.Context, executorInput
cmd := l.cmdArgs[0]
args := make([]string, len(l.cmdArgs)-1)
_ = copy(args, l.cmdArgs[1:])
pipeline, err := l.metadataClient.GetPipeline(ctx, l.options.PipelineName, l.options.PipelineRunID)
pipeline, err := l.metadataClient.GetPipeline(ctx, l.options.PipelineName, l.options.RunID, l.options.Namespace, l.options.RunResource)
Copy link
Contributor

@capri-xiyue capri-xiyue Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it more clear if we pass l.options as the parameter?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I intentionally did not do so, because metadata package is a low level package. It will be reused by both v2 compatible launcher and v2 driver/publisher.

It should not use a type defined in launcher package.

@@ -310,16 +321,22 @@ func (l *Launcher) executeWithCacheEnabled(ctx context.Context, executorInput *p
return fmt.Errorf("failure while getting executionCache: %w", err)
}

pipeline, err := l.metadataClient.GetPipeline(ctx, l.options.PipelineName, l.options.PipelineRunID)
pipeline, err := l.metadataClient.GetPipeline(ctx, l.options.PipelineName, l.options.RunID, l.options.Namespace, l.options.RunResource)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same here, is it more clear if we pass l.options as the parameter?

"namespace": stringValue(namespace),
"resource_name": stringValue(runResource),
}
pipelineRunContext, err := getOrInsertContext(ctx, c.svc, pipelineRunID, pipelineRunContextType, runMetadata)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we change the value of "pipelineRunID" here, from workflow id to the uuid of the pipelineRun, will user still be able to get info of the previous tasks(which stores the workflow id in MLMD) via UI?

Copy link
Contributor Author

@Bobgy Bobgy Jul 15, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! This is a breaking change. No, they won't.

This is under the assumption that v2 compatible doesn't have many users, we kept saying it's experimental and we can make breaking changes.

@@ -222,6 +223,20 @@ def _create_run():
fire.Fire(main)


def simplify_proto_struct(data: dict) -> dict:
res = {}
for key, value in data.items():
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we have intValue here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure, we can add one when we have a sample

@@ -84,9 +84,9 @@ func Test_GetPipeline(t *testing.T) {
mlmdClient, err := NewTestMlmdClient()
fatalIf(err)

_, err = client.GetPipeline(ctx, "get-pipeline-test", runId)
_, err = client.GetPipeline(ctx, "get-pipeline-test", runId, "kubeflow", "workflows.argoproj.io/hello-world-abcd")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to write "kubeflow" and "workflows.argoproj.io" as constants?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My gut feeling is we don't need to, because these values can be arbitrary in tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rethinking over this, I think you are right, if I set up default values, they help reduce information noise in each test.

@Bobgy
Copy link
Contributor Author

Bobgy commented Jul 20, 2021

/approve

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Bobgy

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Bobgy Bobgy added the lgtm label Jul 20, 2021
@google-oss-robot google-oss-robot merged commit ee663d9 into kubeflow:master Jul 20, 2021
@Bobgy Bobgy deleted the mlmd-std-2 branch July 20, 2021 07:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants