.. _debusine-admin-cli: ========================== The debusine-admin command ========================== The ``debusine-admin`` command is the usual `django-admin `_ command of a Django project. But debusine adds many `custom management commands `_ that are documented on this page. This command must be executed on the server while connected as the ``debusine-server`` user. For example, to run the command ``check``: .. code-block:: console $ sudo -u debusine-server debusine-admin check For commands that are currently undocumented, you can still explore their features by using the ``--help`` command line option: .. code-block:: console $ sudo -u debusine-server debusine-admin edit_worker_metadata --help Command output -------------- If a command is successful: nothing is printed and the return code is 0. Managing workers ---------------- ``manage_worker`` ~~~~~~~~~~~~~~~~~ The command ``manage_worker`` has two actions: **enable** and **disable**. Workers are **disabled** by default: they do not receive any tasks to run. To enable a worker find its name or its token using the ``list_workers`` command and then enable the worker using the ``manage_worker``. To enable the worker ``worker-01``: .. code-block:: console $ sudo -u debusine-server debusine-admin manage_worker enable worker-01 To disable a worker: use ``disable`` instead of ``enable``. .. _debusine-admin-edit-worker-metadata: ``edit_worker_metadata`` ~~~~~~~~~~~~~~~~~~~~~~~~ A debusine sysadmin can attach static metadata to a worker. To edit the worker metadata for ``worker-01`` you would run: .. code-block:: console $ sudo -u debusine-server debusine-admin edit_worker_metadata worker-01 This launches ``sensible-editor`` on a file with the current metadata. The worker metadata is presented (and expected to be formatted) in YAML. .. note:: The initial metadata is presented as an empty dictionary (``{}``). That line should be deleted when you start inputting your own metadata. When exiting the editor, the worker metadata will be updated with whatever got saved in the edited file (except if the YAML turns out to be invalid). For non-interactive use, you can store the metadata in a file, and pass that file with ``--set``: .. code-block:: console $ cat > /tmp/metadata <