Skip to content

fix: use the job's project, location and credentials in preview PipelineJob submit and rerun - #7240

Open
abhishekacharya200 wants to merge 1 commit into
googleapis:mainfrom
abhishekacharya200:fix/preview-pipeline-job-project-location
Open

abhishekacharya200 wants to merge 1 commit into
googleapis:mainfrom
abhishekacharya200:fix/preview-pipeline-job-project-location

Conversation

@abhishekacharya200

Copy link
Copy Markdown

Fixes #7239

The preview _PipelineJob.submit() and rerun() built the request parent and the v1beta1 client from aiplatform.init() instead of the job, and created the client without the job's credentials. submit() also never passed create_request_timeout to create_pipeline_job. So a job created with its own project, location or credentials was sent to the global project and region with the global credentials, while the GA PipelineJob.submit() uses the job's own values. rerun() and default_runtime only exist on the preview class, so their users always go through this path.

This makes both methods use the job's _parent, location and credentials (set by the GA PipelineJob.__init__, falling back to aiplatform.init() when not given), and passes create_request_timeout in submit(). With no timeout given nothing changes, since the v1beta1 create_pipeline_job default timeout is None and the GA path already sends timeout=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):

GA PipelineJob.submit(create_request_timeout=30):
  create: endpoint=europe-west4-aiplatform.googleapis.com:443 parent=projects/job-project/locations/europe-west4 timeout=30 credentials=job
preview _PipelineJob.submit(create_request_timeout=30):
  create: endpoint=us-central1-aiplatform.googleapis.com:443 parent=projects/global-project/locations/us-central1 timeout=None credentials=global
preview _PipelineJob.rerun(...):
  get:    endpoint=us-central1-aiplatform.googleapis.com:443 credentials=global
  create: endpoint=us-central1-aiplatform.googleapis.com:443 parent=projects/global-project/locations/us-central1 timeout=None credentials=global

After (this branch):

GA PipelineJob.submit(create_request_timeout=30):
  create: endpoint=europe-west4-aiplatform.googleapis.com:443 parent=projects/job-project/locations/europe-west4 timeout=30 credentials=job
preview _PipelineJob.submit(create_request_timeout=30):
  create: endpoint=europe-west4-aiplatform.googleapis.com:443 parent=projects/job-project/locations/europe-west4 timeout=30 credentials=job
preview _PipelineJob.rerun(...):
  get:    endpoint=europe-west4-aiplatform.googleapis.com:443 credentials=job
  create: endpoint=europe-west4-aiplatform.googleapis.com:443 parent=projects/job-project/locations/europe-west4 timeout=None credentials=job

(rerun() takes no timeout argument, so timeout=None there is expected.)

Tests: added test_submit_v1beta1_pipeline_job_uses_the_jobs_project_location_and_credentials and test_rerun_v1beta1_pipeline_job_uses_the_jobs_project_location_and_credentials. They create the job with a project, location and credentials different from aiplatform.init() and check the client endpoint, the client credentials and the request parent, plus the timeout for submit(). Both fail on main and pass with this change. tests/unit/aiplatform/test_pipeline_jobs.py and test_pipeline_job_schedules.py pass locally (262 passed), and flake8==6.1.0 and black==24.8.0 report nothing on the changed code (black still flags two older lines in the test file's setup_method that are the same on main, which I left alone).

…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.
@abhishekacharya200
abhishekacharya200 requested a review from a team as a code owner October 22, 2026 10:12
@product-auto-label product-auto-label Bot added size: m Pull request size is medium. api: vertex-ai Issues related to the googleapis/python-aiplatform API. labels Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: vertex-ai Issues related to the googleapis/python-aiplatform API. size: m Pull request size is medium.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Preview PipelineJob submit() and rerun() ignore the job's project, location, credentials and create_request_timeout

1 participant