firebase / firebase-tools

The Firebase Command Line Tools
MIT License
4.02k stars 937 forks source link

Allow keeping cloud function image artifacts #4932

Open dannnnthemannnn opened 2 years ago

dannnnthemannnn commented 2 years ago

I am trying to redeploy my cloud function v2 with a slightly different configuration. My goal is to enable CPU allocation at all times rather than not having CPU allocated when the function is not processing requests. As it stands now, my spanner connection is being killed while CPU is not allocated between requests. I have min instances > 1 to avoid cold starts.

I cant update the cloud run service to enable CPU allocation because the build artifiact is not present any longer, so when I try to redeploy with updated settings, it fails to redeploy.

https://cloud.google.com/run/docs/configuring/cpu-allocation

Please submit feature requests through our support page.

taeold commented 2 years ago

This is a great feature request. Our teammate suggested this might be a new flag in firebase.json:

"functions": {
  "artifactHistoryLength": 2
}

This will have to go through our API review process, but if anyone is interested in contributing let me know. When someone in our team begins working on this FR, I'll share an update here.

davidstackio commented 2 months ago

Any update on this? I'd also like to be able to set my Cloud Run function CPU allocation to: "CPU is always allocated".