Skip to content

Fix _load_repository_from_gcs #76

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
merged 4 commits into from
Aug 7, 2024
Merged

Fix _load_repository_from_gcs #76

merged 4 commits into from
Aug 7, 2024

Conversation

alvarobartt
Copy link
Member

Description

This PR fixes the _load_repository_from_gcs method, as there was an issue with the join call over a pathlib.Path object, so the pathlib.Path cast was missing on the file_split[0::-1] variable; as well as joining the target_dir within the local file path were the artifacts were being downloaded to.

From now on, in order to download and use artifacts from Google Cloud Storage, one will need to set the AIP_STORAGE_URI environment variable (automatically exposed by Vertex AI when deploying from a bucket).

Thanks Genquan Duan and Changyu Zhu from Google for the report! 🤗

The issue was with the `join` call over a `pathlib.Path` object, so the
`pathlib.Path` cast was missing on the `file_split[0::-1]` variable
@alvarobartt alvarobartt added the bug Something isn't working label Aug 5, 2024
@alvarobartt alvarobartt requested a review from philschmid August 5, 2024 09:49
@alvarobartt alvarobartt self-assigned this Aug 5, 2024
alvarobartt added a commit that referenced this pull request Aug 5, 2024
Ideally the `pip install` command shouldn't be required as it's
installed already within the `integration-test-pytorch:gpu` image, but
if adding it, to ensure consistency we should also include the recently
included `google` extra that comes with `google-cloud-storage`;
otherwise the tests within
#76
will fail
@alvarobartt alvarobartt merged commit 58b760f into main Aug 7, 2024
1 of 6 checks passed
@alvarobartt alvarobartt deleted the fix-artifact-download branch August 7, 2024 08:23
alvarobartt added a commit that referenced this pull request Aug 7, 2024
* Fix formatting in `setup.py`

* Add missing trove classifiers

* Add missing description

* Add missing `google-cloud-storage` as `google` extra

* Update `Dockerfile` indent size and `google-cloud-storage` installation

- Align indent size with `apt-get install` even if those are just args
- Align flag usage notation from `-U` to `--upgrade` i.e. using full
name instead of shortened one for readability
- Install `google-cloud-storage` from `google` extra instead (`google`
extra was included recently as otherwise the installations from the
wheel not relying on this Dockerfile would fail with an ImportError on
`google-cloud-storage` when either deploying from Vertex AI or setting
the `AIP_STORAGE_URI` env var)

* Add newline at the end of `setup.cfg`

* Update `.github/workflows/unit-test.yaml` to install `google` extras too

Ideally the `pip install` command shouldn't be required as it's
installed already within the `integration-test-pytorch:gpu` image, but
if adding it, to ensure consistency we should also include the recently
included `google` extra that comes with `google-cloud-storage`;
otherwise the tests within
#76
will fail
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working google
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants