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(google client): Enable to specify the service account to proxy function of scheduler in google client sdk #6013

Conversation

toshitanian
Copy link
Contributor

@toshitanian toshitanian commented Jul 11, 2021

Description of your changes:

When AI platform SDK creates a scheduled job, it makes a Cloud scheduler job and a cloud function to proxy from scheduler job to AI platform endpoint. Now the service account of the function is fixed to the service account of App Engine default. So the function fails to call AI platform endpoint when it does not have appropriate permission.
In this pull request, we'll be able to attach a individual service account to the function that should have access to call the AI Platform endpoint. If the parameter is not specified, the SDK does not give the parameter to cloud functions API and the default service account will be used by default.

Checklist:

@google-oss-robot
Copy link

Hi @toshitanian. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@toshitanian
Copy link
Contributor Author

/assign @ji-yaqi

@toshitanian
Copy link
Contributor Author

@ji-yaqi Hi, how this looks like? we are planning to use this SDK. So i’m really appreciate if you could take a look!
Thanks you

@toshitanian toshitanian force-pushed the google_client_specify_sa_to_proxy_function_of_scheduler branch from dc344a9 to bdd5955 Compare August 16, 2021 12:43
@toshitanian
Copy link
Contributor Author

@ji-yaqi
Hi, I fixed the code to apply the laster master branch.
Could you check this pull request? This will give us more fine-grained permission control.

@@ -368,6 +368,7 @@ def create_schedule_from_job_spec(
service_account: Optional[str] = None,
enable_caching: Optional[bool] = None,
app_engine_region: Optional[str] = None,
service_account_for_schedule: Optional[str] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we update the name to cloud_scheduler_service_account to better reflect the name? Otherwise LGTM, thanks!

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ji-yaqi Thanks for the feedback! Renamed in 77c18d7 👍

@@ -0,0 +1 @@
3.7.6
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for the change! One more nit, what is this file for?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, sorry. That's the file of my environment. Will remove...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@ji-yaqi Removed and force pushed the latest commit!

@toshitanian toshitanian force-pushed the google_client_specify_sa_to_proxy_function_of_scheduler branch from 77c18d7 to 87dd886 Compare August 18, 2021 03:56
@ji-yaqi
Copy link
Contributor

ji-yaqi commented Aug 18, 2021

/lgtm
/approve
Thank you for the change! @toshitanian

@google-oss-robot
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ji-yaqi

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

@google-oss-robot google-oss-robot merged commit d40985c into kubeflow:master Aug 18, 2021
@toshitanian
Copy link
Contributor Author

Thanks!

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