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.
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
For more information about the different Tango components, go to the following pages:
This guide shows how to setup Tango in a development environment. Use the deploying Tango guide for installing in a production environment.
Obtain the source code.
git clone https://github.com/autolab/Tango.git; cd Tango
config.pyfile from the given template.
cp config.template.py config.py
Create the course labs directory where job's output files will go, organized by key and lab name:
By default the
config.pypoints to the
courselabsdirectory in the Tango directory. Change this to specify another path if you wish.
Set up a VMMS for Tango to use.
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
If you are using Docker, set
config.pyto be the path to the
volumesdirectory you just created.
DOCKER_VOLUME_PATH = "/path/to/Tango/volumes/"
Start Redis by running the following command:
Run the following command to start the server (producer). If no port is given, the server will run on the port specified in
python restful-tango/server.py <port>
Open another terminal window and start the job manager (consumer):
For more information on the job producer/consumer model check out our blog post
Ensure Tango is running:
$ curl localhost:<port> # Hello, world! RESTful Tango here!
You can test the Tango setup using the command line client.
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" #(if you are running Tango locally, then it is just "localhost") # Port for Tango RESTful API RESTFUL_PORT = "3000" # Key for Tango RESTful API RESTFUL_KEY = "test"
To deploy Tango in a standalone production environment, use this guide