I have a 3.8gb usage on my Google Cloud Storage
, and I don't know why , I deleted all my buckets from console (Cloud Storage) but still it has data in it , later on I dinged deeper and fond the following page it has loads of data including Cloud Functions
and strange buckets , any idea how to clean my app on Google Cloud
for those potential junk data that keeps on growing for some reason ?

- 450
- 4
- 11

- 1,804
- 10
- 38
-
Those are the artifacts for your services. Are your running anything in App Engine, Cloud Functions, Cloud Run, etc? – John Hanley Jul 02 '22 at 02:10
-
I run cloud functions in testing..... but how are cloud functions related to storage and if they are , 3.8gb ? is too much.. to me it looks like junk data snowballing somewhere, but I don't want to delete the artifacts I don't want to crash demo production – Richardson Jul 02 '22 at 02:13
-
3My advice, do not delete artifacts unless you know exactly what you are doing. That will crash your services. You blacked out the names, so I cannot see what you have but the one that starts with **gcf-sources** is your Cloud Function source code. Google documents what each bucket is for, research before doing anything. – John Hanley Jul 02 '22 at 02:19
1 Answers
The 3.81 GB usage on your Google Cloud Storage
shown in your Firebase
dashboard is normal because the Cloud Functions
is now integrating the use of Cloud Build
in the deployment process.
Deployments work by uploading an archive containing your function's source code to a Cloud Storage bucket. Once the source code has been uploaded, Cloud Build automatically builds your code into a container image and pushes that image to either Artifact Registry or Container Registry. Cloud Functions uses that image to create the container that executes your function.
With this pipeline, the Artifacts buckets are created automatically in order to store the containerized functions.
As you can see on this thread, it is safe to delete the images stored in your buckets if you desire. This can be achieved by setting lifecycle deletion rules on the artifacts buckets to mitigate additional costs generated by an excess of build images.
Note: As mentioned by @JohnHanley, the bucket that starts with gcf-sources is your Cloud Functions source code. If you delete it, you will not be able to see your source code in the source tab in your functions.
Sample screenshot if the source code in your Functions is deleted in the bucket:

- 450
- 4
- 11