-
Notifications
You must be signed in to change notification settings - Fork 156
Install Agent
Joongi Kim edited this page Jan 2, 2018
·
7 revisions
We assume that your system is configured with a sudoable admin user named devops
.
Your Backend.AI manager should be already set up and running.
{NS} |
The etcd namespace (just create a unique string like domain names) |
{ETCDADDR} |
The etcd cluster address ({ETCDHOST}:{ETCDPORT} , localhost:2379 for development setup) |
{SSLCERT} |
The path to your SSL certificate (bundled with CA chain certificates) |
{SSLPKEY} |
The path to your SSL private key |
{S3AKEY} |
The access key for AWS S3 or compatible services[1] |
{S3SKEY} |
The secret key for AWS S3 or compatible services |
{DDAPIKEY} |
The Datadog API key |
{DDAPPKEY} |
The Datadog application key |
{SENTRYURL} |
The private Sentry report URL |
$ sudo apt-get -y update
$ sudo apt-get -y dist-upgrade
$ sudo apt-get install -y ca-certificates git-core supervisor
Here are some optional but useful packages:
$ sudo apt-get install -y vim tmux htop
(TODO)
Check out the Install CUDA guide.
Check out Install Python via pyenv for instructions.
Create a virtualenv named venv-agent
.
$ pyenv shell venv-agent
$ pip install -U setuptools pip
$ pip install -U backend.ai-agent
Check out the Install Monitoring and Logging Tools guide.
$ sudo vi /etc/supervisor/conf.d/apps.conf
[program:backendai-agent]
user = devops
stopsignal = TERM
stopasgroup = true
command = /home/devops/run-agent.sh
$ vi /home/devops/init-venv.sh
#!/bin/bash
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
pyenv shell venv-agent
$ sudo mkdir -p /var/cache/scratches
$ sudo chown devops:devops /var/cache/scratches
$ vi /home/devops/run-agent.sh
source /home/devops/init-venv.sh
umask 0002
export AWS_ACCESS_KEY_ID="{S3AKEY}"
export AWS_SECRET_ACCESS_KEY="{S3SEKEY}"
export DATADOG_API_KEY={DDAPIKEY}
export DATADOG_APP_KEY={DDAPPKEY}
export RAVEN_URI="{SENTRYURL}"
exec python -m ai.backend.agent.server \
--etcd-addr {ETCDADDR} \
--namespace {NS} \
--scratch-root=/var/cache/scratches
You need to pull the kernel container images first to actually spawn compute sessions.
$ docker pull lablup/kernel-python:latest
$ docker pull lablup/kernel-python:3.6
For the full list of publicly available kernels, check out the kernels repository.
$ sudo supervisorctl reread
$ sudo supervisorctl start backendai-agent