ok.py supports programming projects by running tests, tracking progress, and assisting in debugging.
Clone or download
Permalink
Failed to load latest commit information.
.circleci Upgrade to CircleCi version 2 (#1302) Jul 2, 2018
azure Enable autopy-server to replicate across nodes (#1317) Aug 2, 2018
docker Parameterize log level (#1315) Jul 13, 2018
documentation Changes all instances of Cal-CS-61A-Staff -> okpy (#1314) Jul 13, 2018
kubernetes Updated kubernetes deploy instructions Nov 10, 2017
migrations Add support for Azure MySQL (#1260) May 7, 2018
server Fix datetimepicker to choose from 24hr (#1326) Sep 30, 2018
tests Run nginx and gunicorn in docker via supervisor (#1313) Jul 13, 2018
.buildpacks Cleanup Root Folder (#746) Jul 2, 2016
.checkignore exclude only tests/files, so that tests are covered too Jun 15, 2016
.coveragerc Use CircleCI and ignore jobs for coverage Oct 6, 2016
.dockerignore Switch to pessimistic SQL disconnect handling (#1284) May 31, 2018
.gitignore Switch to pessimistic SQL disconnect handling (#1284) May 31, 2018
.pyup.yml Create .pyup.yml Apr 3, 2017
.travis.yml Add encrypted Google Cloud Storage env vars to CI (#1287) Jun 26, 2018
BaltimoreCyberTrustRoot.crt.pem Add support for Azure MySQL (#1260) May 7, 2018
Dockerfile Parameterize log level (#1315) Jul 13, 2018
LICENSE Remove ok v1 files Dec 30, 2015
Makefile Make pip install during build more reliable (#1270) May 7, 2018
Procfile remove useless procfile change Aug 30, 2016
README.md Switch Azure deployment to Kubernetes (#1301) Jul 6, 2018
manage.py Run nginx and gunicorn in docker via supervisor (#1313) Jul 13, 2018
requirements.txt Revert "PR has been merged can now use upstream webassets (#1331)" (#… Oct 12, 2018
runtime.txt Cleanup Root Folder (#746) Jul 2, 2016
setup.cfg Composition Grading & Various Fixes May 30, 2016
worker.py Run nginx and gunicorn in docker via supervisor (#1313) Jul 13, 2018
wsgi.py Run nginx and gunicorn in docker via supervisor (#1313) Jul 13, 2018

README.md

Logo

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.

Build Status Coverage Status Docker Repository on Quay

View Documentation at OK Documentation

Installation

To install:

  • Clone this repo
  • Install virtualenv. You can do brew install virtualenv on a mac or pip install virtualenv or apt-get install python-virtualenv
    • If brew cannot find virtualenv, use brew install pyenv-virtualenv.
  • Create a virtualenv with virtualenv -p python3 env
  • Activate the virtualenv with source env/bin/activate
  • (Optional, but recommended) Install redis-server. You can do brew install redis on a mac or apt-get install redis-server

Local 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

Running Workers

To run workers locally:

$ ./manage.py worker

To be able to run the workers you should have a redis server installed and running.

If 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.py once 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 ./manage.py resetdb.

Server Development

The server is developed in Python 3.5+ using Flask.

Core Features

Backup Maintenance

  • Best-effort maintenance of student backups that occur when ok is run.

Composition Grading

  • Allow staff to comment on student composition of projects and assign grades.

Autograding

  • 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

Developer Guidelines

See documentation/CONTRIBUTING.md

Recent activity:

Throughput Graph

Deploying

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:

  1. 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 ok-publish.
    • 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