# Hestia Engine Orchestrator
Orchestrate your different models to run on a Cycle, an ImpactAssessment or a Site.
## Documentation
Documentation can be found in the [source folder](./hestia_earth/orchestrator).
## Install
1. Install the library:
```bash
pip install hestia_earth.orchestrator
```
You can now install your own models or follow the steps below to use the default Hestia models.
### Install the Hestia Models
If you want to use the [hestia default models](/hestia-earth/hestia-engine-models), follow these steps:
1. Install the library:
```bash
pip install hestia_earth.models
```
2. Download the latest configuration files:
```bash
curl https://gitlab.com/hestia-earth/hestia-engine-orchestrator/-/raw/master/scripts/download_config.sh?inline=false -o download_config.sh && chmod +x download_config.sh
# pip default install directory is /usr/local/lib/python<version>/site-packages
./download_config.sh <pip install directory>
```
### Using your own models
You can create your own models in addition (or instead of) the default set of models provided by Hestia.
The model needs to expose only one method:
```python
def run(key: str, data): ...
```
It will be given the data that has been given to the orchestrator, i.e. by calling:
```python
from hestia_earth.orchestrator import run
my_data = {'@type': 'Cycle', 'inputs': []}
config = {
"models": [{
"key": "inputs",
"model": "my_model",
"value": "my_model_value",
"runStrategy": "add_if_missing_key"
}]
}
run(my_data, config)
```
Will be calling in your own model `my_model.py`:
```python
def run('my_model_value', my_data: dict): ...
```
### Usage
```python
# will work with either Cycle or Site
from hestia_earth.orchestrator import run
# cycle is a JSONLD node cycle
cycle = {'@type': 'Cycle', ...}
result = run(cycle, '/path/to/my-config.json') # configuration stored in a file
print(result)
```
Raw data
{
"_id": null,
"home_page": "https://gitlab.com/hestia-earth/hestia-engine-orchestrator",
"name": "hestia-earth-orchestrator",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Hestia Team",
"author_email": "guillaumeroyer.mail@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/ac/00/bc442c9ceb9a4413cdee13682544d88fdfa435b682b8437f1ced36ac27da/hestia-earth-orchestrator-0.6.9.tar.gz",
"platform": null,
"description": "# Hestia Engine Orchestrator\n\nOrchestrate your different models to run on a Cycle, an ImpactAssessment or a Site.\n\n## Documentation\n\nDocumentation can be found in the [source folder](./hestia_earth/orchestrator).\n\n## Install\n\n1. Install the library:\n```bash\npip install hestia_earth.orchestrator\n```\n\nYou can now install your own models or follow the steps below to use the default Hestia models.\n\n### Install the Hestia Models\n\nIf you want to use the [hestia default models](/hestia-earth/hestia-engine-models), follow these steps:\n\n1. Install the library:\n```bash\npip install hestia_earth.models\n```\n2. Download the latest configuration files:\n```bash\ncurl https://gitlab.com/hestia-earth/hestia-engine-orchestrator/-/raw/master/scripts/download_config.sh?inline=false -o download_config.sh && chmod +x download_config.sh\n# pip default install directory is /usr/local/lib/python<version>/site-packages\n./download_config.sh <pip install directory>\n```\n\n### Using your own models\n\nYou can create your own models in addition (or instead of) the default set of models provided by Hestia.\n\nThe model needs to expose only one method:\n```python\ndef run(key: str, data): ...\n```\nIt will be given the data that has been given to the orchestrator, i.e. by calling:\n```python\nfrom hestia_earth.orchestrator import run\n\nmy_data = {'@type': 'Cycle', 'inputs': []}\nconfig = {\n \"models\": [{\n \"key\": \"inputs\",\n \"model\": \"my_model\",\n \"value\": \"my_model_value\",\n \"runStrategy\": \"add_if_missing_key\"\n }]\n}\nrun(my_data, config)\n```\nWill be calling in your own model `my_model.py`:\n```python\ndef run('my_model_value', my_data: dict): ...\n```\n\n### Usage\n\n```python\n# will work with either Cycle or Site\nfrom hestia_earth.orchestrator import run\n\n# cycle is a JSONLD node cycle\ncycle = {'@type': 'Cycle', ...}\nresult = run(cycle, '/path/to/my-config.json') # configuration stored in a file\nprint(result)\n```\n\n\n",
"bugtrack_url": null,
"license": "GPL",
"summary": "Hestia's module to orchestrate the models.",
"version": "0.6.9",
"project_urls": {
"Homepage": "https://gitlab.com/hestia-earth/hestia-engine-orchestrator"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "31388c917a8f660c41303ee615aeefb95b3b4191d3987c19717452662610a32b",
"md5": "5bc5955cfffeae8743dcc16a7697d6e6",
"sha256": "c1f867b6d33eb3abe6e96488130a7e3d462a51a7829ce48417c1f836a80b7691"
},
"downloads": -1,
"filename": "hestia_earth_orchestrator-0.6.9-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5bc5955cfffeae8743dcc16a7697d6e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": null,
"size": 24591,
"upload_time": "2024-02-19T10:39:16",
"upload_time_iso_8601": "2024-02-19T10:39:16.270046Z",
"url": "https://files.pythonhosted.org/packages/31/38/8c917a8f660c41303ee615aeefb95b3b4191d3987c19717452662610a32b/hestia_earth_orchestrator-0.6.9-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "ac00bc442c9ceb9a4413cdee13682544d88fdfa435b682b8437f1ced36ac27da",
"md5": "601305213e848911b1e47419ee1c9b7d",
"sha256": "b96b570ed665ad8b95b06fadf2d2ecf6e9f7f4d1b4cd1966586cf5ae9cf48107"
},
"downloads": -1,
"filename": "hestia-earth-orchestrator-0.6.9.tar.gz",
"has_sig": false,
"md5_digest": "601305213e848911b1e47419ee1c9b7d",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 16699,
"upload_time": "2024-02-19T10:39:17",
"upload_time_iso_8601": "2024-02-19T10:39:17.997038Z",
"url": "https://files.pythonhosted.org/packages/ac/00/bc442c9ceb9a4413cdee13682544d88fdfa435b682b8437f1ced36ac27da/hestia-earth-orchestrator-0.6.9.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-19 10:39:17",
"github": false,
"gitlab": true,
"bitbucket": false,
"codeberg": false,
"gitlab_user": "hestia-earth",
"gitlab_project": "hestia-engine-orchestrator",
"lcname": "hestia-earth-orchestrator"
}