cli.rst 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. Command Line Reference
  2. ======================
  3. Lakesuperior comes with some command-line tools aimed at several purposes.
  4. If Lakesuperior is installed via ``pip``, all tools can be invoked as normal
  5. commands (i.e. they are in the virtualenv ``PATH``).
  6. The tools are currently not directly available on Docker instances (*TODO add
  7. instructions and/or code changes to access them*).
  8. ``fcrepo``
  9. ----------
  10. This is the main server command. It has no parameters. The command spawns
  11. Gunicorn workers (as many as set up in the configuration) and can be sent in
  12. the background, or started via init script.
  13. The tool must be run in the same virtual environment Lakesuperior
  14. was installed in (if it was)—i.e.::
  15. source <virtualenv root>/bin/activate
  16. must be run before running the server.
  17. In the case an init script is used, ``coilmq`` (belonging to a 3rd party
  18. package) needs to be launched as well; unless a message broker is already set
  19. up, or if messaging is disabled in the configuration.
  20. ``lsup-admin``
  21. --------------
  22. ``lsup-admin`` is the principal repository management tool. It is
  23. self-documented, so this is just a redundant overview::
  24. $ lsup-admin
  25. Usage: lsup-admin [OPTIONS] COMMAND [ARGS]...
  26. Options:
  27. --help Show this message and exit.
  28. Commands:
  29. bootstrap Bootstrap binary and graph stores.
  30. check_fixity [STUB] Check fixity of a resource.
  31. check_refint Check referential integrity.
  32. cleanup [STUB] Clean up orphan database items.
  33. migrate Migrate an LDP repository to Lakesuperior.
  34. stats Print repository statistics.
  35. All entries marked ``[STUB]`` are not yet implemented, however the
  36. ``lsup_admin <command> --help`` command will issue a description of what
  37. the command is meant to do. Check the
  38. `issues page <https://github.com/scossu/lakesuperior/issues>`__ for what's on
  39. the radar.
  40. All of the above commands are also available via, and based upon, the
  41. native Python API.
  42. ``lsup-benchmark``
  43. ------------------
  44. ``lsup-benchmark`` is used to run performance tests in a predictable way.
  45. The command has no options but prompts the user for a few settings
  46. interactively (N.B. this may change in favor of parameters).
  47. The benchmark tool is able to create RDF sources, or non-RDF, or an equal mix
  48. of them, via POST or PUT, in the currently running Lakesuperior server. It
  49. runs single-threaded.
  50. The RDF sources are randomly generated graphs of consistent size and
  51. complexity. They include a mix of in-repository references, literals, and
  52. external URIs. Each graph has 200 triples.
  53. The non-RDF sources are randomly generated 1024x1024 pixel PNG images.
  54. You are warmly encouraged to run the script and share the performance results (
  55. *TODO add template for posting results*).
  56. ``profiler``
  57. ------------
  58. This command launches a single-threaded HTTP server (Flask) on port 5000 that
  59. logs profiling information. This is useful for analyzing application
  60. performance.
  61. For more information, consult the `Python profilers guide
  62. <https://docs.python.org/3/library/profile.html>`__.
  63. Do not launch this while a WSGI server (``fcrepo``) is already running, because
  64. that also launches a Flask server on port 5000.