Skip to content
Snippets Groups Projects

Configure method documentation

Merged Yoann Schneider requested to merge configure-method-documentation into master
All threads resolved!
3 files
+ 53
0
Compare changes
  • Side-by-side
  • Inline
Files
3
+ 48
0
# 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
Loading