Aller au contenu

Management commands

Ce contenu n’est pas encore disponible dans votre langue.

madbot is a Django application: besides Django’s own commands (migrate, createsuperuser, collectstatic…), it adds the commands below. Run them with the madbot entry point of the API package, for example madbot list_plugins. From a development checkout, prefix them with pixi run in api/.

Every command accepts Django’s common options, including --verbosity {0,1,2,3} and --help.

Start a Celery worker. When DEBUG is on, the worker restarts whenever the code changes.

Start Celery Beat, the scheduler of the periodic tasks, with the database scheduler of django-celery-beat. It warns when no periodic task exists: run create_periodic_tasks first.

Create or update the metadata schemas and the fields of the madbot referential in the database. Run it after each update of madbot.

Delete all periodic tasks, then create the tasks of madbot:

TaskInterval
Clear health checks task resultsevery hour
Close expired impersonation sessionsevery hour
Cleanup node exportsevery day

Read every installed plugin and store in the database its connection and settings schemas, its metadata object types and the mappings between its fields and the madbot metadata fields. Run it after installing, removing or updating a plugin.

List the installed plugins by type, then say which plugins_api is imported: the released package or a local checkout.

OptionEffect
--type {connection,data,submission,metadata,all}Only list one type of plugin (default: all).
--verbosity 1Plugin names only.
--verbosity 2Plugins grouped by type (default).
--verbosity 3Plugins grouped by type, with details.

Delete the inactive accounts whose email address was never verified, once the confirmation period (ACCOUNT_EMAIL_CONFIRMATION_EXPIRE_DAYS) is over, then delete the expired invitations.

Configure and (re)populate the Meilisearch workspace_search index from the current database. Requires SEARCH_ENABLED=true and a reachable Meilisearch server; see Enable the global search and Start Meilisearch.

The command writes every searchable object, then removes documents for objects that no longer exist. It does not empty the index first, so the search keeps answering while it runs. Run it after enabling the search, and after upgrades that change filterable attributes. Day-to-day updates then go through Celery.

OptionEffect
--batch-sizeNumber of documents sent to Meilisearch per batch (default: 1000).

These commands create workspaces for development and tests. Do not run them on a production instance.

Create a demo workspace for a user: an ISA structure (investigation, study, assay) with samples and data.

OptionEffect
-u, --usernameOwner of the workspace. Required.

Generate a large and reproducible workspace, to test performance. Measure on a large workspace describes the profiles and what the command bypasses.

OptionEffect
--usernameOwner of the workspace. Required.
--profile {small,medium,large}Predefined volume, refined by the options below (default: small).
--root-nodes, --depth, --node-per-nodeShape of the trees.
--data-per-node, --samples-per-nodeData and samples of each node.
--metadata-per-object, --metadata-per-dataMetadata of nodes, samples and data.
--membersMembers invited besides the owner.
--wide-nodes, --wide-node-sizeNodes with many samples and data, added under the root nodes.
--plugin-fields [PLUGIN ...]Plugins whose metadata fields are used besides madbot’s (default: ena). Without a value, only madbot fields.
--pluginData plugin of the connection holding the data (default: the first installed data plugin).
--seedSeed of the generation. Drawn and printed when omitted.
--nameName of the workspace (default: derived from the profile and the seed).
--forceDelete an existing workspace of the same name first.
--dry-runPrint the planned volume without writing anything.