Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Partial Output to Tango, and functionality to localDocker VMMS #223

Merged
merged 14 commits into from
Dec 4, 2022

Conversation

victorhuangwq
Copy link
Contributor

@victorhuangwq victorhuangwq commented Oct 14, 2022

Description

Adds partial output functionality by:

  • 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.

How to test

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)
  • Output should be {"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

  • 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

@victorhuangwq victorhuangwq changed the title [WIP] Add partial output Add Partial Output to Tango, and functionality to localDocker Oct 22, 2022
@victorhuangwq victorhuangwq changed the title Add Partial Output to Tango, and functionality to localDocker Add Partial Output to Tango, and functionality to localDocker VMMS Oct 22, 2022
tango.py Show resolved Hide resolved
@victorhuangwq victorhuangwq requested review from cg2v and removed request for cg2v November 27, 2022 20:52
Copy link

@michellexliu michellexliu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Member

@damianhxy damianhxy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed testing plan, code looks good

lgtm

@victorhuangwq victorhuangwq merged commit 988766f into master Dec 4, 2022
@victorhuangwq victorhuangwq deleted the add-partial-output branch December 4, 2022 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants