[Predator] Figure out way to use ``CrashConfig.Get()`` locally without remote_api? |
||
Issue description
Is there a way to use ``CrashConfig.Get()`` in local scripts? Basically to solve this, we need to figure out how to use key.get() for datastore in local script.
Traceback (most recent call last):
File "run-predator.py", line 150, in <module>
RunPredator()
File "run-predator.py", line 133, in RunPredator
culprits = GetCulprits(crashes, args.client, args.app, args.verbose)
File "run-predator.py", line 93, in GetCulprits
findit = FinditForClientID(client_id, LocalGitRepository())
File "../../../crash/crash_pipeline.py", line 53, in FinditForClientID
return cls(repository)
File "../../../crash/findit_for_chromecrash.py", line 54, in __init__
component_classifier_config = CrashConfig.Get().component_classifier
File "../../../model/versioned_config.py", line 29, in Get
config_data = cls.GetVersion(version=version)
File "../../../model/versioned_model.py", line 68, in GetVersion
root = root_key.get()
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/key.py", line 572, in get
return self.get_async(**ctx_options).get_result()
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 383, in get_result
self.check_success()
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 427, in _help_tasklet_along
value = gen.throw(exc.__class__, exc, tb)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/context.py", line 722, in get
deadline=memcache_deadline)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/tasklets.py", line 430, in _help_tasklet_along
value = gen.send(val)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/ext/ndb/context.py", line 1104, in _memcache_get_tasklet
rpc = memcache.create_rpc(deadline=deadline)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/memcache/__init__.py", line 294, in create_rpc
return apiproxy_stub_map.UserRPC('memcache', deadline, callback)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 414, in __init__
self.__rpc = CreateRPC(service, stubmap)
File "/usr/local/google/home/katesonia/Workstation/chromium_infra/google_appengine/google/appengine/api/apiproxy_stub_map.py", line 68, in CreateRPC
assert stub, 'No api proxy found for service "%s"' % service
AssertionError: No api proxy found for service "memcache"
,
Nov 15 2016
Right, breaking the dependency would be great, so I don't need to do some mocking hack. But the problem of this issue remains, I cannot find a way to retrieve entity by key from NDB datastore, the remote_api seems needed... Now the best way I can think of is to index config by timestamp and get the latest config using remote_api. Any better idea?
,
Nov 15 2016
A question here: 1. Is it required for the delta-test to read data from NDB in the live app engine app? And why? 2. Why we want to use ``CrashConfig.Get()`` locally without remote_api? Do we need to read the config from the live app engine app or not?
,
Nov 15 2016
1. Is it required for the delta-test to read data from NDB in the live app engine app? And why? Not necessarily the latest config as long as 2 versions use the same config. But we do need one config which is not very old. 2. Why we want to use ``CrashConfig.Get()`` locally without remote_api? Do we need to read the config from the live app engine app or not? we need to read config from live app. I cannot find a way to get the NDB date without remote_api, so I created the bug for discussion...
,
Nov 15 2016
After some experiment, the remote_api can work well without the iterator work around. Cannot recall why it didn't work for CrashConfig.Get before (some experiments long time ago...).
,
Nov 15 2016
I still don't understand why we want to read data from the __live__ NDB but __without__ remote_api. But it is good that we figured out the correct solution in the end.
,
Nov 17 2016
I meant without remote_api iterator hack. |
||
►
Sign in to add a comment |
||
Comment 1 by wrengr@chromium.org
, Nov 15 2016