summaryrefslogtreecommitdiff
path: root/readme.md
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@araneo.org>2015-09-14 12:46:01 +0200
committerTimotej Lazar <timotej.lazar@araneo.org>2015-09-14 12:46:01 +0200
commitd82013c214021d6e5480d18105760fa70cfc708b (patch)
treea99cbe55977263fbd681d54b432c579a868a1174 /readme.md
parent236eb936db8c11a4fe68e40838f87c9bec417ad1 (diff)
Script for adding problems to DB, update readme
Diffstat (limited to 'readme.md')
-rw-r--r--readme.md53
1 files changed, 53 insertions, 0 deletions
diff --git a/readme.md b/readme.md
new file mode 100644
index 0000000..6f891f2
--- /dev/null
+++ b/readme.md
@@ -0,0 +1,53 @@
+Deployment
+==========
+
+Install the following packages:
+
+ - apache2
+ - python3-falcon
+ - python3-ply
+ - python3-psycopg2
+ - python3-termcolor
+ - python3-waitress
+ - swi-prolog-nox
+
+Settings:
+
+ - point webroot to codeq-web
+ - set up reverse proxy for /svc/ to wsgi server:
+ ProxyPass /svc/ http://localhost:8082/
+ ProxyPassReverse /svc/ http://localhost:8082/
+ - set _path_prefix in server.problems
+ - set DB settings in db
+
+Running:
+
+ - run prolog/runner/main.pl
+ - run python/runner/main.py
+ - run daemon.py
+ - run wsgi_server.py
+
+Misc.
+=====
+
+Add a new problem to the database by running
+
+ python -m scripts.add_problem
+
+in the toplevel directory. This will ask for language and problem group (groups
+can be shared between languages, e.g. Introduction can be used for both Prolog
+and Python). The script will print the ID and path for the new problem.
+
+You can test stuff in a python interpreter:
+
+ >>> import server
+ >>> session = server.user_session.authenticate_and_create_session(<user>, <pass>)
+ >>> session.get_problem_data('python', 'introduction', 'fahrenheit_to_celsius')
+
+ >>> python = session.get_python()
+ >>> python.test(231, 180, '''print('-17.7')''')
+ >>> python.hint(231, 180, '''print('-17.7')''')
+
+ >>> prolog = session.get_prolog()
+ >>> prolog.test(231, 96, 'sister(X,Y):- parent(P,X), parent(P,Y), female(X).')
+ >>> prolog.hint(231, 96, 'sister(X,Y):- parent(P,X), parent(P,Y), female(X).')