Open blerner opened 2 months ago
Also need to add environment variables (using the env=dictionary...
argument to subprocess.run
)
Do we support working_dir already? Seems like we do? https://github.com/CodeGrade/orca/blob/293017df8bcd26fd70f48125bb19f47d96686f87/worker/orca_grader/container/build_script/preprocess/preprocessor.py#L74 and https://github.com/CodeGrade/orca/blob/293017df8bcd26fd70f48125bb19f47d96686f87/docs/orca_data_definitions.md?plain=1#L111 seem to indicate it. But https://github.com/CodeGrade/orca/blob/main/worker/orca_grader/validations/schemas/bash_grading_script_command_schema.json doesn't include it as an attribute...
If working dirs are already supported, I can probably finesse environment variables by prefixing the commands with env VAR=val ...actual command...
when needed. So if working dirs exist, then rename this issue to reframe the discussion, and it'll drop to a lower priority.
This needs two things:
working_dir
attribute on bash and conditional commandscd
commandthat changes directory to the given dir and then runs the sub-commands array while in that directory. You can probably preprocess these commands away and turn them regular commands with a
working-dir
attribute on them