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

feat: added namespace as cache scope #6342

Merged

Conversation

capri-xiyue
Copy link
Contributor

part of #6324
Description of your changes:
added namespace as cache scope
Checklist:

@google-cla google-cla bot added the cla: yes label Aug 13, 2021
@capri-xiyue capri-xiyue changed the title added namespace as cache scope feat: added namespace as cache scope Aug 13, 2021
Comment on lines 44 to 46
if task.GetNamespace() == "" {
return errMustSpecify("Namespace")
}
Copy link
Contributor

Choose a reason for hiding this comment

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

this PR will require a coordinated release with SDK, because 1.7.0 SDK launchers will no longer work.

I think we can go with this too, but it might be slightly better to keep namespace as optional, because usually people will not expect 1.7.1 SDK works with the backend, but 1.7.0 SDK doesn't. We can change it to be required after SDK 1.8.0

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Why it won't work with sdk? Launcher is the only caller of such apis.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 47 to 51
if strings.HasPrefix(task.GetPipelineName(), "namespace/") {
s := strings.Split(task.GetPipelineName(), "/")
if len(s) != 4 {
return util.NewInvalidInputError("invalid PipelineName for namespaced pipelines, need to follow 'namespace/${namespace}/pipeline/${pipelineName}': %s", task.GetPipelineName())
}
Copy link
Contributor

Choose a reason for hiding this comment

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

note, we don't have any restrictions on pipeline name so far, so it may contain "/".
Recommend using https://pkg.go.dev/strings#SplitN instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done

Comment on lines 109 to 118
if strings.HasPrefix(o.PipelineName, "namespace/") {
s := strings.Split(o.PipelineName, "/")
if len(s) != 4 {
return fmt.Errorf("invalid PipelineName options for namespaced pipelines, need to follow 'namespace/${namespace}/pipeline/${pipelineName}': %s", o.PipelineName)
}
namespace := s[1]
if namespace != o.Namespace {
return fmt.Errorf("the namespace %s extracted from pipelineName is not equal to the namespace %s in launcher options", namespace, o.Namespace)
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

For discussion: is it helpful adding the validation in launcher? I feel like launcher can just be unaware of the pipeline name format, if there's a problem. It'll be reported at task server.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Info like "PipelineName" and "Namespace" will get recorded in MLMD when cache is not enabled. I think launcher should also be aware of the validation.

@Bobgy Bobgy mentioned this pull request Aug 17, 2021
23 tasks
Copy link
Contributor

@Bobgy Bobgy left a comment

Choose a reason for hiding this comment

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

/lgtm
/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
Copy link
Contributor

Bobgy commented Aug 17, 2021

/retest

@google-oss-robot google-oss-robot merged commit 2639ba0 into kubeflow:master Aug 17, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants