How to setup and submit lab O and exercises

Setup and submission

Please follow the following steps to prepare your individual exercise/lab O environment and submit your work in the end.

 

Preparation

If you are not familiar with GitHub, you could read some tutorials like "GitHub Guides Links to an external site." first. Or just simply search "how to use github" for more information. All the exercise work will be done and submitted on KTH GitHub. If you haven't registered yourself yet, please visit the website and initialize your account. N.B. If you have not used KTH GitHub before then it is good to know that you will need to setup an ssh key in your KTH GitHub account and make sure that you use the ssh URL when you clone a repository or add a remote.

 

Your personal exercise repository

  • We have created a private repository for you in https://gits-15.sys.kth.se/dd239-2022 named "exercises-{your_kth_id}".
    • If you don't see your repository with your KTH username it means you were not registered in GitS when we created the repositories. Ask for a repository in the VM, Gits, repos, setup discussion forum  to get your repository.
  • You can clone your personal repository by using git clone {your_repository_ssh_url}. You find this URL in the usual place in the github user interface.
    • The URL should be: git@gits-15.sys.kth.se:dd239-2022/exercises-{your_kth_id}
  • Notice that further updates may be pushed to the public repository https://gits-15.sys.kth.se/dd239-2022/exercises. Therefore it is good practice to add it to your KTH github watching list. In this way you will be notified about updates that we make there. (We will also make a Canvas announcement if this happens.)

 

Working on the exercises

  • All the exercises are written and tested in Python 3. If you are using Python 2 usually, I recommend to use Pyenv or Virtualenv to setup a local Python 3 environment for the exercises.
  • Regarding python modules, some exercises will require more modules, you could use pip/easy_install to install them. For Windows users, you might need prebuilt binaries Links to an external site.. (Thanks to Joakim Ericsson for the info)

 

Submitting your code for testing

  • When you want to submit a version for testing, please make a commit whose message contains "#grading" (quotation marks are not necessarily needed), and push it to your remote repo. Then you will receive your testing result as a new comment on the commit page. An example is given as follows.
  • Note that you should not rename or create new files, just finishing those empty methods should work perfectly :)
  • Completion of the programming exercises and lab O are reported to Canvas every 6th hour (00:00, 06:00, 12:00, 18:00).

 

An example about how to submit code for grading

  1. Get the repository: git clone git@gits-15.sys.kth.se/dd239-2022/exercises-{your_kth_id}
  2. cd exercises-"username"
  3. Checkout problem branch: git checkout [hash|dos|malware|buffer-overflow|side-channel]
  4. Read README.md and solve the problem. Test your solution with ./test.py
  5. git add "solution file"
  6. Make and push your commit with a message that contains "#grading", the commit with message "#grading" must be the last commit of the push.
    1. git commit -m "yeah, this commit is ready for #grading"
      or if your commit is empty (nothing has changed)
      git commit -m "yeah, this commit is ready for #grading" --allow-empty
    2. git push
  7. On your commit page, you'll see testing result (Pass or FAILED) as a new comment
grader_1-1.JPG
grader_1-2.JPG