简体   繁体   中英

Bucket of Staging files after deploying an app engine

After deploying a google app engine, at least 4 buckets are created in the google cloud storage:

  • [project-id].appspot.com
  • staging.[project-id].appspot.com
  • artifacts.[project-id].appspot.com
  • vm-containers.[project-id].appspot.com

What are they, and will they incur storage cost? Can they be safely deleted?

Staging buckets are described in the App Engine's documentation when Setting Up Google Cloud Storage .

I am quoting relevant information here for future viewers:

Note: When you create a default bucket, you also get a staging bucket with the same name except that staging. is prepended to it. You can use this staging bucket for temporary files used for staging and test purposes; it also has a 5 GB limit, but it is automatically emptied on a weekly basis.

So in essence, when you create either an app Engine Standard or Flexible, you get these two buckets. You can delete the buckets (I deleted the staging one) and I was able to recover it by running gcloud beta app repair .

I believe the "artifacts" bucket is what they're referring to here . A key point is the following:

Once deployment is complete, App Engine no longer needs the container images. Note that they are not automatically deleted, so to avoid reaching your storage quota, you can safely delete any images you don't need.

I discovered this after (to my great surprise) Google started charging me money every month. I saw that the "artifacts" bucket had a directory named "images". (I naively thought that it had something to do with graphics or photographs, which was quite mysterious as my app doesn't do anything with graphics.)

They are not mandatory for a GAE app - one has to explicitly enable GCS for a GAE app for some of these to be created.

At least a while back only the 1st 2 were created by default (for a standard environment python app) when GCS was enabled and they are by default empty.

It is possible that the others are created by default as well these days, I'm not sure. But they could also be created by and used for something specific you're doing in/for your app - only you can tell that.

You can check what's in them via the Storage menu in the developer console. That might give a hint as for their usage. For my apps which have such buckets created - they're empty.

From Default Google Cloud Storage bucket :

Applications can use a Default Google Cloud Storage bucket, which has free quota and doesn't require billing to be enabled for the app. You create this free default bucket in the Google Cloud Platform Console App Engine settings page for your project.

The free quota is 5 GB, so as long as you don't reach that you're OK.

Now there is a matter of one bucket mentioned in the docs vs the multiple ones actually seen - debatable, I'm not sure what to suggest.

In short - I'd check the content of these directories. If they're not empty I'd check the estimated costs for any indication that the free 5 GB quota might not be applicable for them. If that's the case I'd investigate the actual usage and decide if to delete something or not.

Otherwise I'd just leave them be.

An update on what staging is for (at least in Python GAE Standard):

https://cloud.google.com/appengine/docs/standard/python3/using-cloud-storage

App Engine also creates a bucket that it uses for temporary storage when it deploys new versions of your app. This bucket, named staging.project-id.appspot.com, is for use by App Engine only. Apps can't interact with this bucket.

Still can't figure out what artifacts is for.

artifacts.[project-id].appspot.com These files in the bucket are created by the google container registry.

WARNING: Deleting them will cause you to lose access to your container registry.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM