Skip to content
Snippets Groups Projects
Verified Commit cc5227ab authored by Yoann Schneider's avatar Yoann Schneider :tennis:
Browse files

draft configure documentation

parent 4561df33
No related branches found
No related tags found
No related merge requests found
Pipeline #80028 passed
# Configuration
When the worker is running over elements, be it locally or on Arkindex, the first step before actually doing
anything is configuration. This process is implemented in the `configure` method that a worker
inherits from [ElementsWorker][elements_worker] and [BaseWorker][base_worker].
This method can also be overloaded if the worker needs additional configuration steps.
The developer mode was designed to help worker developers reproduce and test how their worker
would behave on Arkindex. This is why the configuration process in this mode mirrors the operation while
replacing API calls by CLI arguments.
The developer mode is enabled when at least one of three events occur:
- the `--dev` CLI arguments is used,
- the `WORKER_VERSION_ID` variable was not set in the environment,
- the `ARKINDEX_WORKER_RUN` variable was not set in the environment.
None of these happen when running on Arkindex.
## Developer mode
- The worker's configuration YAML with variable needed by the worker
contains also the list of secrets needed by the worker. See [secrets][].
- ARKINDEX_CORPUS_ID to specify which corpus the processed elements belong to
- Local secrets loading
- DEBUG mode
When implementing a new worker, some additional logs might be needed to properly investigate
why something is not working as intended. The logging level can be set to the `DEBUG` level via either
- the `--verbose` CLI arguments,
- setting the `ARKINDEX_DEBUG` to `True` in the environment,
- specifying the `"debug": True` in the worker's configuration via the `user_configuration`.
For more information, see [how to use the user_configuration][user-config].
## Arkindex mode
- DEBUG mode
- RetrieveWorkerRun, what is a worker run. link to arkindex api ? what information does it give
- user_configuration loading
reading default values and storing them in the config
- secrets actual loading
- overriding the config with worker's configuration
[elements_worker]: /../../../ref/elements_worker#elements-worker
[base_worker]: /../../ref/base_worker#base-worker
[user-config]: /../workers/yaml.md#setting-up-user-configurable-parameters
# Worker Implementation
......@@ -70,6 +70,9 @@ nav:
- Using secrets in workers:
- contents/secrets/index.md
- Usage: contents/secrets/usage.md
- Worker Implementation:
- contents/implem/index.md
- Configuration: contents/implem/configure.md
- Python Reference:
- Base Worker: ref/base_worker.md
- Elements Worker: ref/elements_worker.md
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment