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

Enable minimal functionality of private worker pools with Cloud Build & Cloud Scheduler #211

Open joranE opened 7 months ago

joranE commented 7 months ago

This is an extremely minimal first pass. My aim here was to make creating & scheduling a build work when the yaml specifies a private worker pool by setting the option

pool:
  name: projects/{projects}/locations/{location}/workerPools/{worker-name}

The general strategy I took was to create a helper function that tests whether the build yaml has set the above option, and then create the API uri differently in that case. I've verified that a basic workflow using cr_build(), cr_schedule_http() & cr_schedule() work with private worker pools with these changes. I couldn't run the tests, even with no changes, tons of stuff was failing right out of the gate, so I'm not 100% sure of how much other stuff I might have broken with these changes.

If you think this is a decent approach I'll try manually testing other parts of the package to see if there are other places similar adjustments may be needed to handle private worker pools.