Add initial news reader example (#4348)

This commit is contained in:
Philipp Moritz
2019-03-20 18:47:12 -07:00
committed by Robert Nishihara
parent 9c158c6a87
commit 80ef8c19aa
3 changed files with 115 additions and 0 deletions
+29
View File
@@ -0,0 +1,29 @@
News Reader
===========
This document shows how to implement a simple news reader using Ray. The reader
consists of a simple Vue.js `frontend`_ and a backend consisting of a Flask
server and a Ray actor. View the `code for this example`_.
To run this example, you will need to install NPM and a few python dependencies.
.. code-block:: bash
pip install atoma
pip install flask
To use this example you need to
* In the ``ray/examples/newsreader`` directory, start the server with
``python server.py``.
* Clone the client code with ``git clone https://github.com/ray-project/qreader``
* Start the client with ``cd qreader; npm install; npm run dev``
* You can now add a channel by clicking "Add channel" and for example pasting
``http://news.ycombinator.com/rss`` into the field.
* Star some of the articles and dump the database by running
``sqlite3 newsreader.db`` in a terminal in the ``ray/examples/newsreader``
directory and entering ``SELECT * FROM news;``.
.. _`frontend`: https://github.com/saqueib/qreader
.. _`code for this example`: https://github.com/ray-project/ray/tree/master/examples/newsreader
+1
View File
@@ -115,6 +115,7 @@ Ray comes with libraries that accelerate deep learning and reinforcement learnin
example-rl-pong.rst
example-policy-gradient.rst
example-parameter-server.rst
example-newsreader.rst
example-resnet.rst
example-a3c.rst
example-lbfgs.rst