Git Product home page Git Product logo

orchestrator-core's Introduction

Orchestrator-Core

Downloads codecov pypi_version

Production ready Orchestration Framework to manage product lifecyle and workflows. Easy to use, Built on top of FastAPI

Documentation

Can be found here

Usage

This project can be installed as follows:

Step 1:

Install the core.

pip install orchestrator-core

Step 2:

Create a postgres database:

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.

export WEBSOCKET_BROADCASTER_URL="memory://"

For the redis connection you need to set the env variable with the connection url.

export WEBSOCKET_BROADCASTER_URL="redis://localhost:6379"

Websockets can also be turned off with:

export ENABLE_WEBSOCKETS=False

more broadcaster info here

Step 4:

Create a main.py file.

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.

PYTHONPATH=. python main.py db init
PYTHONPATH=. python main.py db upgrade heads

Step 6:

Profit :)

uvicorn --reload --host 127.0.0.1 --port 8080 main:app

Visit 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:

python3 -m venv venv
source venv/bin/activate
pip install flit

Step 2 - install the development code:

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:

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

createuser -sP nwa
createdb orchestrator-core-test -O nwa

Step 2 - Run tests

pytest test/unit_tests

or with xdist:

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:

python - m venv venv
source venv/bin/activate
pip install flit

Step 2 - symlink the core to your own project

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:

flit install --deps develop --symlink --python ../orchestrator/venv/bin/python

orchestrator-core's People

Contributors

pboers1988 avatar hmvp avatar github-actions[bot] avatar howderek avatar tjeerddie avatar acidjunk avatar freezas avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.