Skip to content

fix: Fixed getting the output GCS bucket in PipelineJob.submit #1542

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

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 16 additions & 7 deletions google/cloud/aiplatform/pipeline_jobs.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,13 +343,22 @@ def submit(
if network:
self._gca_resource.network = network

gcs_utils.create_gcs_bucket_for_pipeline_artifacts_if_it_does_not_exist(
output_artifacts_gcs_dir=self.pipeline_spec.get("gcsOutputDirectory"),
service_account=self._gca_resource.service_account,
project=self.project,
location=self.location,
credentials=self.credentials,
)
try:
output_artifacts_gcs_dir = (
self._gca_resource.runtime_config.gcs_output_directory
)
assert output_artifacts_gcs_dir
gcs_utils.create_gcs_bucket_for_pipeline_artifacts_if_it_does_not_exist(
output_artifacts_gcs_dir=output_artifacts_gcs_dir,
service_account=self._gca_resource.service_account,
project=self.project,
location=self.location,
credentials=self.credentials,
)
except: # noqa: E722
_LOGGER._logger.exception(
"Error when trying to get or create a GCS bucket for the pipeline output artifacts"
)

# Prevents logs from being supressed on TFX pipelines
if self._gca_resource.pipeline_spec.get("sdkVersion", "").startswith("tfx"):
Expand Down