0
votes

I was inspecting the infrastructure points I have on my Google Cloud to remove any lose points...

Then i noticed that google cloud storage have 5 buckets [even that i just created 2 of them]
these 5 buckets are: 1 - bucket i created
2 - bucket i created
3 - PROJECT.backups
4 - gcf-sources-CODE-us-central1
5 - us.artifacts.PROJECT.appspot.com

I understand that the backups bucket come from firebase realtime database backups and the sources bucket come from the firebase cloud functions code. BUT where does the artifacts bucket comes from? this bucket alone has TWICE the size of all other buckets together.

Its contents are just binary files named like "sha256:HASH" some of which are larger than 200MB

I deleted this bucket and it was re-created [without my interaction] again next day.

Does anyone know what might be using it? how can i track it down? what is it for?

2
Do not delete the artifact buckets (#4 and #5). They are used by Google Cloud services on your behalf such as Cloud Build and Container Registry. - John Hanley
I did delete it and it seemed to keep working normal... 3 days has passed and i still didnt get any error that could come from that. most of my GC is node.js functions (i have about 20 but all very simple and without many imports) so WHY does it get so large? (over 2GB) - Rafael Lima
Read the Google documentation on Container Registry, Artifact Registry, and Cloud Build. In today's world, 2 GB is small. - John Hanley

2 Answers

2
votes

The us.artifacts.<project id>.appspot.com bucket is created and used by Cloud Build to store container images generated by the Cloud Build service. One of the processes that generates objects in this bucket is Cloud Function, and you can realize this because the first time that you create a function, GCP asks you to enable the Cloud Build API and this bucket appears in the Cloud Storage section. App Engine also stores objects in this bucket each time you deploy a new version of an app.

As it is mentioned in the documentation, in the case of App Engine, once the deployment has been completed, the images in the us.artifacts.<project id>.appspot.com bucket are no longer needed, so it is safe to delete them. However, in the case that you are only using Cloud Functions, it is not recommended to delete the objects in this bucket. Although you are not experiencing issues now, there is a possibility that you can experience them in the future, so instead of delete all of the objects manually, you can use the Lifecycle Object Management to delete the objects in this bucket every certain period of time, for instance, every 7 days. You can do it by navigating to the Lifecycle tab of the us.artifacts.<project id>.appspot.com bucket and adding a new lifecycle rule which deletes objects that have the age greater than X days.

0
votes

This is your docker registry. Each time you push (either via docker push or by using the Cloud Build service) GCP stores image layers in those buckets.