-
Notifications
You must be signed in to change notification settings - Fork 61
Testing Tango
This is a guide to test whether the Tango server is functioning correctly. Make sure you have completed the set-up guide for Tango before attempting to follow the instructions below. We will be using the command-line client (clients/tango-rest.py
) to send sample jobs to Tango via the REST interface. Example jobs to test Tango are also provided in the clients/
directory. This guide assumes an instance of Tango is already up and running. If not, see the start up guide.
-
Open a
courselab
on Tango. This will create a directory for tango to store the files for the job.$ python clients/tango-rest.py -P <port> -k <key> -l <courselab> --open
-
Upload files necessary for the job.
$ python clients/tango-rest.py -P <port> -k <key> -l <courselab> \ --upload --filename <.../Tango/clients/job1/hello.sh> $ python clients/tango-rest.py -P <port> -k <key> -l <courselab> \ --upload --filename <.../Tango/clients/job1/autograde-Makefile>
-
Add the job to the queue. Note:
localFile
is the name of the file that was uploaded anddestFile
is the name of the file that will be on the VM. One of thedestFile
attributes must beMakefile
. Furthermore,image
references the name of the VM image you want the job to be run on. If this is a normal VM image, then the image name will contain a.img
suffix, whereas this may not be the case if this is a Docker container image.$ python clients/tango-rest.py -P <port> -k <key> -l <courselab> \ --addJob --infiles \ '{"localFile" : "hello.sh", "destFile" : "hello.sh"}' \ '{"localFile" : "autograde-Makefile", "destFile" : "Makefile"}' \ --image <image> --outputFile <outputFileName> \ --jobname <jobname> --maxsize <maxOutputSize> --timeout <jobTimeout>
-
Get the job output.
$ python clients/tango-rest.py -P <port> -k <key> -l <courselab> \ --poll --outputFile <outputFileName>
The output should look something like this:
Autograder [<date-time>]: Received job <jobname>:<jobid> Autograder [<date-time>]: Success: Autodriver returned normally Autograder [<date-time>]: Here is the output from the autograder: --- ...
The command-line client also implements an all-in-one command that simply runs a job from a directory of files by uploading all the files in the directory. Usage is as follows:
python clients/tango-rest.py -P <port> -k <key> -l <courselab> \
--runJob <.../Tango/clients/job1/> --image <image>