src-d / tmsc

Other
21 stars 9 forks source link

Missing model index.json file #20

Open akondas opened 5 years ago

akondas commented 5 years ago

The model index.json file is missing:

https://storage.googleapis.com/models.cdn.sourced.tech/index.json

Error:

tmsc https://github.com/apache/spark
INFO:bblfsh:Detected bblfsh server: 0.0.0.0:9432
INFO:gcs-backend:Fetching https://storage.googleapis.com/models.cdn.sourced.tech/index.json?ignoreCache=1...
Traceback (most recent call last):
  File "/home/akondas/.local/bin/tmsc", line 11, in <module>
    sys.exit(main())
  File "/home/akondas/.local/lib/python3.6/site-packages/tmsc/__main__.py", line 61, in main
    "timeout": args.timeout})
  File "/home/akondas/.local/lib/python3.6/site-packages/tmsc/topic_detector.py", line 45, in __init__
    self._topics = Topics(log_level=verbosity).load(backend=backend)
  File "/home/akondas/.local/lib/python3.6/site-packages/modelforge/model.py", line 84, in load
    index = backend.fetch_index()
  File "/home/akondas/.local/lib/python3.6/site-packages/modelforge/gcs_backend.py", line 87, in fetch_index
    return json.loads(buffer.getvalue().decode("utf8"))
  File "/usr/lib/python3.6/json/__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python3.6/json/decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.6/json/decoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
vmarkovtsev commented 5 years ago

Sorry for this.

We need to update the Modelforge dependency here, the new index is in src-d/models.

akondas commented 5 years ago

:thinking: You can use --bow= param, for example:

--bow=https://storage.googleapis.com/models.cdn.sourced.tech/models%2Fbow%2F1e3da42a-28b6-4b33-94a2-a5671f4102f4.asdf

but then another error appears:

INFO:*bow:Reading /home/akondas/.source{d}/*bow/default.asdf...
Traceback (most recent call last):
  File "/home/akondas/.local/bin/tmsc", line 11, in <module>
    sys.exit(main())
  File "/home/akondas/.local/lib/python3.6/site-packages/tmsc/__main__.py", line 55, in main
    args.bow = BOWBase(log_level=args.log_level).load(source=args.bow, backend=backend)
  File "/home/akondas/.local/lib/python3.6/site-packages/modelforge/model.py", line 106, in load
    with asdf.open(source) as model:
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/asdf.py", line 1346, in open_asdf
    custom_schema=custom_schema, _readonly=readonly)
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/asdf.py", line 122, in __init__
    self._process_extensions(extensions)
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/asdf.py", line 206, in _process_extensions
    self._extensions = default_extensions.extension_list
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/extension.py", line 233, in extension_list
    self._extension_list = AsdfExtensionList(self.extensions)
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/extension.py", line 226, in extensions
    self._load_installed_extensions()
  File "/home/akondas/.local/lib/python3.6/site-packages/asdf/extension.py", line 197, in _load_installed_extensions
    ext = entry_point.load()
  File "/home/akondas/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2442, in load
    self.require(*args, **kwargs)
  File "/home/akondas/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2465, in require
    items = working_set.resolve(reqs, env, installer, extras=self.extras)
  File "/home/akondas/.local/lib/python3.6/site-packages/pkg_resources/__init__.py", line 791, in resolve
    raise VersionConflict(dist, req).with_context(dependent_req)
pkg_resources.VersionConflict: (semantic-version 2.8.2 (/home/akondas/.local/lib/python3.6/site-packages), Requirement.parse('semantic-version<=2.6.0,>=2.3.1'))
akondas commented 5 years ago

Ehh, even when fixed version conflict still error:

    return dict(repos=split_strings(tree["repos"]),
KeyError: 'repos'