Skip to content

Commit

Permalink
Merge pull request #1666 from Avaiga/feature/#1567-Rename-Core-servic…
Browse files Browse the repository at this point in the history
…e-to-Orchestrator

feature/#1567 rename Core serice to Orchestrator service
  • Loading branch information
toan-quach authored Aug 23, 2024
2 parents 99ee4b7 + e1a2770 commit 2596757
Show file tree
Hide file tree
Showing 26 changed files with 315 additions and 307 deletions.
53 changes: 30 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
[![Taipy Designer banner](https://github.com/Avaiga/taipy/assets/31435778/6378ffd4-438a-498f-9385-10394f7d53fb)](https://links.taipy.io/306TwUH)


<div align="center">
<a href="https://taipy.io?utm_source=github" target="_blank">
<picture>
Expand All @@ -23,11 +22,10 @@ From simple pilots to production-ready web applications in no time. No more comp
<div align="center">

**Go beyond existing libraries**
</div>


</div>

<p align="left">
<p align="left">
<br />
<a href="https://docs.taipy.io/en/latest/"><strong>📚 Explore the docs </strong></a>
<br />
Expand All @@ -39,11 +37,12 @@ From simple pilots to production-ready web applications in no time. No more comp
&nbsp;

## ⭐️ What's Taipy?

Taipy is designed for data scientists and machine learning engineers to build data & AI web applications.
&nbsp;

⭐️ Enables building production-ready web applications. <br />
⭐️ No need to learn new languages. Only Python is needed.<br />
⭐️ Enables building production-ready web applications. `<br />`
⭐️ No need to learn new languages. Only Python is needed.`<br />`
⭐️ Concentrate on Data and AI algorithms without development and deployment complexities.

&nbsp;
Expand All @@ -52,42 +51,44 @@ Taipy is designed for data scientists and machine learning engineers to build da
Taipy is a Two-in-One Tool for UI Generation and Scenario/Data Management
</h4>

<br />
<br />

| User Interface Generation | Scenario and Data Management |
| -------- | -------- |
|<img src="readme_img/taipy_github_GUI_video.gif" alt="Interface Animation" width="100%" /> | <img src="readme_img/taipy_github_scenarios_video.gif" alt="Back-End Animation" width="100%"/>
| User Interface Generation | Scenario and Data Management |
| ----------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- |
| `<img src="readme_img/taipy_github_GUI_video.gif" alt="Interface Animation" width="100%" />` | `<img src="readme_img/taipy_github_scenarios_video.gif" alt="Back-End Animation" width="100%"/>` |

&nbsp;

## ✨ Features

<img src="readme_img/taipy_github_scenario.png" alt="Scenario Banner" width="49%" /> <img src="readme_img/taipy-github-optimized.png" alt="Back-End Animation" width="49.7%"/>
<img src="readme_img/taipy_github_data_support.png" alt="Back-End Animation" width="49.7%" />


&nbsp;

## ⚙️ Quickstart

To install Taipy stable release run:

```bash
pip install taipy
```

To install Taipy on a Conda Environment or from source, please refer to the [Installation Guide](https://docs.taipy.io/en/latest/installation/).<br />
To install Taipy on a Conda Environment or from source, please refer to the [Installation Guide](https://docs.taipy.io/en/latest/installation/).`<br />`
To get started with Taipy, please refer to the [Getting Started Guide](https://docs.taipy.io/en/latest/getting_started/).

&nbsp;

## 🔌 Scenario and Data Management

Let's create a scenario in Taipy that allows you to filter movie data based on your chosen genre.<br />
This scenario is designed as a straightforward pipeline.<br />
Every time you change your genre selection, the scenario runs to process your request.<br />
Let's create a scenario in Taipy that allows you to filter movie data based on your chosen genre.`<br />`
This scenario is designed as a straightforward pipeline.`<br />`
Every time you change your genre selection, the scenario runs to process your request.`<br />`
It then displays the top seven most popular movies in that genre.

<br />

> ⚠️ Keep in mind, in this example, we're using a very basic pipeline that consists of just one task. However,<br />
> ⚠️ Keep in mind, in this example, we're using a very basic pipeline that consists of just one task. However,`<br />`
> Taipy is capable of handling much more complex pipelines 🚀
<br />
Expand All @@ -102,24 +103,27 @@ def filter_genre(initial_dataset: pd.DataFrame, selected_genre):
```

This is the execution graph of the scenario we are implementing

<p align="center">
<img src="https://github.com/Avaiga/taipy/raw/develop/readme_img/readme_exec_graph.png" width="600" align="center" />
</p>

### Taipy Studio
You can use the Taipy Studio extension in Visual Studio Code to configure your scenario with no code<br />
Your configuration is automatically saved as a TOML file.<br />

You can use the Taipy Studio extension in Visual Studio Code to configure your scenario with no code`<br />`
Your configuration is automatically saved as a TOML file.`<br />`
Check out Taipy Studio [Documentation](https://docs.taipy.io/en/latest/manuals/studio/)

For more advanced use cases or if you prefer coding your configurations instead of using Taipy Studio,<br />
For more advanced use cases or if you prefer coding your configurations instead of using Taipy Studio,`<br />`
Check out the movie genre demo scenario creation with this [Demo](https://docs.taipy.io/en/latest/gallery/other/movie_genre_selector/).

![TaipyStudio](https://github.com/Avaiga/taipy/raw/develop/readme_img/readme_demo_studio.gif)

&nbsp;

## User Interface Generation and Scenario & Data Management
This simple Taipy application demonstrates how to create a basic film recommendation system using Taipy.<br />

This simple Taipy application demonstrates how to create a basic film recommendation system using Taipy.`<br />`
The application filters a dataset of films based on the user's selected genre and displays the top seven films in that genre by popularity.
Here is the full code for both the frontend and backend of the application.

Expand Down Expand Up @@ -154,8 +158,8 @@ if __name__ == "__main__":
Config.load("config.toml")
scenario_cfg = Config.scenarios["scenario"]

# Start Taipy Core service
tp.Core().run()
# Start Taipy Orchestrator
tp.Orchestrator().run()

# Create a scenario
scenario = tp.create_scenario(scenario_cfg)
Expand Down Expand Up @@ -188,17 +192,20 @@ if __name__ == "__main__":
```

And the final result:
<img src="readme_img/readme_app.gif" />
`<img src="readme_img/readme_app.gif" />`

&nbsp;

## ⚒️ Contributing

Want to help build Taipy? Check out our [Contributing Guide](https://github.com/Avaiga/taipy/blob/develop/CONTRIBUTING.md).

## 🪄 Code of conduct

Want to be part of the Taipy community? Check out our [Code of Conduct](https://github.com/Avaiga/taipy/blob/develop/CODE_OF_CONDUCT.md)

## 🪪 License

Copyright 2021-2024 Avaiga Private Limited

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
Expand Down
20 changes: 10 additions & 10 deletions taipy/_run.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@

from flask import Flask

from taipy.core import Core
from taipy.core import Orchestrator
from taipy.gui import Gui
from taipy.rest import Rest

if sys.version_info >= (3, 10):
from typing import TypeGuard

_AppType = t.Union[Gui, Rest, Core]
_AppTypeT = t.TypeVar("_AppTypeT", Gui, Rest, Core)
_AppType = t.Union[Gui, Rest, Orchestrator]
_AppTypeT = t.TypeVar("_AppTypeT", Gui, Rest, Orchestrator)


def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
Expand All @@ -31,27 +31,27 @@ def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
A Taipy service is an instance of a class that runs code as a Web application.
Parameters:
*services (Union[`Gui^`, `Rest^`, `Core^`]): Services to run, as separate arguments.<br/>
*services (Union[`Gui^`, `Rest^`, `Orchestrator^`]): Services to run, as separate arguments.<br/>
If several services are provided, all the services run simultaneously.<br/>
If this is empty or set to None, this method does nothing.
**kwargs: Other parameters to provide to the services.
"""

gui = __get_app(services, Gui)
rest = __get_app(services, Rest)
core = __get_app(services, Core)
orchestrator = __get_app(services, Orchestrator)

if gui and core:
if gui and orchestrator:
from taipy.core._cli._core_cli_factory import _CoreCLIFactory
from taipy.gui._gui_cli import _GuiCLI

_CoreCLIFactory._build_cli().create_parser()
_GuiCLI.create_parser()

if rest or core:
if not core:
core = Core()
core.run()
if rest or orchestrator:
if not orchestrator:
orchestrator = Orchestrator()
orchestrator.run()

if not rest and not gui:
return None
Expand Down
2 changes: 1 addition & 1 deletion taipy/config/common/_config_blocker.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def inner(f):
def _check_if_is_blocking(*args, **kwargs):
if cls.__block_config_update:
error_message = (
"The Core service should be stopped by running core.stop() before"
"The Orchestrator service should be stopped by running orchestrator.stop() before"
" modifying the Configuration."
)
cls.__logger.error(f"ConfigurationUpdateBlocked: {error_message}")
Expand Down
4 changes: 2 additions & 2 deletions taipy/config/config.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -861,7 +861,7 @@ class Config:
force: Optional[bool] = None,
**properties,
) -> "CoreSection":
"""Configure the Core service.
"""Configure the Orchestrator service.
Parameters:
root_folder (Optional[str]): Path of the base folder for the taipy application.
Expand All @@ -887,7 +887,7 @@ class Config:
force (Optional[bool]): If True, Taipy will override a version even if the configuration
has changed and run the application.
**properties (Dict[str, Any]): A keyworded variable length list of additional arguments configure the
behavior of the `Core^` service.
behavior of the `Orchestrator^` service.
Returns:
The Core configuration.
"""
9 changes: 5 additions & 4 deletions taipy/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,12 @@
!!! Note
Taipy Core provides a runnable service, `Core^` that runs as a service in a dedicated thread. The purpose is to
have a dedicated thread responsible for dispatching the submitted jobs to an available executor for their execution.
Taipy provides a runnable service, `Orchestrator^` that runs as a service in a dedicated thread.
The purpose is to have a dedicated thread responsible for dispatching the submitted jobs to an available
executor for their execution.
In particular, this `Core^` service is automatically run when Core is used with Taipy REST or Taipy GUI. See the
[running services](../../../run-deploy/run/running_services.md) page of the user manual for more details.
In particular, this `Orchestrator^` service is automatically run when used with Taipy REST or Taipy GUI.
See the [running services](../../../run-deploy/run/running_services.md) page of the user manual for more details.
"""

from ._init import *
Expand Down
2 changes: 1 addition & 1 deletion taipy/core/_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
# an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
# specific language governing permissions and limitations under the License.

from ._core import Core
from ._entity.submittable import Submittable
from .cycle.cycle import Cycle
from .cycle.cycle_id import CycleId
Expand All @@ -18,6 +17,7 @@
from .job.job import Job
from .job.job_id import JobId
from .job.status import Status
from .orchestrator import Orchestrator
from .scenario.scenario import Scenario
from .scenario.scenario_id import ScenarioId
from .sequence.sequence import Sequence
Expand Down
4 changes: 2 additions & 2 deletions taipy/core/common/_warnings.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ def _warn_deprecated(deprecated: str, suggest: Optional[str] = None, stacklevel:
warnings.warn(message=message, category=category, stacklevel=stacklevel)


def _warn_no_core_service(specific_message, stacklevel: int = 3):
def _warn_no_orchestrator_service(specific_message, stacklevel: int = 3):
def inner(f):
@functools.wraps(f)
def _check_if_core_service_is_running(*args, **kwargs):
from .._orchestrator._orchestrator_factory import _OrchestratorFactory

if not _OrchestratorFactory._dispatcher:
message = f"The Core service is NOT running. {specific_message}"
message = f"The Orchestrator service is NOT running. {specific_message}"
warnings.warn(message=message, category=ResourceWarning, stacklevel=stacklevel)

return f(*args, **kwargs)
Expand Down
2 changes: 1 addition & 1 deletion taipy/core/config/config.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"type": "object",
"properties": {
"CORE": {
"description": "Core service",
"description": "Orchestrator service",
"type": "object",
"properties": {
"core_version": {
Expand Down
8 changes: 4 additions & 4 deletions taipy/core/config/core_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

class CoreSection(UniqueSection):
"""
Configuration parameters for running the `Core^` service.
Configuration parameters for running the `Orchestrator^` service.
Attributes:
root_folder (str): Path of the base folder for the taipy application. The default value is "./taipy/"
Expand All @@ -46,7 +46,7 @@ class CoreSection(UniqueSection):
repository.
read_entity_retry (int): Number of retries to read an entity from the repository before return failure.
The default value is 3.
mode (str): The Taipy operating mode. By default, the `Core^` service runs in "development" mode.
mode (str): The Taipy operating mode. By default, the `Orchestrator^` service runs in "development" mode.
Please refer to the [Versioning management](../../userman/versioning/index.md)
documentation page for more details.
version_number (str)): The identifier of the user application version. Please refer to the
Expand Down Expand Up @@ -354,7 +354,7 @@ def _configure(
force: Optional[bool] = None,
**properties,
) -> "CoreSection":
"""Configure the Core service.
"""Configure the Orchestrator service.
Parameters:
root_folder (Optional[str]): Path of the base folder for the taipy application.
Expand All @@ -380,7 +380,7 @@ def _configure(
force (Optional[bool]): If True, Taipy will override a version even if the configuration
has changed and run the application.
**properties (Dict[str, Any]): A keyworded variable length list of additional arguments configure the
behavior of the `Core^` service.
behavior of the `Orchestrator^` service.
Returns:
The Core configuration.
"""
Expand Down
4 changes: 2 additions & 2 deletions taipy/core/exceptions/exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ def __init__(self, config_core_version: str, core_version: str) -> None:
)


class CoreServiceIsAlreadyRunning(Exception):
"""Raised if the Core service is already running."""
class OrchestratorServiceIsAlreadyRunning(Exception):
"""Raised if the Orchestrator service is already running."""


class CycleAlreadyExists(Exception):
Expand Down
Loading

0 comments on commit 2596757

Please sign in to comment.