Skip to content

Set up an assignment

George-Cristian Muraru edited this page Jan 2, 2021 · 9 revisions

Setting up an assignment has three parts:

  1. Building a VM image specific to your requirements
  2. Configuring a GitHub repository
  3. Configuring VMCK v2 to supply itself from that repo

Building a VM image

This is the part where you customize the submissions' testing environment. Please refer to vmck/image-builder on how to build such an image. If you built your image by creating a branch on vmck/image-builder then your VM image is already deployed on the server otherwise if you built it locally you must have it archived as a tar.gz and moved on the VMCK server.

To do so contact one of the maintainers.

Rsync is used to synchronize the images from the CI (where the image is built) and the Compute (where we run the assignments).

The sync cron job runs (at the moment) every 1 minute, but because the sync process might take some time (to copy the images from the CI to the Compute machines) we recommend waiting for at least 5 minutes.

Configuring a GitHub repository

You can use an existing repository by creating a folder or a new branch. You can also use a new repository if you wish. In there you must have the following files:

  • checker.sh
  • artifact.zip

artifact.zip

This is the archive that contains your tests and any other files that you require on the VM.

checker.sh

This is the script that is run on the machine. It is at the root of the folder /vagrant. Initially when the machine is started the folder structure is the following:
/vagrant/
|---> checker.sh
|---> artifact.zip
|---> archive.zip

In the script, you must first unzip both files before you can continue with the actual testing. (archive.zip is the student's archive)

NOTE: The machine has a network restriction, so you cannot connect to the internet.

An example of a configured repository can be found here.

Configuring VMCK

Requirements:

  • You need to have access to the admin page for V2 vmchecker.
  • You must have a course set up.

Creating an assignment:

  1. Go to https://v2.vmchecker.cs.pub.ro/admin/ and login
  2. Under Interface click on Assignments
  3. Click on Add Assignment in the upper right corner
  4. You will be presented with the following fields that you must fill:
  • Course - Select the course id to which your assignment belongs
  • Code - Unique identifier of your assignment. It should respect a pattern, like {code_id}-{homework_number}. (e.g. pc-01)
  • Max Score - Maximum score of your assignment. Usually, it excludes any bonus points for the assignment. This field is only for esthetic reasons and it does not influence any logic. (Note: the minimum score is 0, if the total score is negative it will be clipped)
  • Deadline soft - The date and time after which the penalty points apply to a submission's score.
  • Deadline hard - The date and time after which a student is unable to upload.
  • Min time between uploads - Time, in seconds, before a student can create a new submission.
  • Repo url - URL to the GitHub repository where the checker is published (e.g.: https://github.com/vmck/assignment)
  • Repo branch - Name of the branch for that repository (Note: Left empty, it defaults to master)
  • Repo path - Path to the folder where your checker is located (e.g. path/in/repository).
  • Language - The programming language in which the students' solutions will be coded. This is intended to let MOSS know what programming language is used. (Note: If you do not intend to use MOSS you can leave the setting on default, i.e. c)
  • Image path - this is the path on the server to the image that you built at step 1. Usually, this field will only have the name of the file (e.g. assignment1.qcow2.tar.gz).
  • Penalty info - json composed of:
{"holday_finish": [], "holiday_start": [], "penalty_weights": []}
  • penalty_weights - comma-separated values The [PENALTY] section has the following option:

Before 24h have passed after the soft deadline: --> Student_score = Score_from_tests - PenaltyWeights[0]

After 24h but before 48h have passed after the soft deadline: --> Student_score = Score_from_tests - PenaltyWeights[0] - PenaltyWeights[1]

  • Vm options
    • memory - this field defines how much memory (in MB) should the machine have.
    • nr_cpus - defines how much computational power the machine should have. Currently, 1 core is equivalent to 3 GHz.

NOTE: For the resources, we recommend 1 CPU and 512 MB of ram or a maximum of 1024 MB of ram.