bw-hspc-contest-env/sandbox
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
..
src Sandbox: Ensure runs are serialized, add detailed logging (#9) 2023-12-17 11:30:16 -05:00
.dockerignore [sandbox] Use env file for docker compose 2023-09-07 13:19:10 -04:00
.env.example [sandbox] Use env file for docker compose 2023-09-07 13:19:10 -04:00
.gitignore [sandbox] Formatting and scripts 2023-08-26 13:46:59 -04:00
.prettierignore [sandbox] Formatting and scripts 2023-08-26 13:46:59 -04:00
.prettierrc [sandbox] Formatting and scripts 2023-08-26 13:46:59 -04:00
docker-compose.yml [sandbox] Use env file for docker compose 2023-09-07 13:19:10 -04:00
Dockerfile [sandbox] Use node lts 2023-10-18 14:32:18 -04:00
package-lock.json [sandbox] Update deps 2023-11-19 21:06:40 -05:00
package.json [sandbox] Update deps 2023-11-19 21:06:40 -05:00
README.md Add READMEs 2023-09-14 11:16:11 -04:00
tsconfig.json [sandbox] Formatting and scripts 2023-08-26 13:46:59 -04:00

BW Contest Sandbox

Build Instructions

For all builds

You must fill out a .env file. An example is provided in .env.example. This is used for dev, production, and docker.

Build dependencies:

  • NodeJS
  • Docker (for docker build)

It is recommended to test development changes in a docker container.

For Development

npm i
npm run build
node build

For Production

npm i
npm run build
node build

Docker

docker compose up --build