Skip to content

Commit

Permalink
fix: Fixed getting the output GCS bucket in PipelineJob.submit (#1542)
Browse files Browse the repository at this point in the history
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> 🦕
  • Loading branch information
Ark-kun authored Jul 27, 2022
1 parent ca19173 commit 69d6c7d
Showing 1 changed file with 16 additions and 7 deletions.
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

0 comments on commit 69d6c7d

Please sign in to comment.