tree: 3dc01bb7d5304f0a5e11e1f8548900ebed22db78 [path history] [tgz]
  1. marvin_mnist_keras_engine/
  2. notebooks/
  3. tests/
  4. .bumpversion.cfg
  5. .coveragerc
  6. .gitignore
  7. CHANGES.md
  8. Dockerfile
  9. docs.yaml
  10. engine.messages
  11. engine.metadata
  12. engine.params
  13. fabfile.py
  14. feedback.messages
  15. INSTALL
  16. LICENSE
  17. Makefile
  18. MANIFEST.in
  19. marvin.ini
  20. pytest.ini
  21. README.md
  22. setup.cfg
  23. setup.py
  24. tox.ini
public-engines/mnist-keras-engine/README.md

mnist_keras v0.0.1

Overview

Marvin engine

Requirements

REPLACE: Add here the list of requirements. For example:

  • Python 2.7
  • Numpy 1.11.0 or higher

Installation

Use the Marvin toolbox to provision, deploy and start the remote HTTP server.

First, edit the marvin.ini file, setting the options within the ssh_deployment section:

  1. host: the host IP address or name where the engine should be deployed. You can enable multi-host deployment using , to separate hosts
  2. port: the SSH connection port
  3. user: the SSH connection username. Currently, only a single user is supported. This user should be capable of passwordless sudo, although it can use password for the SSH connection

Next, ensure that the remotes servers are provisioned (all required software are installed):

marvin engine-deploy --provision

Next, package your engine:

marvin engine-deploy --package

This will create a compressed archive containing your engine code under the .packages directory.

Next, deploy your engine to remotes servers:

marvin engine-deploy

By default, a dependency clean will be executed at each deploy. You can skip it using:

marvin engine-deploy --skip-clean

Next, you can start the HTTP server in the remotes servers:

marvin engine-httpserver-remote start

You can check if the HTTP server is running:

marvin engine-httpserver-remote status

And stop it:

marvin engine-httpserver-remote stop

After starting, you can test it by making a HTTP request to any endpoint, like:

curl -v http://example.com/predictor/health

Under the hood, this engine uses Fabric to define provisioning and deployment process. Check the fabfile.py for more information. You can add new tasks or edit existing ones to match your provisioning and deployment pipeline.

Development

Getting started

First, create a new virtualenv

mkvirtualenv marvin_mnist_keras_engine_env

Now install the development dependencies

make marvin

You are now ready to code.

Adding new dependencies

It`s very important. All development dependencies should be added to setup.py.

Running tests

This project uses py.test as test runner and Tox to manage virtualenvs.

To run all tests use the following command

marvin test

To run specific test

marvin test tests/test_file.py::TestClass::test_method

Writting documentation

The project documentation is written using Jupyter notebooks. You can start the notebook server from the command line by running the following command

marvin notebook

Use notebooks to demonstrate how to use the lib features. It can also be useful to show some use cases.

Bumping version

marvin pkg-bumpversion [patch|minor|major]
git add . && git commit -m "Bump version"

Tagging version

marvin pkg-createtag
git push origin master --follow-tags

Logging

The default log level is set to WARNING. You can change the log level at runtime setting another value to one of the following environment variable: MARVIN_MNIST_KERAS_ENGINE_LOG_LEVEL or LOG_LEVEL. The available values are CRITICAL, ERROR, WARNING, INFO and DEBUG.

Be careful using LOG_LEVEL, it may affect another lib.