diff options
author | jwansek <eddie.atten.ea29@gmail.com> | 2022-04-28 17:52:47 +0100 |
---|---|---|
committer | jwansek <eddie.atten.ea29@gmail.com> | 2022-04-28 17:52:47 +0100 |
commit | fc2d6441596e547ba8d8c9957b092724d8bb9ae3 (patch) | |
tree | 6c5cf66c2f6057f45f37bf4a8d365fac084ca1c7 /docs/source/docker.rst | |
parent | d0f18184cb8619a1b4c1c540cf6af66eaacac239 (diff) | |
download | Smarker-fc2d6441596e547ba8d8c9957b092724d8bb9ae3.tar.gz Smarker-fc2d6441596e547ba8d8c9957b092724d8bb9ae3.zip |
Started writing documentation
Diffstat (limited to 'docs/source/docker.rst')
-rw-r--r-- | docs/source/docker.rst | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/source/docker.rst b/docs/source/docker.rst new file mode 100644 index 0000000..7c3237a --- /dev/null +++ b/docs/source/docker.rst @@ -0,0 +1,44 @@ +.. _docker: + +Running in docker +================= + +Running the system in docker has many advantages: + +* Don't have to worry about getting dependencies- the system requires many libraries to be avaliable on the PATH + +* Isolation: we are running remote code supplied by anyone, which can potentially be very dangerous. Docker isolates the dangerous code, a significant security concern + +* Makes the system be able to be used in Windows- Smarker has been tested in docker for windows using WSL for the backend + +Using docker +------------ + +We have a ``Dockerfile`` ready for use: ``sudo docker build -t smarker .`` + +To input files and get the output report we use docker volumes ``-v``. Unfortunately +docker seems to be rather buggy passing through single files, so we recommend making +a directory to pass through instead. + +Command line arguments can be replaced with environment variables, using the ``-e`` +flag in a ``key=value`` format. There is the additional environment variable ``SMARKERDEPS`` +which will pip install pypi modules at the start, deliminated with commas. + +.. code-block:: bash + + sudo docker run \ + -v "$(pwd)/../wsData.txt":/wsData.txt \ + -v "$(pwd)/100301654.zip":/tmp/100301654.zip \ + -v "$(pwd)/out/":/out/ \ + -e submission=/tmp/100301654.zip \ + -e assessment=example \ + -e SMARKERDEPS=matplotlib \ + -e format=pdf \ + -e output=/out/100301654.pdf \ + --rm smarker + +To list assessments in the database using docker: + +.. code-block:: bash + + sudo docker run -it --entrypoint python --rm smarker assessments.py --list yes
\ No newline at end of file |