Skip to content

Commit

Permalink
Merge pull request #50 from gradescope/ibrahim/ch37009/document-how-i…
Browse files Browse the repository at this point in the history
…nstructors-can-run-their-autograder

Add a documentation section for running docker images locally
  • Loading branch information
ibrahima committed Mar 25, 2021
2 parents 1ee58ef + 7ce42c8 commit 69145ef
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/manual_docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,32 @@ image, so you can organize it as you wish.
If your Docker Hub repository is private, you'll need to give the user
`gradescopeecs` access to your repository. You may want to do this to
make sure that students cannot download your autograder image.

## Running autograder images locally

To run your autograder image locally, you will currently need to bypass our
autograder harness because otherwise it will try to communicate with Gradescope
by default. You can do this by mounting a sample submission into the
`/autograder/submission` directory and then running `/autograder/run_autograder`
directly. Here's an example command; replace the path to the submission and
Docker image name with the appropriate values.

```bash
docker run --rm -v /path/to/submission:/autograder/submission username/image_name:tag bash -c "mkdir /autograder/results && /autograder/run_autograder && cat /autograder/results/results.json"
```

or to start an interactive session:

```bash
docker run --rm -it -v /path/to/submission:/autograder/submission username/image_name:tag bash
```

Minor notes:

- `--rm` is added to clean up the container after it exits. You can remove it if
you want to inspect container logs or state afterwards.
- The `/autograder/results` directory is ordinarily created by the harness, so
that's why you need to mkdir it. When running an interactive bash session you
will need to create it too.
- In the first example, we're using `bash -c "..."` to run multiple commands in
one Docker command and then show the results.

0 comments on commit 69145ef

Please sign in to comment.