diff --git a/docs/docker.rst b/docs/docker.rst new file mode 100644 --- /dev/null +++ b/docs/docker.rst @@ -0,0 +1,51 @@ +Graph Docker environment +======================== + +Build +----- + +.. code:: bash + + $ git clone https://forge.softwareheritage.org/source/swh-graph.git + $ cd swh-graph + $ docker build --tag swh-graph dockerfiles + +Run +--- + +.. code:: bash + + $ docker run \ + --volume /path/to/graph/:/graph \ + --volume /path/to/output/:/graph/compressed \ + --name swh-graph --tty --interactive \ + swh-graph:latest bash + +Where ``/path/to/graph`` is a directory containing the ``.edges.csv.gz`` and +``.nodes.csv.gz`` files. + +The graph compression script can be started with: + +.. code:: bash + + $ ./scripts/compress_graph.sh \ + --input /graph/graph_name \ + --output /graph/compressed \ + --lib /swh/graph-lib \ + --tmp /graph/compressed/tmp \ + --stdout /graph/compressed/stdout \ + --stderr /graph/compressed/stderr + +To dump nodes ids mapping files, use: + +.. code:: bash + + $ java -cp /swh/app/swh-graph.jar \ + org.softwareheritage.graph.backend.Setup /graph/compressed/graph_name + +Start the REST API web-service: + +.. code:: bash + + $ java -cp /swh/app/swh-graph.jar \ + org.softwareheritage.graph.App /graph/compressed/graph_name