Skip to main content

Motivus client library

Project description

Motivus framework

This package contains:

  • A CLI utility to manage:
    • Algorithm compilation
    • Version registry uploads to Motivus marketplace
  • A Client library to use Motivus cluster nodes

Installation

$ pip install motivus

Configuration

Configuration is provided through environment variables. You can also create a .env file.

# .env
# for consuming algorithms from Motivus marketplace repository and sending tasks to Motivus cluster
APPLICATION_TOKEN=MWBatxipDHG4daX3ebBPyWDj36AsWqbOJc=
WEBSOCKET_URI=wss://waterbear.api.motivus.cl/client_socket/websocket

# for pushing algorithm versions to Motivus marketplace repository
MOTIVUS_PERSONAL_ACCESS_TOKEN=MWBpatrZpMb1vD_QwAro=

CLI

Create a new project

Docker required

$ motivus new ALGORITHM_NAME

Creates a new Rust project.

Compilation

Docker required

TODO: add compilation process description

$ motivus build -h

Upload new version

Uploads packaged algorithm version contents to Motivus marketplace

Authentication is provided through env value

MOTIVUS_PERSONAL_ACCESS_TOKEN=MWBpatxipsWqbOJc=
$ motivus push -h

Worker for local development

Docker required

Start a worker in loopback mode, useful for local algorithm development

$ motivus loopback -h

Worker

Docker required

Start a worker that connects to Motivus cluster.

$ motivus worker -h

Client

Basic task execution example

Set your application token as an environment value as follows:

APPLICATION_TOKEN=MWBatxipD4Dj36AsWqbOJc=

Execute some tasks, i.e. the "example" algorithm on Motivus marketplace repository.

from motivus.client import Client

conn = await Client.connect()

task_def = {
  "algorithm": "example",
  "algorithm_version": "1.0.0",
  # this would run the equivalent to " $ example 1 3 " on a Motivus worker
  "arguments": [1, 3]
}
task_id = conn.call_async(task_def)
task = conn.select_task(task_id)
result = await task

Getting help

You can contact us anytime using our contact form.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

motivus-1.8.0.tar.gz (21.1 kB view hashes)

Uploaded source

Built Distribution

motivus-1.8.0-py3-none-any.whl (21.3 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page