0
votes

Google App Engine is stopping Python 2 support in half month. Already a week ago deployment through appcfg.py was denied (server responds with error and rolls back deployment) (Update thanks, solution found).

Python 2 environment as I far as I know was the only way for truly free (up to daily quota) running of App Engine. It didn't need even enabling billing (and providing credit card).

For Python 3 there is a standard environment which can be run for free as Google says, but when I tried to deploy it I was asked to enable Cloud Build, which in turn has free daily quota but needs enabling billing with providing credit card. Also I expect that standard environment has other features with free quota but compulsory billing enabled.

The drawback of billing enabled is that you don't get guarantee that you're not charged any money. If you have over-quota you'll be charged. Is there any easy method of forcing not to charge even 1 cent in monthly bills? There are some manual quota limiting methods, but need going through dozens of resources in each single small app-service and manually setting the limit, also with these methods you still may be charged small amount.

Are there easy current methods for having totally free applications with google-app-engine?

Also are there any other totally free (up to quota) popular platforms for running Python web applications? Same like app-engine.

3
App Engine is not stopping Python 2 support in a half month, see cloud.google.com/appengine/docs/standard/… and cloud.google.com/python/docs/python2-sunsetDustin Ingram
@DustinIngram I'm saying about stopping based on my deployment experience. For Python 2 the only way to deploy apps was using tool appcfg.py, not only deployment but everything was done using it (including running local deployment server). But a week ago when deploying Google started to respond with message that appcfg.py is not supported anymore, and deployment finishes with error and rolls back, so there is no way to deploy Python 2, I think that is enough to say that Python 2 is not supported anymore.Arty
Maybe Google moved away from appcfg.py to gcloud deployment for Python 2. I tried gcloud tool to deploy and it complains that it needs to enable billing for deployment, for Cloud Build support. Before that appcfg.py and Python 2 instances were totally free, not even billing enabling was needed. Now if they continue with Python 2 they requiring compulsory billing enabled, which wasn't needed before. Maybe this is the case, I don't know. Also maybe they started to charge money for Python 2 when over quota, before they were just stopping serving until end of the day.Arty

3 Answers

4
votes

While I cannot know what your data usage will be (you can be charged for reads, writes, and storage, if they exceed the quota), there is a way to avoid being charged for instances, which is where most exceed the quota. Make sure you set up your app.yaml to stay within the free tier:

runtime: python38
instance_class: F1 
automatic_scaling:  
  max_instances: 1

The F1 will give you 28 instance hours per day, which is more than 24. max-instances will avoid spinning up new instances.

More at: https://cloud.google.com/appengine/docs/standard/python/config/appref#scaling_elements

Also, you can go to:

https://console.cloud.google.com/billing/, then go to your billing account's "Budgets and alerts" section (icon in left pane), and set a budget to $0. You may have to set the budget to a positive number to get the alerts to trigger at a % of that number (eg: 10% of $0.01). Per the docs:

Tip: Setting a budget does not automatically cap Google Cloud or Google Maps Platform usage/spending. Budgets trigger alerts to inform you of how your usage costs are trending over time. Budget alert emails might prompt you to take action to control your costs, but do not automatically prevent the use or billing of your services when the budget amount or threshold rules are met or exceeded.

You may have to set up a pub/sub or similar to receive the notification and shut down the app.

2
votes

when appcfg deploy fails with error, the code is deployed, but the deployed version is not serving. you can follow deploy with set version to make it serving. use these 2 commands to deploy without billing account. 2nd one fixes the part that 1st one failed.

appcfg.py update app.yaml

appcfg.py set_default_version .

1
votes

As is mentioned at the official documentation:

Google asks for a credit card or other payment method when you sign up for the Free Trial. Google uses this payment information for the following purposes:

  • To verify your identity.
  • To distinguish actual people from robots.

On the other hand, if you want to keep the free tier you need to meet the following criteria:

  • You do not have a custom contract or rate card with Google.
  • You are actively in the Free Trial period or you have upgraded to a paid account by enabling billing.
  • Your account is in good standing.

You can take a look at the official usage limits here, this information will help you to set limits on your app.yaml file in order to don't exceed the limits of your instance.

To be able to better control the resources used in your project, you can implement a budget alert, keep in mind that the management of resources as well as the implementation of good practices in your project is the responsibility of the user.

Also, if you want to have more control on your resources you can use the cap billing to stop usage service on the budget alerts.

Finally, if you think there has been an error in the charges to your project as long as you meet the requirements, you can go to the support offered by Google Cloud