# Orchestrator-Core
[](https://pepy.tech/project/orchestrator-core)
[](https://codecov.io/gh/workfloworchestrator/orchestrator-core)
[](https://pypi.org/project/orchestrator-core)
<p align="center"><em>Production ready Orchestration Framework to manage product lifecyle and workflows. Easy to use, Built on top of FastAPI</em></p>
## Documentation
Can be found [here](https://workfloworchestrator.org/orchestrator-core/)
## Usage
This project can be installed as follows:
#### Step 1:
Install the core.
```shell
pip install orchestrator-core
```
#### Step 2:
Create a postgres database:
```shell
createuser -sP nwa
createdb orchestrator-core -O nwa
```
#### Step 3 (optional):
When using multiple workers, you will need a redis server for live updates with websockets.
By default it will use memory which works with only one worker.
```shell
export WEBSOCKET_BROADCASTER_URL="memory://"
```
For the redis connection you need to set the env variable with the connection url.
```shell
export WEBSOCKET_BROADCASTER_URL="redis://localhost:6379"
```
Websockets can also be turned off with:
```shell
export ENABLE_WEBSOCKETS=False
```
more broadcaster info [here](https://pypi.org/project/broadcaster/)
#### Step 4:
Create a `main.py` file.
```python
from orchestrator import OrchestratorCore
from orchestrator.cli.main import app as core_cli
from orchestrator.settings import AppSettings
app = OrchestratorCore(base_settings=AppSettings())
if __name__ == "__main__":
core_cli()
```
#### Step 5:
Initialize the migration environment.
```shell
PYTHONPATH=. python main.py db init
PYTHONPATH=. python main.py db upgrade heads
```
### Step 6:
Profit :)
```shell
uvicorn --reload --host 127.0.0.1 --port 8080 main:app
```
Visit [http://127.0.0.1:8080/api/redoc](http://127.0.0.1:8080/api/redoc) to view the api documentation.
## Setting up a development environment
To add features to the repository follow the following procedure to setup a working development environment.
### Installation (Development standalone)
Install the project and its dependencies to develop on the code.
#### Step 1 - install flit:
```shell
python3 -m venv venv
source venv/bin/activate
pip install flit
```
#### Step 2 - install the development code:
```shell
flit install --deps develop --symlink --python venv/bin/python
pip install redis
```
!!! danger
Make sure to use the flit binary that is installed in your environment. You can check the correct
path by running
```shell
which flit
```
To be sure that the packages will be installed against the correct venv you can also prepend the python interpreter
that you want to use:
```shell
flit install --deps develop --symlink --python venv/bin/python
pip install redis
```
### Running tests
Run the unit-test suite to verify a correct setup.
#### Step 1 - Create a database
```shell
createuser -sP nwa
createdb orchestrator-core-test -O nwa
```
#### Step 2 - Run tests
```shell
pytest test/unit_tests
```
or with xdist:
```shell
pytest -n auto test/unit_tests
```
If you do not encounter any failures in the test, you should be able to develop features in the orchestrator-core.
### Installation (Development symlinked into orchestrator SURF)
If you are working on a project that already uses the `orchestrator-core` and you want to test your new core features
against it, you can use some `flit` magic to symlink the dev version of the core to your project. It will
automatically replace the pypi dep with a symlink to the development version
of the core and update/downgrade all required packages in your own orchestrator project.
#### Step 1 - install flit:
```shell
python - m venv venv
source venv/bin/activate
pip install flit
```
### Step 2 - symlink the core to your own project
```shell
flit install --deps develop --symlink --python /path/to/a/orchestrator-project/venv/bin/python
```
So if you have the core and your own orchestrator project repo in the same folder and the main project folder is
`orchestrator` and you want to use relative links, this will be last step:
```shell
flit install --deps develop --symlink --python ../orchestrator/venv/bin/python
```
# Increasing the version number for a (pre) release.
When your PR is accepted you will get a version number.
You can do the necessary change with a clean, e.g. every change committed, branch:
```shell
bumpversion patch --new-version 0.4.1-rc3
```
Raw data
{
"_id": null,
"home_page": "https://github.com/workfloworchestrator/orchestrator-core",
"name": "orchestrator-core",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7,<3.12",
"maintainer_email": null,
"keywords": null,
"author": "SURF",
"author_email": "automation-beheer@surf.nl",
"download_url": "https://files.pythonhosted.org/packages/e7/1b/3683ec56e4db0fc6fb73d39d6277051dcb5a301d20005f31b4c12399425d/orchestrator-core-0.5.2.tar.gz",
"platform": null,
"description": "# Orchestrator-Core\n[](https://pepy.tech/project/orchestrator-core)\n[](https://codecov.io/gh/workfloworchestrator/orchestrator-core)\n[](https://pypi.org/project/orchestrator-core)\n\n<p align=\"center\"><em>Production ready Orchestration Framework to manage product lifecyle and workflows. Easy to use, Built on top of FastAPI</em></p>\n\n\n## Documentation\nCan be found [here](https://workfloworchestrator.org/orchestrator-core/)\n\n## Usage\nThis project can be installed as follows:\n\n#### Step 1:\nInstall the core.\n```shell\npip install orchestrator-core\n```\n\n#### Step 2:\nCreate a postgres database:\n```shell\ncreateuser -sP nwa\ncreatedb orchestrator-core -O nwa\n```\n\n#### Step 3 (optional):\nWhen using multiple workers, you will need a redis server for live updates with websockets.\n\nBy default it will use memory which works with only one worker.\n```shell\nexport WEBSOCKET_BROADCASTER_URL=\"memory://\"\n```\n\nFor the redis connection you need to set the env variable with the connection url.\n```shell\nexport WEBSOCKET_BROADCASTER_URL=\"redis://localhost:6379\"\n```\n\nWebsockets can also be turned off with:\n```shell\nexport ENABLE_WEBSOCKETS=False\n```\n\nmore broadcaster info [here](https://pypi.org/project/broadcaster/)\n\n#### Step 4:\nCreate a `main.py` file.\n\n```python\nfrom orchestrator import OrchestratorCore\nfrom orchestrator.cli.main import app as core_cli\nfrom orchestrator.settings import AppSettings\n\napp = OrchestratorCore(base_settings=AppSettings())\n\nif __name__ == \"__main__\":\n core_cli()\n```\n\n#### Step 5:\nInitialize the migration environment.\n```shell\nPYTHONPATH=. python main.py db init\nPYTHONPATH=. python main.py db upgrade heads\n```\n\n### Step 6:\nProfit :)\n\n```shell\nuvicorn --reload --host 127.0.0.1 --port 8080 main:app\n```\n\nVisit [http://127.0.0.1:8080/api/redoc](http://127.0.0.1:8080/api/redoc) to view the api documentation.\n\n\n## Setting up a development environment\n\nTo add features to the repository follow the following procedure to setup a working development environment.\n\n### Installation (Development standalone)\nInstall the project and its dependencies to develop on the code.\n\n#### Step 1 - install flit:\n\n```shell\npython3 -m venv venv\nsource venv/bin/activate\npip install flit\n```\n\n#### Step 2 - install the development code:\n```shell\nflit install --deps develop --symlink --python venv/bin/python\npip install redis\n```\n\n!!! danger\n Make sure to use the flit binary that is installed in your environment. You can check the correct\n path by running\n ```shell\n which flit\n ```\n\nTo be sure that the packages will be installed against the correct venv you can also prepend the python interpreter\nthat you want to use:\n\n```shell\nflit install --deps develop --symlink --python venv/bin/python\npip install redis\n```\n\n\n### Running tests\nRun the unit-test suite to verify a correct setup.\n\n#### Step 1 - Create a database\n\n```shell\ncreateuser -sP nwa\ncreatedb orchestrator-core-test -O nwa\n```\n\n#### Step 2 - Run tests\n```shell\npytest test/unit_tests\n```\nor with xdist:\n\n```shell\npytest -n auto test/unit_tests\n```\n\nIf you do not encounter any failures in the test, you should be able to develop features in the orchestrator-core.\n\n### Installation (Development symlinked into orchestrator SURF)\n\nIf you are working on a project that already uses the `orchestrator-core` and you want to test your new core features\nagainst it, you can use some `flit` magic to symlink the dev version of the core to your project. It will\nautomatically replace the pypi dep with a symlink to the development version\nof the core and update/downgrade all required packages in your own orchestrator project.\n\n#### Step 1 - install flit:\n\n```shell\npython - m venv venv\nsource venv/bin/activate\npip install flit\n```\n\n### Step 2 - symlink the core to your own project\n\n```shell\nflit install --deps develop --symlink --python /path/to/a/orchestrator-project/venv/bin/python\n```\n\nSo if you have the core and your own orchestrator project repo in the same folder and the main project folder is\n`orchestrator` and you want to use relative links, this will be last step:\n\n```shell\nflit install --deps develop --symlink --python ../orchestrator/venv/bin/python\n```\n\n# Increasing the version number for a (pre) release.\n\nWhen your PR is accepted you will get a version number.\n\nYou can do the necessary change with a clean, e.g. every change committed, branch:\n\n```shell\nbumpversion patch --new-version 0.4.1-rc3\n```\n",
"bugtrack_url": null,
"license": null,
"summary": "This is the orchestrator workflow engine.",
"version": "0.5.2",
"split_keywords": [],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "08f3e44101335171b41a202ac3e2aafe69ec3e521f5f3630d6ec64f2cc20eb3c",
"md5": "ec4e1da46d73e177682843dbb6991b77",
"sha256": "92150c921cc408e8b68410d3d9b8638a663f970f66b9dae32e992b0ad36dedc9"
},
"downloads": -1,
"filename": "orchestrator_core-0.5.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "ec4e1da46d73e177682843dbb6991b77",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7,<3.12",
"size": 222301,
"upload_time": "2023-01-25T10:41:02",
"upload_time_iso_8601": "2023-01-25T10:41:02.620084Z",
"url": "https://files.pythonhosted.org/packages/08/f3/e44101335171b41a202ac3e2aafe69ec3e521f5f3630d6ec64f2cc20eb3c/orchestrator_core-0.5.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "e71b3683ec56e4db0fc6fb73d39d6277051dcb5a301d20005f31b4c12399425d",
"md5": "ba7f79470042d5e6cc9cc0fee53dbe85",
"sha256": "768c339d1b204261c02e2431d1ca411b0918eda74b528fbf0fb7124ffc485984"
},
"downloads": -1,
"filename": "orchestrator-core-0.5.2.tar.gz",
"has_sig": false,
"md5_digest": "ba7f79470042d5e6cc9cc0fee53dbe85",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7,<3.12",
"size": 321083,
"upload_time": "2023-01-25T10:41:05",
"upload_time_iso_8601": "2023-01-25T10:41:05.142645Z",
"url": "https://files.pythonhosted.org/packages/e7/1b/3683ec56e4db0fc6fb73d39d6277051dcb5a301d20005f31b4c12399425d/orchestrator-core-0.5.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-01-25 10:41:05",
"github": true,
"gitlab": false,
"bitbucket": false,
"github_user": "workfloworchestrator",
"github_project": "orchestrator-core",
"travis_ci": false,
"coveralls": true,
"github_actions": true,
"lcname": "orchestrator-core"
}