configuration_parsing[CLI config argument parsing] --> corpus_id[Read Corpus ID from environment]
corpus_id --> load_secrets[Load secret in local developer storage]
end
end
classDef pyMeth font-style:italic
```
## Arkindex mode
The details of a worker execution (what is called a **WorkerRun**) on Arkindex are stored in the backend. The first step of the configuration is to retrieve this information using the Arkindex API. The [RetrieveWorkerRun](https://demo.arkindex.org/api-docs/#tag/process/operation/RetrieveWorkerRun) endpoint gives information about:
...
...
@@ -27,7 +64,7 @@ The details of a worker execution (what is called a **WorkerRun**) on Arkindex a
- the model version used in this worker execution,
- the configuration stored in this model version.
This step shows that there are a lot of sources for the actual configuration that the worker will use. The principal is that the user always has the last word. Any parameter the user chooses will override whatever was previously set in other configurations.
This step shows that there are a lot of sources for the actual configuration that the worker can use. Nothing is overridden by default, the worker has to do it in its overridden version of the configure method. In the end, any parameter set by the user **must** be applied over other known configurations.
The worker configuration may specify default values for some parameters (see [this section](../workers/yaml.md#setting-up-user-configurable-parameters) for more details about worker configuration). These default values are stored in the `user_configuration` dictionary attribute.
The following graph describes what happens when running the worker, either on Arkindex or locally. Words in italic font are actual method calls in the worker.
```mermaid
flowchart LR
subgraph all[Worker execution]
direction LR
subgraph id1[Worker initialization]
init
end
run -.-> configure
subgraph id2[Inference]
direction TB
configure --> list_elements
list_elements --> element_processing
subgraph id3[Loop over each element]
element_processing --> element_processing
end
element_processing -- Save ML report to disk --> reporting
end
init --> run
end
classDef pyMeth font-style:italic
class init,run,configure,list_elements pyMeth
```
More details about the `element_processing` step.
```mermaid
flowchart LR
subgraph all[Element processing]
direction LR
subgraph id1[Element details retrieval]
retrieve_element
end
retrieve_element --> update_activity_started
subgraph id2[Processing]
direction LR
update_activity_started[update_activity] --> process_element -- No errors --> update_activity_processed
update_activity_started -- to Started --> update_activity_started
update_activity_processed[update_activity] -- to Processed --> update_activity_processed
update_activity_error[update_activity] -- to Error --> update_activity_error
end
process_element -- Errors found --> update_activity_error
end
classDef pyMeth font-style:italic
class process_element,update_activity_started,update_activity_error,update_activity_processed pyMeth