-
Notifications
You must be signed in to change notification settings - Fork 84
Deploying OK as a self hosted service
Sumukh Sridhara edited this page Nov 2, 2016
·
3 revisions
This document will cover the process of self hosting OK. If you are planning to do so, we encourage you to contact us!
The hosted version of OK is running Google Container Engine/Kuberentes. If you want to follow that route, instructions are provided in the kubernetes
folder.
What you will need:
- A Linux Server to deploy the OK Server
- A Google Developer Project Key. You can create one with the google developer's console
- See the instructions here: https://support.google.com/cloud/answer/6158849?hl=en
- [Autograding] A server capable of running Docker
- (Optional but recommended) A hosted MySQL database (like Google Cloud MySQL or AWS RDS)
Configuration:
- Get you Google ID and Google Secret ready
- Database URL or use MySQL
On Heroku:
Configure the environment variables & run heroku push
Steps to deploy on your own machine:
- Install Python35 and Git
sudo apt-get install python3 git-core
- Clone the repository
git clone [email protected]:Cal-CS-61A-Staff/ok.git
- Set the
- Follow the setup instructions
pip install -r requirements.txt
- Set the following environment variables
export GOOGLE_ID=<YOURGOOGLEID>
export GOOGLE_SECRET=<YOURGOOGLESECRET>
export DATABASE_URL=sqlite:///../oksqlite.db # Your mysql connection URL here
export OK_ENV=simple
To run OK use the following command:
gunicorn -b 0.0.0.0:5000 wsgi:app
To run on port 80 - either run the following command
-
sudo gunicorn -b 0.0.0.0:80 wsgi:app
(highly discouraged) - or run nginx with proxy pass to port 5000
To setup autograding consult the instructions in the autograding repo.