Metadata-Version: 2.0
Name: sorna-agent
Version: 0.9.9
Summary: Sorna agent
Home-page: https://github.com/lablup/sorna-agent
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: aiobotocore (>=0.3.0)
Requires-Dist: aiodocker
Requires-Dist: aiohttp (>=2.0.6)
Requires-Dist: aioredis (>=0.2.8)
Requires-Dist: aiozmq (>=0.7)
Requires-Dist: async-timeout (>=1.1)
Requires-Dist: coloredlogs (>=5.2)
Requires-Dist: msgpack-python
Requires-Dist: namedlist
Requires-Dist: pyzmq (>=16.0)
Requires-Dist: requests
Requires-Dist: requests-unixsocket
Requires-Dist: simplejson
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: asynctest; extra == 'dev'
Requires-Dist: flake8; extra == 'dev'
Requires-Dist: pep8-naming; extra == 'dev'
Requires-Dist: pypandoc; extra == 'dev'
Requires-Dist: pytest (>=3.1); extra == 'dev'
Requires-Dist: pytest-asyncio; 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: asynctest; extra == 'test'
Requires-Dist: flake8; extra == 'test'
Requires-Dist: pep8-naming; extra == 'test'
Requires-Dist: pytest (>=3.1); extra == 'test'
Requires-Dist: pytest-asyncio; extra == 'test'
Requires-Dist: pytest-mock; extra == 'test'

Sorna Agent
===========

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

-  sorna
-  agent: The agent server implementation

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

Sorna Agent requires Python 3.5 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:: sh

    pip install sorna-agent

Due to limitation in current version (9.0.1) of pip, you may encounter
errors while installing **aiodocker**. In that case, run
``pip install -r requirements.txt`` and try again.

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

We recommend to use an isolated virtual environment. This installs the
current working copy and sorna-common as "editable" packages.

.. code:: sh

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

Deployment
----------

Running from a command line:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~

To handle uploads of generated files to AWS S3, you need to set several
environment variables. If they are not set, the file upload feature is
disabled. Currently we only support S3-based uploads.

.. code:: sh

    export AWS_ACCESS_KEY_ID="..."
    export AWS_SECRET_ACCESS_KEY="..."
    export AWS_REGION="..."     # e.g., ap-northeast-2
    export AWS_S3_BUCKET="..."  # e.g., my-precious-sorna
    python -m sorna.agent.server --manager-addr tcp://localhost:5001 --max-kernels 15

For details about arguments, run the server with ``--help``.

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

.. code:: dosini

    [program:sorna-agent]
    stopsignal = TERM
    stopasgroup = true
    command = /home/sorna/run-agent.sh
    environment = AWS_ACCESS_KEY_ID="...",AWS_SECRET_ACCESS_KEy="...",AWS_REGION="...",AWS_S3_BUCKET="..."

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

-  6001: ZeroMQ-based internal agent control protocol
-  Docker REPL containers will use automatically-mapped host-side port
   numbers, and they do not need to be open to other hosts
   (localhost-only). Inside containers, the REPL daemons use the fixed
   port numbers: 2000-2003.


