- Follow the instructions here to install docker.
- Then install docker compose by following this.
- Clone this respository and go to the root directory of this repo.
- Create a network using
docker network create code_runner_net
.- Build the docker images using
docker-compose build
.cd
to the runner directory and again rundocker-compose build
to build the runner images.- Install docker-sync using
gem install docker-sync
. Make sure that the gem is in yourPATH
.- Inside the repos' root directory run
docker-sync-stack start
. If you get an error then stop the containers and restart using the same command.
- Inside the repos' root directory create a new python environment using
python3 -m venv env
and activate it by runningsource env/bin/activate
.- Install all the dependencies using
pip3 install -r code_runner/requirements/requirements.txt
. If you get an error in building psycopg2 then you must be missing necessary packages for building it.- Install rabbitmq by following this link.
- Setup rabbitmq user by running
chmod +x shell_scripts/init_rabbitmq.sh && sh shell_scripts/init_rabbitmq.sh
.- Install postgreSQL and configure the database credentials. After that create a database named code_runner.
- Modify the .env.development.local and change all hosts to localhost and change the passwords.
- Start the flask development server by running
python3 wsgi.py
.- Open another terminal and navigate to the repos' root and start celery worker by running
celery -A tasks worker --logLevel=DEBUG
.- You can now test it by visting
http://localhost:5000
.
I have created a public workspace on postman. You can test it from there and it can be used as a reference for API schema. Here's the link