0

I have a Firebase project with 55 Functions. I sometimes got a deployment error saying that I hit the quota limit for Build Create requests per minute (the quota right now is 60) with the simplest deployment command,

firebase deploy --only functions

And the CLI suggested me to deploy the remaining again using a command like this,

firebase deploy --only functions:functionA,functions:functionB

As it is a per minute quota, I was expecting the CLI to workaround the quota seamlessly. But it's not.

I sent an email to Firebase Support and they advised me to always use only 75% of the quota at one time when trying to deploy functions, but I wonder how everyone workarounds this quota issue ?

I read about organizing functions in groups in the documentation and deploy group-by-group, but I wonder if there is other solutions ?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Michael
  • 173
  • 1
  • 2
  • 6
  • Are you facing the problem using `--only functions` flag as well or you just do not want to use it? What is wrong with this group-by-group deploy? – vitooh Oct 06 '20 at 09:17
  • @vitooh I'm just wondering if there is a better solution. I think I could split into two groups according to the business logics, but if I need to keep adding new features, there might be chances that I hit the quota again. So I was thinking if there is a solution that will deal with this issue in a better way. – Michael Oct 08 '20 at 03:43
  • Are you keeping all the functions in one file? Is it JS or TS? – vitooh Oct 08 '20 at 07:56
  • @vitooh I split all the functions in separate files. It's JS now. I did something similar to this issue, https://stackoverflow.com/questions/42726870/firebase-cloud-functions-is-very-slow. – Michael Oct 09 '20 at 10:41
  • Did you ever find a solution @Michael. I'm running into the problem with only 44 functions and I'll really like to avoid having to worry about dependencies between two deploy commands. – kezor Dec 17 '20 at 03:04
  • I have the very same issue too. Do you have any update / new knowledge on this one? – Hunor Oct 11 '21 at 09:56
  • 1
    @kezor I've just realized your comments. The way that I did is to deploy functions batch-by-batch, like a few to 10s of functions, so this issue seems not to be coming up. But I feel like it's kinda workaround instead of a fix. Still hoping there is a better solution tho. – Michael Apr 16 '22 at 04:41
  • @Hunor Like I wrote above, got a workaround instead of a fix :( – Michael Apr 16 '22 at 04:41

1 Answers1

0

Well I think that you can use Cloud Build. BTW not sure if you know, that all your Firebase projects and functions are available in GCP as well. You can change and deploy them directly in GCP Console (direct link).

In Cloud Build there is functionality that lets you to deploy to Firebase with convenient configuration file in yaml or json.

The configuration file contain steps of your deploy and you can setup a timeout between them (reference). So, you can create those steps with --only flag with control of time and you can use it created file many times and just adjust it when you add new function.

I think this will help you to avoid hitting quota limits, and I suppose you can use other features of Cloud Build as well.

vitooh
  • 4,132
  • 1
  • 5
  • 16