Reputation: 63
When I try to deploy a python/dash app to GCP app engine, I get this message: "ERROR: (gcloud.app.deploy) Your application does not satisfy all of the requirements for a runtime of type [python37]. Please correct the errors and try again."
Which errors? Here is my app.yaml file:
runtime: python37
env: flex
instance_class: F4_1G
resources:
cpu: 1
memory_gb: 8
disk_size_gb: 10
entrypoint: gunicorn -b :$PORT main:app
# handlers:
# - url: ./assets
# static_dir: assets
# https://cloud.google.com/appengine/docs/standard/python/config/appref
env_variables:
PKL_BUCKET: 'susano-dash.appspot.com'
And here is my requirements.txt file:
Brotli==1.0.7
cachetools==4.1.0
certifi==2020.4.5.1
chardet==3.0.4
click==7.1.2
dash==1.11.0
dash-bootstrap-components==0.10.0
dash-core-components==1.9.1
dash-html-components==1.0.3
dash-renderer==1.4.0
dash-table==4.6.2
Flask==1.1.2
Flask-Compress==1.5.0
Flask-SQLAlchemy==2.4.3
future==0.18.2
google-api-core==1.17.0
google-api-python-client==1.8.4
google-auth==1.15.0
google-auth-httplib2==0.0.3
google-auth-oauthlib==0.4.1
google-cloud==0.34.0
google-cloud-core==1.3.0
google-cloud-storage==1.29.0
google-resumable-media==0.5.1
googleapis-common-protos==1.51.0
httplib2==0.18.1
idna==2.9
itsdangerous==1.1.0
Jinja2==2.11.2
MarkupSafe==1.1.1
numpy==1.18.3
oauthlib==3.1.0
pandas==1.0.3
plotly==4.6.0
protobuf==3.12.1
pyasn1==0.4.8
pyasn1-modules==0.2.8
python-dateutil==2.8.1
pytz==2020.1
requests==2.23.0
requests-oauthlib==1.3.0
retrying==1.3.3
rsa==4.0
six==1.14.0
SQLAlchemy==1.3.17
uritemplate==3.0.1
urllib3==1.25.9
Werkzeug==1.0.1
Upvotes: 3
Views: 4936
Reputation: 1494
It seems that you're mixing between flexible and standard environments. The options runtime: python37
and instance_class: F4_1G
belong to standard environment, but in the environment type you set it as env: flex
Assuming that you're going to use a flexible environment as LundinCast already said it you have to change your app.yaml
to include runtime: python
and specify python_version: 3
to use the latest version of Python, also taking in account that you were trying to set instance_class
I assume that you want to use automatic scaling (which is the option by default).
In the memory_gb
option, according to the documentation, 8 is an invalid value, each CPU core requires a total memory between 0.9 and 6.5 GB.
The app.yaml
with all the changes made would be something like:
runtime: python
env: flex
runtime_config:
python_version: 3
resources:
cpu: 1
memory_gb: 6
disk_size_gb: 10
entrypoint: gunicorn -b :$PORT main:app
env_variables:
PKL_BUCKET: 'project-id.appspot.com'
Also if you want to use gunicorn
as you specified on your entrypoint
option, you have to add it on your requirements.txt
file:
...
gunicorn==20.0.4
...
Upvotes: 10