Commit Graph

15 Commits

Author SHA1 Message Date
59ff0b4560 Merge security/web-sandbox-secret 2024-03-11 17:39:43 -04:00
David Poeschl
22bc7460df
Merge shared code for submission running (extension/sandbox) and team submission info (extension/web) (#16)
* Unify submission execution implementations into submissionRunner

* Unify contestMonitorTypes definitions between extension & web

* Make line separator in entry use LF

* Add entry.sh for sandbox

* Fix web imports

* Sandbox read from .env

---------

Co-authored-by: orosmatthew <orosmatthew@pm.me>
2024-03-11 13:32:23 -04:00
11b5106f12 [sandbox] Add eslint 2024-02-17 15:49:30 -05:00
722ff8c199 [sandbox] Create separate build dir for cpp 2024-02-17 15:12:54 -05:00
bd1623c09c [sandbox] Catch broken pipes 2024-02-17 15:06:49 -05:00
6e673cf390 [sandbox] Add cpp build 2024-02-17 15:01:29 -05:00
f5e8990c0a [sandbox] Add C# for sandbox 2024-01-15 18:39:47 -05:00
27d2132bfa [sandbox] Update deps 2023-12-19 16:59:34 -05:00
David Poeschl
17515af25c
Include detailed run result info in DB & show in admin site (#10)
* Send detailed submission run result info to site/database

* Show SubmissionStateReason on site

* Mark Build/TLE errors as graded immediately

* Remove superfluous log
2023-12-19 16:40:31 -05:00
David Poeschl
79fd96e1d3
Sandbox: Ensure runs are serialized, add detailed logging (#9)
Specific fixes to ensure runs are serialized:

- Added missing await when starting clone/run
- The runJava method now has a single exit path that can only execute when the process has guaranteed been 'close'd. The timeout detection previously sent SIGKILL and assumed it worked, but it was not working on my machine and the student code would continue to run indefinitely after returning.
- To get the SIGKILL to kill the submitted app's process, I added end/destroy calls to the process stdin/stdout/stderr streams.

Added lots of logging while diagnosing these issues, and it seems useful to keep. As part of this, the contest/team names are now included in the 'submissions' web api.

Also, I've structured the result data in more detail within the Sandbox, tracking whether a run succeeded or the way in which it failed. I'm collapsing these back down to just a string "output" with the preexisting failure markers (e.g. "[Timeout after 30 seconds]"), but would like to pass this over to the site/DB in a structured form eventually.
2023-12-17 11:30:16 -05:00
97b8f6028a [sandbox] Terminate after 30 seconds 2023-05-09 17:19:19 -04:00
149037cf7d [sandbox] Catch run errors and fetch more often 2023-05-09 16:51:43 -04:00
5280a25d4d [sandbox] Catch failed fetch 2023-05-08 21:21:14 -04:00
51ff743d98 [web] Handle auto grading submissions 2023-05-08 13:58:47 -04:00
008d93704d [sandbox] Initial sandbox 2023-05-07 19:00:55 -04:00