MarkEdmondson1234 / googleCloudRunner

Easy R scripts on Google Cloud Platform via Cloud Run, Cloud Build and Cloud Scheduler
https://code.markedmondson.me/googleCloudRunner/
Other
80 stars 25 forks source link

minor documentation requests #188

Open wlandau opened 2 years ago

wlandau commented 2 years ago

I am setting up a second GCP account (another 90-day free trial) and I ran into some setup snags.

> cr_setup_test()
ℹ Perform deployments to test your setup is working. Takes around 5mins.  ESC or 0 to skip.
✓ Successfully auto-authenticated via /home/landau/.gcp/CENSORED.json
✓ Validated authentication in GCE_AUTH_FILE
Select which deployments to test 

1: All tests
2: Cloud Build - Docker
3: Cloud Run - plumber API with Pub/Sub
4: Cloud Build - R script
5: Cloud Scheduler - R script

Selection: 5

── Testing scheduling R script deployments via cr_deploy_r(schedule = '* * * * *') ──

ℹ 2022-03-15 12:55:28 > Deploy R script cr_rscript_CENSORED to Cloud Build
ℹ 2022-03-15 12:55:28 > Scheduling R script on cron schedule: * * * * *
ℹ 2022-03-15 12:55:28 > Creating PubSub topic: cr_rscript_CENSORED-topic
✓ projects/CENSORED/topics/cr_rscript_CENSORED-topic succesfully created
ℹ 2022-03-15 12:55:31 > Request Status Code:  403
Error: http_403 User not authorized to perform this action.
MarkEdmondson1234 commented 2 years ago

Thanks! These startup bumps are my priority for smoothing out. It sounds like I forgot to put the new googlePubsubR integration scopes in the setup script.

wlandau commented 2 years ago

Thanks so much Mark! You have already done a lot to make this process easier for new users, and the video and cr_setup() are super helpful.

Would it also be possible to mention GCS_AUTH_FILE somewhere? I believe the setup docs refer to GCE_AUTH_FILE instead.

MarkEdmondson1234 commented 2 years ago

The GCS_AUTH_FILE is only googleCloudStorageR specific, when using Cloud Storage with googleCloudRunner it uses the GCE_AUTH_FILE as that contains auth for all the related services (Cloud Run, Storage, Cloud Build etc)

wlandau commented 2 years ago

So these environment variables are different for security reasons (bare minimum permissions)?

MarkEdmondson1234 commented 2 years ago

That was the thinking, although wasn't followed for googleCloudRunner that reused googleComputeEngineR's GCE_AUTH_FILE, potentially a CR_AUTH_FILE would be more consistent but with the recent Google auth changes in general I would like to use the more agnostic application defaults, supported by gargle, that reuse what gcloud and other SDKs look at.