DESCRIPTION OF THE PROBLEM
I am trying to create a custom managed virtual machine for Google App Engine that behaves the same way with the standard python27 managed virtual machine provided by Google. (I am doing this as a first step towards adding a C ++ library at runtime).
From the google documentation, the following Docker file indicates the standard python27 runtime:
FROM gcr.io/google_appengine/python-compat
ADD . /app
I checked that this is the correct Docker file by examining the file generated gcloud preview app runwhen using the standard python27 runtime. He is identical to this.
But when I run my application with this Docker file using dev_appserver.pyor with gcloud preview app run, I get an error message:
The --custom_entrypoint flag must be set for custom runtimes
I use the latest versions of gcloud (1.9.86, with app-engine-python component version 1.9.28) and the standalone application SDK for python applications (1.9.28). I had the same problem with earlier versions, so I upgraded to the latest version.
THINGS RECEIVED:
gcloud preview app run --helpmatters --custom-entrypoint:
--custom-entrypoint CUSTOM_ENTRYPOINT
Specify an entrypoint for custom runtime modules. This is required when
such modules are present. Include "{port}" in the string (without
quotes) to pass the port number in as an argument. For instance:
--custom_entrypoint="gunicorn -b localhost:{port} mymodule:application"
I'm not sure what to do with this. If the docker image no longer contains ENTRYPOINT? Why should I provide this extra? Also, what should be the entry point for the image gcr.io/google_appengine/python-compat? Google does not provide documentation for this.
I tried a meaningless --custom-entrypoint="echo"one that suppresses the error, but the application does not respond to any HTTP requests.
stackoverflow, , . , , , SDK, . SDK, , .
:
, , . :
app.yaml:
module: default
version: 1
runtime: custom
api_version: 1
threadsafe: true
vm: true
handlers:
- url: /.*
script: wsgi.app
Dockerfile:
FROM gcr.io/google_appengine/python-compat
ADD . /app
Dockerfile , python27 ( Docker, gcloud preview app run python27), runtime: python27.
wsgi.py:
import webapp2
class Hello(webapp2.RequestHandler):
def get(self):
self.response.write(u'Hello')
app = webapp2.WSGIApplication([('/Hello', Hello)], debug=True)
dev_appserver.py app.yaml , , :
Traceback (most recent call last):
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 83, in <module>
_run_file(__file__, globals())
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/dev_appserver.py", line 79, in _run_file
execfile(_PATHS.script_file(script_name), globals_)
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1033, in <module>
main()
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 1026, in main
dev_server.start(options)
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/devappserver2.py", line 818, in start
self._dispatcher.start(options.api_host, apis.port, request_data)
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/dispatcher.py", line 194, in start
_module.start()
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1555, in start
self._add_instance()
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 1707, in _add_instance
expect_ready_request=True)
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/custom_runtime.py", line 73, in new_instance
assert self._runtime_config_getter().custom_config.custom_entrypoint
File "/home/vagrant/google-cloud-sdk/platform/google_appengine/google/appengine/tools/devappserver2/module.py", line 383, in _get_runtime_config
raise ValueError('The --custom_entrypoint flag must be set for '
ValueError: The