Bucket of Staging files after deploying an app eng

2020-06-12 04:08发布

问题:

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?

回答1:

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.



回答2:

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.



回答3:

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.