Skip to content
This repository has been archived by the owner on Mar 20, 2021. It is now read-only.

Getting Started ottertune

Bohan Zhang edited this page Jan 2, 2019 · 5 revisions

After installation steps described in Linux Quick Setup, you can start both client side and server side in OtterTune. In the client-side, you need to change configuration files and fab run_loops, there are more descriptions in client-side Wiki page. In the server-side, you can follow the instructions below and server-side Wiki page

Create the database

In OtterTune server side, it needs a database to store all the website data. You may want to create a database in MySQL if it does not already exist.

mysqladmin create -u <username> -p ottertune

It creates a database called ottertune in MySQL. After creating the database, you need to update the database information in the Django settings including database name, username, and password.

Update the Django settings

Copy the credentials template in the settings directory:

cp website/settings/credentials_TEMPLATE.py website/settings/credentials.py

Edit credentials.py, update the secret key, MySQL database information and set DEBUG flag.

Serve the static files

If you do not use the website for production, simply set DEBUG = True in credentials.py. Then Django will handle static files automatically.

This is not an efficient way for production. You need to configure other servers like Apache to serve static files in the production environment. (Details)

Start the website server

Firstly, you need to migrate the Django models into the database.

python3 manage.py makemigrations website
python3 manage.py migrate

After loading the database, you can start the server:

python3 manage.py runserver 0.0.0.0:8000

Then you can visit OtterTune website from your browser. Go to server_ip:8000. If you deploy the website locally, you can visit 127.0.0.1:8000 to view the website.

Start the Celery

OtterTune uses Celery to schedule machine learning tasks. Before staring the celery worker, you may want to start a message broker required by celery. In our case, we use RabbitMq.

sudo rabbitmq-server -detached

Then you can start the celery worker:

python3 manage.py celery worker --loglevel=info --pool=threads --concurrency=1

OtterTune has periodical ML tasks (i.e. knob identification and metrics pruning), which run every time period. You can use celery beat to start the periodical tasks.

python3 manage.py celerybeat --verbosity=2 --loglevel=info