CS1660's autograders are composed of two components:
ag-gradescope
repository. Gradescope clones the main
branch of this repository each time the autograder is run.There are two important things to know about this architecture:
For more general information about the autograder configuration, see the README here and the documentation linked from it.
Most of the time, you will only interact with the autograder on Gradescope. For debugging, or to develop a new autograder, you can also run the autograder manually, or via SSH on Gradescope. For instructions on how to do this, see here.
Here are instructions on how to get an assignment ready for release. This process has several parts:
All steps except the last step (creating the Classroom link) are good items to do during camp.
Note: If your assignment does not have an autograder, you can skip steps 2-3.
This may seem like a lot of steps, but don't worry, you'll be able to do it quite quickly after you try it a couple of times! Also, if the assignment already exists, you should be able to reuse most of the existing configuration. However, you need to be vigilant about checking everything to make sure there are no surprises!
The first step is to start with the documents students will read first:
Now that CS1660 has well-established geraups, it is recommended to link to the existing notes and recordings rather than spending time preparing and giving new ones. The recordings from previous gearups are located here. To make them available to students:
Before release, you should try the steps in the setup guide to make sure they work on modern systems. Even if an assignment hasn't changed, OS updates and docker updates can still cause problems sometimes. To do this:
Go to Configure Autograder and make sure that an autograder is configured–it should show the name of a zip file, probably autograder-loader.zip
. This is a pre-built version of the autograder loader.
When you first clone the assignment, Gradescope will need to rebuild the autograder's container image. This will take several minutes–you can check its status on the Configure Autograder page. The process happens asynchronously, so you can do other things while it's running.
Repeat this process for any other submissions for this assignment (eg. the all four problems for Cryptography).
Now that the assignment has been created in Gradescope, it has an assignment ID, which means you can add it to the environment config. To do this:
In this example, the assignment ID is 325373
.
In the main autograder repo, open up the autograder environment config located at config/config.json
. Locate the block for the assignment you want to modify.
Replace the assignment ID in the configuration block with the assignment ID for the new assignment. This is how Gradescope finds the configuration. You can generally leave all other configuration parameters unchanged.
Repeat this process for any other assignments you are modifying right now.
Save the file and push your changes to the main
branch.
Gradescope should now be configured to run your assignment! Proceed on to test it.
Once you have pushed any config file changes, test the autograder by doing the following:
In Gradescope, open up the assignment and go to the Configure Autograder page
Make sure the autograder has finished building–it should say "built at …" and show a relatively recent timestamp.
Click Test Autograder and upload a test submission. The easiest way to do this is to upload one of our reference repositories (eg. cryptography-reference
), but you can use any submission
If you are having trouble getting the reference repo to show up in Gradescope's list, push a trivial change to the repo (like updating the readme) and try again. Gradescope seems to populate the list by fetching the most N recently-changed repos to which you have access, and might not include the reference repo if it wasn't changed recently.
When the autograder completes, check the test results to make sure they match what you expect. If you run into issues, you can try running the autograder locally or Debugging via SSH.
Repeat these steps for any other autograders required by the assignment.
If your test results look good, your Gradescope autograder should be ready, yay!
The next step is to check the assignment's stencil code. If you haven't made many changes to a stencil,
To do this:
Locate the stencil repository for the assignment in the main course organization. For example, the stencil for cryptography is located here.
On the repository's Github page (NOT your local system), check the repository and make sure it obeys the following criteria:
On your system, make a fresh clone of the repo onto your system. DO NOT use an existing repo on your system, to avoid the chances that any latent configurations or uncommitted files affect your test results!
As you test the stencil, keep the following mind:
raise NotImplementedError("TODO")
or pass
in Python).
Here are some examples:
- An error like Assertion failed: expected 42.5 but result was 0
probably occurred because the function the student is supposed to fill in isn't implemented. This is normal and expected.
- An error like cannot find symbol
or Type Error: expected type X but got Y
probably means that one or more files in the stencil didn't get updated. Look at these closely, compare against what you see in source-main and make sure you understand why they are happening.
Once you are satisfied the stencil is correct, you can proceed to creating the Github classroom link!
When you are ready to release the project, you can create the Classroom stencil link.
Creating the Github Classroom link will make a copy of the stencil repo. If you create it early, you will need to manually migrate any changes from the stencil repo you just painstakingly checked over to the copy. This is very tedious, and it's extremely easy to introduce errors, no matter how much experience you have!
Once you are ready, do the following:
pr01
)pr01-teams
brown-csci0200/<stencil repo name>
. After you type it, the repo should appear in a dropdown box for you to select. Some notes on this:
brown-csci1660
)In the next section, configure the stencil as follows (also shown in the figure):
Before continuing, double-check that the repository visibility is set to private. For some reason, this setting seems to switch back to "public" when changing some other settings, so make sure it is correct!
When you are done, click Continue.
On the next page ("Grading and feedback"), ignore all of the settings and click Create assignment. (We don't use any of the features on this page.)
After the stencil is created, you should see a page like this:
While this page does have your stencil link, there's one more thing to configure:
At the top of the page is a line "Starter code from", and some super-long repo name. Click this repo link as shown in the figure. This should open a new Github repo (which we'll call the "Classroom stencil repo" or "copy repo", which will look like this:
If this is your first time creating a stencil, take a moment to note some important things about the copy repo:
Next, go back to the Github Classroom page (from step 8). There is one more thing to test: copy the stencil link (the one at classroom.github.com
, and open it in a new tab.
When opening the stencil link, you should see a prompt to accept the assignment, just like a student. Click Acccept this assignment and wait for Github Classroom to create your repo. Click on the repo and make sure it looks okay.
If the repo looks good, your stencil should be ready! Congrats!
If you need to alter the stencil code after a stencil link has been created, here are some things to consider:
pr01-stencil-s25
), and create the classroom link againClone the copy repo to your system, make the changes there, and push them. Any student who clones the stencil after you push the changes will get the new version.
Any students who have already cloned the repo will need to make the changes in their own repo manually. To handle this, you will need to post an announcement on EdStem with instructions on how to do this. Be sure to pin the post, and to check the box to email everyone. For an example of what the post should look like, check last year's EdStem for examples (or look for examples from your other classes.)
Unfortunately, this won't work. Github Classroom tried to make this process easy, but it only works under certain conditions that don't match how we use Github Classroom. Specifically, it requires that all students are members in the per-semester Github org, which is something we would need to set up. (Instead, we don't add students to the org and they become "external collaborators".) If you have a massive stencil change and need to use this feature, you can try doing this, but know that it won't work by default.
cryptography-stencil
) too! This means you will need to manually make the same changes in two repos.
If you don't do this ASAP, you will forget, the next semester's course staff won't know that you made changes (because they won't know to check your copy repo), and they'll be doomed to repeat whatever happened again! Please do this–next year's staff will thank you.
There are two ways to run the autograder code. You should be familiar with both.
To test autograder code before releasing an assignment, or to debug problematic submissions, you can run the autograder on your own system. When run in this mode, the autograder doesn't download the code from git–instead, it just reads the code and tests from your own local copy of the main source repo. This means you can quickly make changes to the code and tests and see how the autograder will respond.
To run the autograder locally, see the README in the main autograder repo.
You can manually run and inspect how the autograder runs directly on Gradescope's cloud servers by using the Debug via SSH button in the Gradescope web interface. This is useful for debugging or testing a student's broken submission, but not suitable for long-term development.
See this page for instructions on how to debug a submission via SSH. Once you log in, you would run the script ./run_autograder
to start the process. After the autograder finishes, the results should be in /autograder/results/results.json
.
When you are connected to gradescope via SSH, you can browse the autograder filesystem just like you would any other linux system (cd
, ls
, …). You can modify files to test out certain changes, but the changes will not be saved after you exit.