Metadata-Version: 2.0
Name: sorna-manager
Version: 0.9.9
Summary: Sorna Manager
Home-page: https://github.com/lablup/sorna-manager
Author: Lablup Inc.
Author-email: joongi@lablup.com
License: LGPLv3
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: License :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.6
Classifier: Operating System :: POSIX
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Environment :: No Input/Output (Daemon)
Classifier: Topic :: Scientific/Engineering
Classifier: Topic :: Software Development
Requires-Python: >=3.6
Requires-Dist: ConfigArgParse
Requires-Dist: SQLAlchemy
Requires-Dist: aiohttp (~=2.2.0)
Requires-Dist: aioredis (~=0.2.8)
Requires-Dist: aiozmq (>=0.7)
Requires-Dist: asyncpgsa (~=0.10.0)
Requires-Dist: coloredlogs (>=5.2)
Requires-Dist: msgpack-python
Requires-Dist: namedlist
Requires-Dist: python-dateutil (>=2.5)
Requires-Dist: pyzmq (>=16.0)
Requires-Dist: simplejson
Requires-Dist: sorna-common (~=0.9.0)
Requires-Dist: uvloop (>=0.8)
Provides-Extra: build
Requires-Dist: pypandoc; extra == 'build'
Requires-Dist: twine; extra == 'build'
Requires-Dist: wheel; extra == 'build'
Provides-Extra: ci
Provides-Extra: dev
Requires-Dist: pypandoc; extra == 'dev'
Requires-Dist: pytest (>=3.1); extra == 'dev'
Requires-Dist: pytest-aiohttp; extra == 'dev'
Requires-Dist: pytest-mock; extra == 'dev'
Requires-Dist: pytest-sugar; extra == 'dev'
Requires-Dist: twine; extra == 'dev'
Requires-Dist: wheel; extra == 'dev'
Provides-Extra: monitor
Requires-Dist: datadog (>=5.2); extra == 'monitor'
Requires-Dist: raven (>=6.1); extra == 'monitor'
Provides-Extra: test
Requires-Dist: pytest (>=3.1); extra == 'test'
Requires-Dist: pytest-aiohttp; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'

Sorna Manager and API Gateway
=============================

Package Structure
-----------------

-  sorna
-  manager: Abstraction of agents and computation kernels
-  gateway: RESTful API gateway based on aiohttp

Installation
------------

Sorna Manager requires Python 3.6 or higher. We highly recommend to use
`pyenv <https://github.com/yyuu/pyenv>`__ for an isolated setup of
custom Python versions that might be different from default
installations managed by your OS or Linux distros.

.. code:: console

    $ pip install sorna-manager

For development:
~~~~~~~~~~~~~~~~

We recommend to use virtual environments in Python. You may share a
virtual environment with other Sorna projects.

.. code:: console

    $ git clone https://github.com/lablup/sorna-manager.git
    $ python -m venv venv-sorna
    $ source venv-sorna/bin/activate
    $ pip install -U pip setuptools  # ensure latest versions!
    $ pip install -r requirements-dev.txt

Running and Deployment
----------------------

Prepare databases.
~~~~~~~~~~~~~~~~~~

-  An RDBMS (PostgreSQL)
-  A Redis server
-  Sorna Manager uses the following `database
   IDs <http://redis.io/commands/SELECT>`__

   -  1: to track status and availability of kernel sessions
   -  2: to track status and availability of instances (agents)
   -  3: to track session IDs
   -  These IDs are defined in
      `sorna-common <https://github.com/lablup/sorna-common/blob/master/sorna/defs.py>`__

Configuration
~~~~~~~~~~~~~

You need to specify configuration parameters using either CLI arguments
or environment variables. The default values are for development
settings so you should set most of them explicitly in production. For
details about arguments and their equivalent environment variable names,
run the server module with ``--help``.

Running the API gateway server from a command line:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: console

    $ python -m sorna.gateway.server

Example supervisord config:
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: dosini

    [program:sorna-manager]
    stopsignal = TERM
    stopasgroup = true
    command = /home/sorna/run-manager.sh

TCP Port numbers to open
~~~~~~~~~~~~~~~~~~~~~~~~

-  5001 (for legacy ZeroMQ-based interface)
-  8080 / 8443 (for local development)
-  80 / 443 (for HTTP/HTTPS API requests in production)


