1

I'm trying to create a new environment on google cloud platform. It's not recognizing my instance class... and giving the error Instance class (n1-standard-1) is not recognized

entrypoint: gunicorn -b :$PORT presto.wsgi
env: flex
runtime: python
instance_class: n1-standard-1

runtime_config:
  python_version: 3

n1-standard-1 is given from google's documentation so I'm not sure what's wrong here. Does it go by a different name? Thanks!

hackerman
  • 1,221
  • 3
  • 17
  • 38

1 Answers1

2

For the python flex environment, the resource config is defined in a different way.

To get the same machine as a n1-standard-1, you must add the following resource definition in your app.yaml:

resources:
  cpu: 1
  memory_gb: 3.75
Jofre
  • 3,718
  • 1
  • 23
  • 31
  • Another slightly related question about app.yaml. Do you know how to add a python command to run upon end of deployment. similar to container command in aws? – hackerman Mar 16 '18 at 07:45
  • You should capture `SIGINT`in your code. Here's an [SO question](https://stackoverflow.com/questions/1112343/how-do-i-capture-sigint-in-python) with more details. Be sure to finish quickly, as instances will be killed a few seconds after `SIGINT`. It might me worth it's specific SO question if you find trouble. – Jofre Mar 16 '18 at 08:01