gmuraru / acs-interface

UI for Vmchecker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

V2 vmchecker

Rewrite of the original vmchecker. This repo is for the student portal. It runs at https://v2.vmchecker.cs.pub.ro/.

Build Status codecov

Development

Try the Vagrant method first. It requires VirtualBox and Vagrant to be installed.

Vagrant

If anything goes wrong, check out bugs labelled "build", and please report any bugs you encounter, that are not already documented.

Clone the repo and create an .env file inside:

MINIO_ADDRESS=10.66.60.1:9000
MINIO_ACCESS_KEY=1234
MINIO_SECRET_KEY=123456789
VMCK_API_URL=http://10.66.60.1:10000/v0/
DEBUG=True
HOSTNAME=*
ACS_INTERFACE_ADDRESS=http://10.66.60.1:8000
MANAGER_TAG=0.3.2

Now run:

vagrant up

If all goes well, it should print ✔ acs-interface installed successfully. Next, log you into the Vagrant virtual machine, and start Django:

vagrant ssh
cd /vagrant
pipenv run ./manage.py runserver 10.66.60.1:8000

Django's port is forwarded to http://localhost:8000. A default admin user is created with password admin, along with some sample content.

Some more forwarded ports:

Install locally

Install dependencies:

sudo apt-get update
sudo apt-get install libsasl2-dev python-dev libldap2-dev libssl-dev docker
sudo pip3 install pipenv
pipenv install

You need a running vmck instance. Also a Nomad-Consul-Vault cluster is required - [liquid/cluster][] - to run vmck.

Run:

pipenv run ./examples/minio.sh
pipenv run ./manage.py migrate
pipenv run ./manage.py loaddata ci/fixtures.json
pipenv run ./manage.py runserver

Now the vmck/acs-interface is available at http://localhost:8000 and the minio blob storage server at http://localhost:9000. You can log in with the user admin, password admin. There is a test course and assignment created from fixtures.

To stop, hit CTRL-C in the terminal where you started runserver, and docker stop storage to stop the minio server.

Deploy on cluster

The deployment is orchestrated at https://github.com/vmck/acs-deploy - it's the living documentation and single instance of how to run this thing in production.

Add new homework

  1. Set up the assignment files in a GitHub repository. You can share a repository for a whole course and have each assignment in a subfolder.

    The specified repository should contain the tests and the checker script in a subfolder for the assignment.

    It should also contain a checker.sh file (it does some unzip work) and a config.ini file (has specified the virtual machine where the homework would be run).

    See pc-00 for an example.

  2. You need to have access to the admin page for V2 vmchecker.

  3. Click on adding a new Assignment

  • Select the course (mandatory field);
  • Add a code for the homework. It should respect a pattern, like course_initials-homework_number; example pc-01;
  • Give a name to the homework;
  • Set a maximum score (the minimum score is 0, if the total score is negative it will be clipped);
  • Add the soft and hard deadlines (mandatory fields);
  • Add a repo URL - when evaluating a homework the repo URL and the below specified branch will be used for testing;
  • Set repo_branch, or leave blank to use master
  • Set repo_path to a folder of the repository that contains the assignment files

Running tests

Unit + Integration tests

For running the tests you need to:

  1. Have the vagrant machine up
  2. Access vagrant using:
vagrant ssh
  1. Go to /vagrant
  2. Run:
pipenv run pytest --liveserver 10.66.60.1:8000 testsuite

Stress Tests

We are using locust.io for running the stress tests. You need to install it:

pip install locust

For running the tests you need to do the following:

If you want to test locally:

  1. Have the vagrant machine up
  2. Access vagrant using:
vagrant ssh
  1. Start the server using:
pipenv run ./manage.py runserver 10.66.60.1:8000
  1. Run (not in the vagrant ssh session):
locust -f testsuite/stress/locust.py
  1. Open http://localhost:8089/ and specify the wanted parameters and run it!

About

UI for Vmchecker


Languages

Language:Python 82.7%Language:HTML 9.3%Language:HCL 6.0%Language:Shell 1.7%Language:Dockerfile 0.4%