Adding Endpoint on restful_tango that takes in JobID
Adds getPartialOutput function to tango.py, which also does error handling and calls on the VMMS to get partial output
Adds functionality to getPartialOutput for localDocker, mainly as this is likely the most use VMMS for Tango right now.
Adds calling of endpoint via tango-cli for easy testing
Adds job8-10 which is a grading test case that takes at least 30 seconds to run, which makes the rest of the testing easier by hand. 8 is a C version, 9 is Python and 10 is bash.
For the rest of the testing, I'm assuming that you left the Tango Key as default of just test (DEFAULT_KEY = "test" in config.py`)
Test situation when jobId doesn't exits / is no longer live or on the queue (could be completed)
Run python clients/tango-cli.py --getPartialOutput -k test --jobid 1
Output should be {"statusId": -1, "statusMsg": "getPartialOutput request failed: Invalid job id"}
Test situation when a VMMS doesn't have getPartialOutput Implemented
Change localDocker's getPartialOutput function to getPartialOutput2
Run python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image(this submits job10 for grading)
Output should be something like {"statusId": 0, "statusMsg": "Job added", "jobId": "1"}
Run python clients/tango-cli.py --getPartialOutput -k test --jobid 1
Output should now be {"statusId": -1, "statusMsg": "getPartialOutput request failed: 'LocalDocker' object has no attribute 'getPartialOutput'"}
( make sure to change the function getPartialOutput name back)
Test getting partial output
Run python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image(this submits job10 for grading) to submit another job
Run python clients/tango-cli.py --getPartialOutput -k test --jobid 1 (depending on the job id)
Run python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image(this submits job10 for grading) to submit another job 3 times (if you are on default, as by default settings, Tango only spins up at most 2 in the autograding_pool).
Run python clients/tango-cli.py --getPartialOutput -k test --jobid 3 (depending on the job id of the last job to be submitted
Output should initially be {"statusId": -1, "statusMsg": "getPartialOutput request failed: Job 4 is not running yet"}
Once the first two jobs are done, running python clients/tango-cli.py --getPartialOutput -k test --jobid 3 should now get you the partial output
Description
Adds partial output functionality by:
localDocker
, mainly as this is likely the most use VMMS for Tango right now.job8-10
which is a grading test case that takes at least 30 seconds to run, which makes the rest of the testing easier by hand. 8 is a C version, 9 is Python and 10 is bash.How to test
test
(DEFAULT_KEY = "test"
in config.py`)Test situation when jobId doesn't exits / is no longer live or on the queue (could be completed)
python clients/tango-cli.py --getPartialOutput -k test --jobid 1
{"statusId": -1, "statusMsg": "getPartialOutput request failed: Invalid job id"}
Test situation when a VMMS doesn't have getPartialOutput Implemented
python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image
(this submits job10 for grading){"statusId": 0, "statusMsg": "Job added", "jobId": "1"}
python clients/tango-cli.py --getPartialOutput -k test --jobid 1
{"statusId": -1, "statusMsg": "getPartialOutput request failed: 'LocalDocker' object has no attribute 'getPartialOutput'"}
( make sure to change the function getPartialOutput name back)Test getting partial output
python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image
(this submits job10 for grading) to submit another jobpython clients/tango-cli.py --getPartialOutput -k test --jobid 1
(depending on the job id){"statusId": 0, "statusMsg": "Partial output obtained", "output": "bash hello.sh\r\nHello to sleep job\r\nHello 1 times\r\nHello 2 times\r\nHello 3 times\r\nHello 4 times\r\nHello 5 times\r\nHello 6 times\r\nHello 7 times\r\nHello 8 times\r\nHello 9 times\r\nHello 10 times\r\nHello 11 times\r\n"}
Test situation when the Job is still on the queue
python clients/tango-cli.py -P 3000 -k test -l assessment10 --runJob clients/job10/ --image autograding_image
(this submits job10 for grading) to submit another job 3 times (if you are on default, as by default settings, Tango only spins up at most 2 in the autograding_pool).python clients/tango-cli.py --getPartialOutput -k test --jobid 3
(depending on the job id of the last job to be submitted{"statusId": -1, "statusMsg": "getPartialOutput request failed: Job 4 is not running yet"}
python clients/tango-cli.py --getPartialOutput -k test --jobid 3
should now get you the partial output