FATE Flow has designed an algorithm component registry module to support multiple algorithm vendors, versions, and various execution modes.
Definition: $name:$version@device
, such as fate:2.0.0@local
- name: Algorithm provider vendor
- version: Algorithm version
- device: Algorithm execution mode, e.g., docker, k8s, local, etc.
- Registration command:
flow provider register -c examples/provider/register.json
- Registering a local algorithm package requires providing the algorithm package path (
path
) and optionally the Python environment path (if not provided, the system environment will be used).
{
"name": "fate",
"device": "local",
"version": "2.0.1",
"metadata": {
"path": "/Users/tonly/FATE/python",
"venv": "/Users/tonly/opt/anaconda3/envs/fate3.8/bin/python"
}
}
- Registering a docker-based algorithm image:
{
"name": "fate",
"device": "docker",
"version": "2.0.0",
"metadata": {
"base_url": "",
"image": "federatedai/fate:2.0.0"
},
"protocol": "bfia",
"components_description": {}
}
- Command:
flow provider register --name fate --version 2.0.1 --device local
- Output:
{
"code": 0,
"data": [
{
"create_time": 1703762542058,
"device": "local",
"metadata": {
"path": "/Users/tonly/FATE/python",
"venv": "/Users/tonly/opt/anaconda3/envs/fate3.8/bin/python"
},
"name": "fate",
"provider_name": "fate:2.0.1@local",
"update_time": 1703762542058,
"version": "2.0.1"
}
],
"message": "success"
}
Used for deleting a registered algorithm.
- Command:
flow provider delete --name fate --version 2.0.1 --device local
- Output:
{
"code": 0,
"data": true,
"message": "success"
}
- Registering algorithms
- Task configuration carrying the provider parameter, see the configuration methods below
dag:
conf:
task:
provider: fate:2.0.1@local
All tasks under the job inherit this provider.
dag:
party_tasks:
guest_9999:
parties:
- party_id:
- '9999'
role: guest
conf:
provider: fate:2.0.1@local
All tasks under guest 9999 inherit this provider.
dag:
tasks:
reader_0:
conf:
provider: fate:2.0.1@local
component_ref: reader
All reader components across all parties inherit this provider.
dag:
party_tasks:
guest_9999:
parties:
- party_id:
- '9999'
role: guest
tasks:
reader_0:
conf:
provider: fate:2.0.1@local
The reader component under guest 9999 specifically inherits this provider.