aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
diff options
context:
space:
mode:
authorGravatar Christopher Baklid <[email protected]>2018-05-21 18:02:07 +0200
committerGravatar Christopher Baklid <[email protected]>2018-05-21 18:02:07 +0200
commit964054baf1e02fb017deec9d2f4cd8b65f19944a (patch)
tree6ce672a025c5f8c59109888f2299b4cfdf21be9b /README.md
parentInitial commit (diff)
init commit
Diffstat (limited to 'README.md')
-rw-r--r--README.md55
1 files changed, 55 insertions, 0 deletions
diff --git a/README.md b/README.md
index ead6200..3fed9cf 100644
--- a/README.md
+++ b/README.md
@@ -1,2 +1,57 @@
# snekbox
Python sandbox runners for executing code in isolation
+
+# Dependencies
+
+| dep | version (or greater) |
+|--------|----------------------|
+| python | 3.6.5 |
+| pip | 10.0.1 |
+| pipenv | 2018.05.18 |
+| docker | 18.03.1-ce |
+
+
+## Setup local test
+
+install python packages
+
+```bash
+pipenv sync
+```
+
+Start a rabbitmq instance and get the container IP
+
+```bash
+docker run --name rmq -d rabbitmq:3.7.5-alpine
+docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' rmq
+# expected output with default setting: 172.17.0.2
+# If not, change the runner/config.py file to match
+```
+
+## Test the code
+
+use two terminals!
+
+```bash
+#terminal 1
+pipenv run python runner/consume.py
+
+#terminal 2
+pipenv run python runner/publish.py
+```
+
+The publish will put a message on the message queue
+and the consumer will pick it up and do stuff
+
+## Build and run the consumer in a container
+
+```bash
+docker build -t snekbox:latest -f docker/Dockerfile .
+
+#terminal 1
+docker run --name snekbox -d snekbox:latest
+docker logs snekbox -f
+
+#terminal 2
+pipenv run python runner/publish.py
+```