-
Notifications
You must be signed in to change notification settings - Fork 3
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
push: gdrive_service_account_json_file_path must be set for GDRIVE_CREDENTIALS_DATA to work #19
Comments
With the current gdrive remote implementation, for service accounts,
This needs to be more explicit in our docs, but it does say it here:
In addition to clarifying the docs, it would probably be better for us to support a separate env var for passing service account credentials into DVC |
Exactly! Failing to provide the latter would raise the
Surprisingly,
Yes, it would need a bit of clarification. This cursory mention can be easily overlooked by occasional readers. Especially, utilizing user credentials as opposed to service account credentials without any context could be slightly misleading.
As an unwary user, I'd probably expect the same environment variable to serve both purposes. |
In addition to the docs issues, this is the bug:
|
See also #20 |
I might be missing something but I think this is fixed by iterative/dvc#7213 . Could you confirm @0x2b3bfa0 ? |
Description
The
GDRIVE_CREDENTIALS_DATA
environment variable won't be honored unless thegdrive_service_account_json_file_path
configuration option is set beforehand. In most of the habitual use cases, this requirement doesn't make too much sense from the user standpoint.Is this the recommended way of passing Google Drive (Service Account) credentials through an environment variable?
Additionally, after reading the pertaining documentation, I don't understand why I can't use the
GDRIVE_CREDENTIALS_DATA
environment variable to pass the DVC-specific.dvc/tmp/gdrive-user-credentials.json
file contents, instead of having to pass the raw service account file contents.How to reproduce
The following GitHub Actions workflow provides a self-contained example to reproduce this issue. Uncommenting the only line prefixed with a hash
#
will make it work as expected.Note: the
${{ secrets.ORIGINAL_SERVICE_ACCOUNT_JSON }}
variable represents a GCP Service Account file in the standard JSON format provided by Google, not a DVC credentials JSON file.Actual output
Expected output
Environment information
Additional information
https://github.com/iterative/dvc/blob/4e792ae61c5927ab2e5f6a6914d985d43aa705b4/dvc/fs/gdrive.py#L128
https://github.com/iterative/dvc/blob/4e792ae61c5927ab2e5f6a6914d985d43aa705b4/dvc/fs/gdrive.py#L149-L162
See also
The text was updated successfully, but these errors were encountered: