Repository navigation
fix: use the job's project, location and credentials in preview PipelineJob submit and rerun - #7240
Open
abhishekacharya200 wants to merge 1 commit into
Conversation
…ineJob submit and rerun The preview _PipelineJob.submit() and rerun() built the request parent and the v1beta1 client from the aiplatform.init() project and location, and created the client without the job's credentials. submit() also dropped create_request_timeout. A job created with its own project, location or credentials was therefore sent to the global project and region with the global credentials. Use the job's parent, location and credentials the way the GA PipelineJob.submit() does, and pass create_request_timeout to create_pipeline_job.
4 of 6 tasks
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fixes #7239
The preview
_PipelineJob.submit()andrerun()built the request parent and the v1beta1 client fromaiplatform.init()instead of the job, and created the client without the job's credentials.submit()also never passedcreate_request_timeouttocreate_pipeline_job. So a job created with its ownproject,locationorcredentialswas sent to the global project and region with the global credentials, while the GAPipelineJob.submit()uses the job's own values.rerun()anddefault_runtimeonly exist on the preview class, so their users always go through this path.This makes both methods use the job's
_parent,locationandcredentials(set by the GAPipelineJob.__init__, falling back toaiplatform.init()when not given), and passescreate_request_timeoutinsubmit(). With no timeout given nothing changes, since the v1beta1create_pipeline_jobdefault timeout isNoneand the GA path already sendstimeout=None.Output of the reproduction from the issue, where only the two RPCs are replaced by recorders, the GA pipeline root bucket check is stubbed, and outgoing socket connections are blocked:
Before (main 9b9f2b3):
After (this branch):
(
rerun()takes no timeout argument, sotimeout=Nonethere is expected.)Tests: added
test_submit_v1beta1_pipeline_job_uses_the_jobs_project_location_and_credentialsandtest_rerun_v1beta1_pipeline_job_uses_the_jobs_project_location_and_credentials. They create the job with a project, location and credentials different fromaiplatform.init()and check the client endpoint, the client credentials and the request parent, plus the timeout forsubmit(). Both fail on main and pass with this change.tests/unit/aiplatform/test_pipeline_jobs.pyandtest_pipeline_job_schedules.pypass locally (262 passed), andflake8==6.1.0andblack==24.8.0report nothing on the changed code (black still flags two older lines in the test file'ssetup_methodthat are the same on main, which I left alone).