quadratic-funding / mpc-phase2-suite

The MPC suite of tools for conducting zkSNARK Phase 2 Trusted Setup ceremonies
MIT License
16 stars 6 forks source link

build: fix deployment failure by grouping Cloud Functions #358

Open baumstern opened 1 year ago

baumstern commented 1 year ago

This PR fixes recent deployment failure:

2023-03-21T14:30:51.5403764Z ✔  functions[checkAndRemoveBlockingContributor(us-central1)] Successful update operation.
2023-03-21T14:31:01.3564096Z ✔  functions[setupCeremony(us-central1)] Successful update operation.
2023-03-21T14:31:31.3642507Z Could not create or update Cloud Run service projects/p0tion-ci-environment/locations/us-central1/services/verifycontribution. Could not get Cloud Run service projects/p0tion-ci-environment/locations/us-central1/services/verifycontribution. Deadline Exceeded.
2023-03-21T14:31:31.3668535Z 
2023-03-21T14:31:31.3669338Z Functions deploy had errors with the following functions:
2023-03-21T14:31:31.3670661Z    verifycontribution(us-central1)
2023-03-21T14:31:31.3676097Z i  functions: cleaning up build files...
2023-03-21T14:31:31.6669113Z ⚠  functions: Unhandled error cleaning up build images. This could result in a small monthly bill if not corrected. You can attempt to delete these images by redeploying or you can delete them manually at https://console.cloud.google.com/artifacts/docker/p0tion-ci-environment/us-central1/gcf-artifacts
2023-03-21T14:31:31.6679040Z 
2023-03-21T14:31:31.6681557Z Error: There was an error deploying functions

https://github.com/quadratic-funding/mpc-phase2-suite/actions/runs/4480173141/jobs/7875177633

Firebase team recommends to group functions under size 10:

Important: To avoid running to quota errors and other server errors, limit function group size to 10 or fewer for each deployment operation. source: https://firebase.google.com/docs/cli#deploy_specific_functions

Fixes: https://github.com/quadratic-funding/mpc-phase2-suite/issues/194

0xjei commented 1 year ago

@gurrpi Is there anything blocking the cloud function verifycontribution from deploying?

baumstern commented 1 year ago

@gurrpi Is there anything blocking the cloud function verifycontribution from deploying?

I guess Deadline Exceeded. of the following log indicates it reached quota limit of GCP:

2023-03-21T14:31:31.3642507Z Could not create or update Cloud Run service projects/p0tion-ci-environment/locations/us-central1/services/verifycontribution. Could not get Cloud Run service projects/p0tion-ci-environment/locations/us-central1/services/verifycontribution. Deadline Exceeded.

So I think fix of quota limit would be as followings:

Firebase team recommends to group functions under size 10:

Important: To avoid running to quota errors and other server errors, limit function group size to 10 or fewer for each deployment operation. source: https://firebase.google.com/docs/cli#deploy_specific_functions

Also we discussed that in https://github.com/quadratic-funding/mpc-phase2-suite/issues/194