Giter VIP home page Giter VIP logo

hepdata-converter-ws's Issues

Decouple hepdata-converter-ws and hepdata-converter-ws-docker circular dependency

There's currently a circular dependency between hepdata-converter-ws-docker and hepdata-converter-ws: the docker image includes hepdata-converter-ws in its requirements, but the hepdata-converter-ws package runs its tests on the hepdata-converter-ws docker image.

We should instead run the hepdata-converter-ws tests on the hepdata-converter docker image. (It will need to install its requirements.) Then the hepdata-converter-ws docker image can install hepdata-converter-ws from pypi so it can run the service.

We'll need to move the requirements.txt from the docker repo. We should also see if we can install them for travis using the setup.py rather than a separate requirements.txt.

Add support for Sentry

See https://docs.sentry.io/platforms/python/flask/ . The dsn variable can be omitted from the configuration, since the SENTRY_DSN environment variable will be passed at runtime in deployment on the Kubernetes cluster at CERN.

For testing, it would be good to add the /debug-sentry endpoint as described in the Sentry docs.

Installation

As a relatively simple package I would suggest creating pip package for installation, instead of documentation describing how to do it "by hand". Of course possible connection of this service to any "real" web server (ngnix / apache / etc) would require additional manual work, but it would still be much better then doing it "invenio style"

If we're doing this style of installation then where should configuration be placed? /etc/hepdata-converter-ws/ sounds like a resonable idea.

Any comments @eamonnmag @jstypka ?

hepdata-converter-ws script has error during launch

Every time that script hepdata-converter-ws is run the following stack trace is produced:

Traceback (most recent call last):
  File "/usr/local/bin/hepdata-converter-ws", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python2.7/site-packages/hepdata_converter_ws/__init__.py", line 33, in main
    app.run()
  File "/usr/local/lib/python2.7/site-packages/flask/app.py", line 772, in run
    run_simple(host, port, self, **options)
  File "/usr/local/lib/python2.7/site-packages/werkzeug/serving.py", line 623, in run_simple
    reloader_type)
  File "/usr/local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 229, in run_with_reloader
    reloader.run()
  File "/usr/local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 120, in run
    for filename in chain(_iter_module_files(), self.extra_files):
  File "/usr/local/lib/python2.7/site-packages/werkzeug/_reloader.py", line 22, in _iter_module_files
    filename = getattr(module, '__file__', None)
  File "/usr/local/Cellar/root6/6.04.00/lib/root/cppyy.py", line 131, in __getattr__
    klass = _backend.CreateScopeProxy( name, cls )
TypeError: requested class '__file__' does not exist

This error happens on MAC OS X, investigation must be made to check if it also happens on other systems (CentOS, Ubuntu)

@eamonnmag - that may be the reason why it didn't work with docker... but it did not produce any stack trace, so those two may be unrelated

Webservice error handling could be improved

If the hepdata_converter.convert function fails, for example if the YAML does not validate, currently there is no error handling by the web service, so no useful info is passed back to the client.

We could modify the API to send back a 400 error response with an appropriate error message in the case of failure.

WS return values

I originally was thinking that returned value in response to request should simply be a file, but how should multiple file formats be resolved then (mainly YAML)? Maybe a proper JSON response is more in order (with Base64 encoded binary?) though it would put additional strain on the service receiving data.

Another option may be to send tar.gz (or other compressed file format) with all files packed into it.

What do you think? @eamonnmag @jstypka

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.