Firebase storage artifacts is huge and keeps increasing

后端 未结 2 1366
别那么骄傲
别那么骄傲 2021-01-03 22:57

I\'ve just noticed that my app\'s storage was bumped almost to it\'s 5GB limits of free usage within the last few weeks. After checking it in more details, it appeared that

相关标签:
2条回答
  • 2021-01-03 23:17

    I assume this is related to firestore functions deploys (or not?), but is this really expected?

    Yes, it's expected. Every time you deploy functions, Cloud Build will use a dedicated Cloud Storage space for the built docker image, and retain it until you delete it.

    Can I cleanup this artifacts safely?

    Yes, but then you won't be able to easily revert to a prior image. You would have to deploy again from your own source code.

    0 讨论(0)
  • 2021-01-03 23:24

    Figured out a solution - it appeared there is a way to setup an auto deletion rule in google cloud console for those images that clutter the storage.

    1. go to the google cloud console, select your project -> storage -> browser https://console.cloud.google.com/storage/browser

    2. Select the "artifacts" bucket

    3. Under the "lifecycle" tab add a rule to auto delete old images (in my case I put "delete after 1 day since update" which works fine for me)

    Storage is safe now!

    Hope the firebase team will improve that - the current behavior looks confusing as it easily leads to an unexpected bill unless you take extra steps to prevent that. But you'll never know that it will happen until it does.

    0 讨论(0)
提交回复
热议问题