Skip to main content

Backend.AI Agent

Project description

The Backend.AI Agent is a small daemon that reports the status of a worker computer (either a physical server or a virtualized cloud instance) to the manager and performs computation requests assigned by the manager.

Package Structure

  • ai.backend

    • agent: The agent daemon implementation

Installation

Backend.AI Agent requires Python 3.6 or higher. We highly recommend to use pyenv for an isolated setup of custom Python versions that might be different from default installations managed by your OS or Linux distros.

pip install backend.ai-agent

For development

We recommend to use an isolated virtual environment. This installs the current working copy and backend.ai-common as “editable” packages.

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

Deployment

Running from a command line

The minimal command to execute:

python -m ai.backend.agent.server --etcd-addr localhost:2379 --namespace my-cluster

The agent reads most configurations from the given etcd v3 server where the cluster administrator or the Backend.AI manager stores all the necessary settings.

The etcd address and namespace must match with the manager to make the agent paired and activated. By specifying distinguished namespaces, you may share a single etcd cluster with multiple separate Backend.AI clusters.

By default the agent uses /var/cache/scratches directory for making temporary home directories used by kernel containers (the /home/work volume mounted in containers). Note that the directory must exist in prior and the agent-running user must have ownership of it. You can change the location by --scratch-root option.

For more arguments and options, run the command with --help option.

Example config for agent server/instances

/etc/supervisor/conf.d/agent.conf:

[program:backend.ai-agent]
user = user
stopsignal = TERM
stopasgroup = true
command = /home/user/run-agent.sh

/home/user/run-agent.sh:

#!/bin/sh
source /home/user/venv/bin/activate
exec python -m ai.backend.agent.server \
     --etcd-addr localhost:2379 \
     --namespace my-cluster

Networking

Basically all TCP ports must be transparently open to the manager. The manager and agent should run in the same local network or different networks reachable via VPNs.

The operation of agent itself does not require both incoming/outgoing access to the public Internet, but if the user’s computation programs need, the docker containers should be able to access the public Internet (maybe via some corporate firewalls).

Several optional features such as automatic kernel image updates may require outgoing public Internet access from the agent as well.

Project details


Release history Release notifications | RSS feed

Download files

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

Source Distribution

backend.ai-agent-1.3.4.tar.gz (22.6 kB view details)

Uploaded Source

Built Distribution

backend.ai_agent-1.3.4-py36-none-any.whl (26.1 kB view details)

Uploaded Python 3.6

File details

Details for the file backend.ai-agent-1.3.4.tar.gz.

File metadata

File hashes

Hashes for backend.ai-agent-1.3.4.tar.gz
Algorithm Hash digest
SHA256 1a9a4dadbf0dd584ebd059080faf7142d0340a91a42f48968943a737f864ad4d
MD5 0c617f23d2b2e5982398c7c20cba28cc
BLAKE2b-256 ea5946393fff603199fef35189f5c3b8da70e8945dcf5f94679c751e180b58a7

See more details on using hashes here.

Provenance

File details

Details for the file backend.ai_agent-1.3.4-py36-none-any.whl.

File metadata

File hashes

Hashes for backend.ai_agent-1.3.4-py36-none-any.whl
Algorithm Hash digest
SHA256 77c6ab506b55c23a053af9c8cdc2b06cf768e9f898b925b89c449b99120722de
MD5 2a262976335340b75d1caa9c1ac4756c
BLAKE2b-256 f6e0094f0dac6e97935e10cbef4a5c8efa9c7c71e8f8eb1a6b2b3ea211ca733c

See more details on using hashes here.

Provenance

Supported by

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