-
Notifications
You must be signed in to change notification settings - Fork 958
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add the ability to remove the Functions container cache from Artifact Registry using the CLI #7913
Comments
Hi @fuelkoy thanks for opening a new issue. So creating a new command or even just adding a flag to an existing command is actually much more complicated than you'd think since every public surface needs to go through an internal review process. I understand that your workflow would greatly benefit from a firebase built solution, so I'm going to mark this as a feature request. Hopefully others can chime in and +1 this so that we can prioritize this work. But as a stop gap solution for your automation, you should be able to make a call to this API using the path |
@colerogers Thank you for the information. Could you help me little bit futher with this stop gap please? I created a script to delete the artifacts as required. Now i made this only for one function. It successfully deletes the package item but not the cache. It outputs The script:
|
Also, which one do I need to delete? There seem to be 2 caches associated with the function, as shown below (with example project names). The naming also seems to follow some weird convention. My function name in this case is just the exampleProjectName__europe--north1__trpc |
It appears that simply deleting the function's artifact is sufficient, and there is no need to clear the cache for a successful installation and build. |
[REQUIRED] Environment info
firebase-tools: 13.23.1
Platform: win64
[REQUIRED] Test case
Minimum repo: https://github.com/TrustyTechSG/firebase-function-issue
[REQUIRED] Steps to reproduce
[REQUIRED] Expected behavior
The function should work after redeploy.
[REQUIRED] Actual behavior
The function stopped working after redeploy.
Comment
This is a copy of #6412. The solution(#6412 (comment)) provided by @colerogers does not work if multiple functions are deployed as seemly then cache is not created again even tho it does not exists. And then this shows no
npm install
was run > same Could not find Chrome error happens. Also the second solution(#6412 (comment)) provided is not goodI wrote a description there why the provided solution is not good. I will copy the text here to help the reading.
"I think this should be reconsidered to be implemented another way. Deleting a production environment function before deleting the artifacts would resolve to the API endpoint being down in a production environment. This would lead to service not being available for the users. If this would happen every time a function (with puppeteer or similar kind of package) would need to be updated, the service would be unavailable always for a period of time.
Problems:
4. Deleting the cache does not ensurenpm install
is run when deploying multiple functions.My suggestion:
As you mentioned, you can navigate to the Artifact registry and there find your function cache and delete it with no problems, and then deploy the function buildpacks by running
npm install
. Then the function works as expected. This solution should be made more straightforward and integrated into the standard workflow. To address this, I propose adding a --no-function-cache flag to the firebase deploy command which would delete the cache for the deployed functions. This would solve all previously mentioned issues. "The text was updated successfully, but these errors were encountered: