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

Region for default bucket is always US #206

Open thgsponer opened 10 months ago

thgsponer commented 10 months ago

Hi Mark,

The GCS_DEFAULT_BUCKET is always created in the US region. So, I created it "manually" using gcs_create_bucket with my preferred region. When deploying apps, e.g. plumber app, there is another bucket created, something like artifacts.my-cloudrunner-thing.appspot.com. This is also created in US region. I did not figure out how to change this to my preferred region.

Would it make sense to introduce an environment variable GCS_DEFAULT_REGION, so that all buckets are created my preferred region?

Or do you see another solution?

MarkEdmondson1234 commented 10 months ago

If you use the setup function it does always do it in the US, but you can create it yourself in the EU or region you want and supply that instead. googleCloudStorageR is loaded in the namespace anyway so you don't need to install anything extra.

MarkEdmondson1234 commented 10 months ago

Being able to change the region though would be nice, the code that currently does creates the bucket is here: make_new_bucket <- function(){

thgsponer commented 10 months ago

If you use the setup function it does always do it in the US, but you can create it yourself in the EU or region you want and supply that instead. googleCloudStorageR is loaded in the namespace anyway so you don't need to install anything extra.

Yes, I see. This works for the default bucket.

There is, however, an additional bucket that is generated wich is called something like

artifacts.my-cloudrunner-thing.appspot.com

and it seems not possible to create this manually. Since it looks like website adress GCP somehow wants to check access to this site.

Is this bucket also created with the function you referred above?

MarkEdmondson1234 commented 10 months ago

Ooh I see, that is from the Container Registry, which is actually deprecated in favour of Artifact Registry - it would be nice to directly support that instead. It's where the Docker images are kept.