The ok.py server collects submissions and displays analysis of student progress based on logging sent from client scripts.
Courses can sign up for our free hosted service on okpy.org
The ok.py software was developed for CS 61A at UC Berkeley.
View Documentation at OK Documentation
- Clone this repo
virtualenv. You can do
brew install virtualenvon a mac or
pip install virtualenvor
apt-get install python-virtualenv
- If brew cannot find
brew install pyenv-virtualenv.
- If brew cannot find
- Create a virtualenv with
virtualenv -p python3 env
- Activate the virtualenv with
- (Optional, but recommended) Install
redis-server. You can do
brew install redison a mac or
apt-get install redis-server
To run the server locally:
$ source env/bin/activate # for virtualenv $ pip install -r requirements.txt # to install libraries $ ./manage.py createdb $ ./manage.py seed $ ./manage.py server
The server will listen on http://localhost:5000.
If you are running into issues - see
documentation/SETUP.md or file an issue
To run workers locally:
$ ./manage.py worker
To be able to run the workers you should have a
redis server installed and running.
redis is not installed you can install it using your distribution's package
manager or follow Redis Quick Start.
Command Line Manager
- To view available commands run
./manage.pyonce the virtualenv is activated.
Customizing seed content
server/generate.py initializes the local server with sample content (Users, Assignments, a Course etc). You can customize it by changing the file and running
The server is developed in Python 3.5+ using Flask.
- Best-effort maintenance of student backups that occur when ok is run.
- Allow staff to comment on student composition of projects and assign grades.
- Automatic grading of student submissions
Projects using ok.py
- CS61A uses ok.py for all assignments.
- Many other UC Berkeley CS courses use ok.py
Docker + Kubernetes on Google Container Engine. See
kubernetes/kubernetes.md for more info.
The ok-server also supports deployments to Heroku or servers on any major hosting service.
There also exists a one-click setup for ok-server on Azure.
Python Style Guide
Refer to The Elements of Python Style
Some useful things for developers to know:
- Testing with ok-client
- To test with ok-client, please follow the instructions for the ok-client repo here.
- Once you are inside the virtual environment for ok-client, you can make a new binary by using the command
- Start the local ok server.
- When running the ok binary, add the flags
--insecure --server localhost:<port>to point it to the running ok-server
- To find demo assignments that you can use the binary with, look in ok-client/demo