Tango

Tango is a standalone RESTful Web service that runs jobs in virtual machines or containers. It was developed as a distributed grading system for Autolab and has been extensively used for autograding programming assignments. It is also open source and hosted on Github.

Getting Started

A brief overview of the Tango respository:

  • tango.py - Main tango server
  • jobQueue.py - Manages the job queue
  • jobManager.py - Assigns jobs to free VMs
  • worker.py - Shepherds a job through its execution
  • preallocator.py - Manages pools of VMs
  • vmms/ - VMMS library implementations
  • restful-tango/ - HTTP server layer on the main Tango

Tango runs jobs in VMs using a high level Virtual Memory Management System (VMMS) API. Tango currently has support for running jobs in Docker containers (recommended), Tashi VMs, or Amazon EC2.

For more information about the different Tango components, go to the following pages:

Installation

This guide shows how to setup Tango in a development environment. Use the deploying Tango guide for installing in a production environment.

  1. Obtain the source code.

    git clone https://github.com/autolab/Tango.git; cd Tango
  2. Install Redis following this guide. By default, Tango uses Redis as a stateless job queue. Learn more here.

  3. Create a config.py file from the given template.

    cp config.template.py config.py
  4. Create the course labs directory where job's output files will go, organized by key and lab name:

    mkdir courselabs

    By default the COURSELABS option in config.py points to the courselabs directory in the Tango directory. Change this to specify another path if you wish.

  5. Set up a VMMS for Tango to use.

  6. Run the following commands to setup the Tango dev environment inside the Tango directory. Install pip if needed.

    $ pip install virtualenv
    $ virtualenv .
    $ source bin/activate
    $ pip install -r requirements.txt
    $ mkdir volumes
  7. Start Redis by running the following command:

    $ redis-server
  8. Run the following command to start the server (producer). If no port is given, the server will run on the port specified in config.py (default: 3000):

    python restful-tango/server.py <port>

    Open another terminal window and start the job manager (consumer):

    python jobManager.py

    For more information on the job producer/consumer model check out our blog post

  9. Ensure Tango is running:

    $ curl localhost:<port>
    # Hello, world! RESTful Tango here!
  10. You can test the Tango setup using the command line client.

  11. If you are using Tango with Autolab, you have to configure Autolab to use Tango. Go to your Autolab directory and enter the following commands:

    cp config/autogradeConfig.rb.template config/autogradeConfig.rb

    Fill in the correct info for your Tango deployment, mainly the following:

    # Hostname for Tango RESTful API
    RESTFUL_HOST = "foo.bar.edu"
    
    # Port for Tango RESTful API
    RESTFUL_PORT = "3000"
    
    # Key for Tango RESTful API
    RESTFUL_KEY = "test"
  12. To deploy Tango in a standalone production environment, use this guide