Skip to content

Commit 69d6c7d

Browse files
authored
fix: Fixed getting the output GCS bucket in PipelineJob.submit (#1542)
Thank you for opening a Pull Request! Before submitting your PR, there are a few things you can do to make sure it goes smoothly: - [ ] Make sure to open an issue as a [bug/issue](https://github.com/googleapis/python-aiplatform/issues/new/choose) before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea - [ ] Ensure the tests and linter pass - [ ] Code coverage does not decrease (if any source code was changed) - [ ] Appropriate docs were updated (if necessary) Fixes #<issue_number_goes_here> 🦕
1 parent ca19173 commit 69d6c7d

File tree

1 file changed

+16
-7
lines changed

1 file changed

+16
-7
lines changed

google/cloud/aiplatform/pipeline_jobs.py

+16-7
Original file line numberDiff line numberDiff line change
@@ -343,13 +343,22 @@ def submit(
343343
if network:
344344
self._gca_resource.network = network
345345

346-
gcs_utils.create_gcs_bucket_for_pipeline_artifacts_if_it_does_not_exist(
347-
output_artifacts_gcs_dir=self.pipeline_spec.get("gcsOutputDirectory"),
348-
service_account=self._gca_resource.service_account,
349-
project=self.project,
350-
location=self.location,
351-
credentials=self.credentials,
352-
)
346+
try:
347+
output_artifacts_gcs_dir = (
348+
self._gca_resource.runtime_config.gcs_output_directory
349+
)
350+
assert output_artifacts_gcs_dir
351+
gcs_utils.create_gcs_bucket_for_pipeline_artifacts_if_it_does_not_exist(
352+
output_artifacts_gcs_dir=output_artifacts_gcs_dir,
353+
service_account=self._gca_resource.service_account,
354+
project=self.project,
355+
location=self.location,
356+
credentials=self.credentials,
357+
)
358+
except: # noqa: E722
359+
_LOGGER._logger.exception(
360+
"Error when trying to get or create a GCS bucket for the pipeline output artifacts"
361+
)
353362

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

0 commit comments

Comments
 (0)