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

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.5.0.tar.gz (19.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

motivus-1.5.0-py3-none-any.whl (21.0 kB view details)

Uploaded Python 3

File details

Details for the file motivus-1.5.0.tar.gz.

File metadata

  • Download URL: motivus-1.5.0.tar.gz
  • Upload date:
  • Size: 19.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for motivus-1.5.0.tar.gz
Algorithm Hash digest
SHA256 502f71450c59672fc4a5140b0067aec1019f74c3b788c36883e77f3f64e06bf1
MD5 a3dedb9b2e00a3f0be37f476f104be77
BLAKE2b-256 b446843f5e23e27f978fe36431dcdcdcfcfcc12a09923a19b7e7a5f138a8f493

See more details on using hashes here.

File details

Details for the file motivus-1.5.0-py3-none-any.whl.

File metadata

  • Download URL: motivus-1.5.0-py3-none-any.whl
  • Upload date:
  • Size: 21.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.7.1 importlib_metadata/4.10.0 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.11

File hashes

Hashes for motivus-1.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f94327860b6ca7e85ef67aebf8e231dee2f831ed0346181d9576d93f4bb35c5c
MD5 264dfcca91e1f85439344000a71550fc
BLAKE2b-256 eb23f5fa5e5c8eec68c1274decfc7702fd1eca0a1bdc6d43519e7ee15513e620

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page