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 working-directory handling to grading scripts #83

Open
blerner opened this issue Aug 27, 2024 · 3 comments
Open

Add working-directory handling to grading scripts #83

blerner opened this issue Aug 27, 2024 · 3 comments
Assignees

Comments

@blerner
Copy link
Collaborator

blerner commented Aug 27, 2024

This needs two things:

  1. A working_dir attribute on bash and conditional commands
  2. A new cd command
{
  cd: string,
  cmds: command[]
}

that 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

@blerner
Copy link
Collaborator Author

blerner commented Aug 27, 2024

Also need to add environment variables (using the env=dictionary... argument to subprocess.run)

@blerner
Copy link
Collaborator Author

blerner commented Aug 27, 2024

Do we support working_dir already? Seems like we do?

working_dir = self.__add_interpolated_paths(
and
working_dir?: string;
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...

@blerner
Copy link
Collaborator Author

blerner commented Aug 27, 2024

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.

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

No branches or pull requests

2 participants