소스 검색

rename Core serice to Orchestrator service

Toan Quach 9 달 전
부모
커밋
3a2293e796

+ 10 - 10
taipy/_run.py

@@ -14,15 +14,15 @@ import typing as t
 
 
 from flask import Flask
 from flask import Flask
 
 
-from taipy.core import Core
+from taipy.core import Orchestrator
 from taipy.gui import Gui
 from taipy.gui import Gui
 from taipy.rest import Rest
 from taipy.rest import Rest
 
 
 if sys.version_info >= (3, 10):
 if sys.version_info >= (3, 10):
     from typing import TypeGuard
     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]:
 def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
@@ -31,7 +31,7 @@ def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
     A Taipy service is an instance of a class that runs code as a Web application.
     A Taipy service is an instance of a class that runs code as a Web application.
 
 
     Parameters:
     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 several services are provided, all the services run simultaneously.<br/>
             If this is empty or set to None, this method does nothing.
             If this is empty or set to None, this method does nothing.
         **kwargs: Other parameters to provide to the services.
         **kwargs: Other parameters to provide to the services.
@@ -39,19 +39,19 @@ def _run(*services: _AppType, **kwargs) -> t.Optional[Flask]:
 
 
     gui = __get_app(services, Gui)
     gui = __get_app(services, Gui)
     rest = __get_app(services, Rest)
     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.core._cli._core_cli_factory import _CoreCLIFactory
         from taipy.gui._gui_cli import _GuiCLI
         from taipy.gui._gui_cli import _GuiCLI
 
 
         _CoreCLIFactory._build_cli().create_parser()
         _CoreCLIFactory._build_cli().create_parser()
         _GuiCLI.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:
     if not rest and not gui:
         return None
         return None

+ 1 - 1
taipy/config/common/_config_blocker.py

@@ -40,7 +40,7 @@ class _ConfigBlocker:
             def _check_if_is_blocking(*args, **kwargs):
             def _check_if_is_blocking(*args, **kwargs):
                 if cls.__block_config_update:
                 if cls.__block_config_update:
                     error_message = (
                     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."
                         " modifying the Configuration."
                     )
                     )
                     cls.__logger.error(f"ConfigurationUpdateBlocked: {error_message}")
                     cls.__logger.error(f"ConfigurationUpdateBlocked: {error_message}")

+ 10 - 8
taipy/core/__init__.py

@@ -9,14 +9,14 @@
 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 # 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.
 # specific language governing permissions and limitations under the License.
 
 
-"""# Taipy Core
+"""# Taipy Orchestrator
 
 
-The Taipy Core package is a Python library designed to build powerful, customized, data-driven back-end
+The Taipy Orchestrator package is a Python library designed to build powerful, customized, data-driven back-end
 applications. It provides the tools to help Python developers transform their algorithms into a
 applications. It provides the tools to help Python developers transform their algorithms into a
 complete back-end application.
 complete back-end application.
-More details on the Core functionalities are available in the user manual.
+More details on the Orchestrator functionalities are available in the user manual.
 
 
-To build a Taipy Core application, the first step consists of setting up the Taipy configuration to design
+To build a Taipy Orchestrator application, the first step consists of setting up the Taipy configuration to design
 your application's characteristics and behaviors.
 your application's characteristics and behaviors.
 Import `Config^` from the `taipy.config^` module, then use the various methods of the `Config^` singleton class to
 Import `Config^` from the `taipy.config^` module, then use the various methods of the `Config^` singleton class to
 configure your core application. In particular, configure the
 configure your core application. In particular, configure the
@@ -30,11 +30,13 @@ in the following section on [Function](#functions). In particular, the most used
 
 
 !!! Note
 !!! 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 Orchestrator 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 Orchestrator 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.
 """
 """
 
 
 from ._init import *
 from ._init import *

+ 1 - 1
taipy/core/_init.py

@@ -9,7 +9,6 @@
 # an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
 # 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.
 # specific language governing permissions and limitations under the License.
 
 
-from ._core import Core
 from ._entity.submittable import Submittable
 from ._entity.submittable import Submittable
 from .cycle.cycle import Cycle
 from .cycle.cycle import Cycle
 from .cycle.cycle_id import CycleId
 from .cycle.cycle_id import CycleId
@@ -18,6 +17,7 @@ from .data.data_node_id import DataNodeId
 from .job.job import Job
 from .job.job import Job
 from .job.job_id import JobId
 from .job.job_id import JobId
 from .job.status import Status
 from .job.status import Status
+from .orchestrator import Orchestrator
 from .scenario.scenario import Scenario
 from .scenario.scenario import Scenario
 from .scenario.scenario_id import ScenarioId
 from .scenario.scenario_id import ScenarioId
 from .sequence.sequence import Sequence
 from .sequence.sequence import Sequence

+ 2 - 2
taipy/core/common/_warnings.py

@@ -24,14 +24,14 @@ def _warn_deprecated(deprecated: str, suggest: Optional[str] = None, stacklevel:
     warnings.warn(message=message, category=category, stacklevel=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):
     def inner(f):
         @functools.wraps(f)
         @functools.wraps(f)
         def _check_if_core_service_is_running(*args, **kwargs):
         def _check_if_core_service_is_running(*args, **kwargs):
             from .._orchestrator._orchestrator_factory import _OrchestratorFactory
             from .._orchestrator._orchestrator_factory import _OrchestratorFactory
 
 
             if not _OrchestratorFactory._dispatcher:
             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)
                 warnings.warn(message=message, category=ResourceWarning, stacklevel=stacklevel)
 
 
             return f(*args, **kwargs)
             return f(*args, **kwargs)

+ 132 - 0
taipy/core/orchestrator.py

@@ -0,0 +1,132 @@
+# 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
+# the License. You may obtain a copy of the License at
+#
+#        http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
+# 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 multiprocessing import Lock
+from typing import Optional
+
+from taipy.config import Config
+from taipy.logger._taipy_logger import _TaipyLogger
+
+from ._orchestrator._dispatcher._job_dispatcher import _JobDispatcher
+from ._orchestrator._orchestrator import _Orchestrator
+from ._orchestrator._orchestrator_factory import _OrchestratorFactory
+from ._orchestrator_cli import _OrchestratorCLI
+from ._version._version_manager_factory import _VersionManagerFactory
+from .config import OrchestratorSection
+from .exceptions.exceptions import OrchestratorServiceIsAlreadyRunning
+
+
+class Orchestrator:
+    """
+    Orchestrator service
+    """
+
+    _is_running = False
+    __lock_is_running = Lock()
+
+    _version_is_initialized = False
+    __lock_version_is_initialized = Lock()
+
+    __logger = _TaipyLogger._get_logger()
+
+    _orchestrator: Optional[_Orchestrator] = None
+    _dispatcher: Optional[_JobDispatcher] = None
+
+    def __init__(self) -> None:
+        """
+        Initialize a Orchestrator service.
+        """
+        pass
+
+    def run(self, force_restart=False):
+        """
+        Start a Orchestrator service.
+
+        This function checks and locks the configuration, manages application's version,
+        and starts a job dispatcher.
+        """
+        if self.__class__._is_running:
+            raise OrchestratorServiceIsAlreadyRunning
+
+        with self.__class__.__lock_is_running:
+            self.__class__._is_running = True
+
+        self._manage_version_and_block_config()
+        self.__start_dispatcher(force_restart)
+        self.__logger.info("Orchestrator service has been started.")
+
+    def stop(self, wait: bool = True, timeout: Optional[float] = None):
+        """
+        Stop the Orchestrator service.
+        This function stops the dispatcher and unblock the Config for update.
+
+        Parameters:
+            wait (bool): If True, the method will wait for the dispatcher to stop.
+            timeout (Optional[float]): The maximum time to wait. If None, the method will wait indefinitely.
+        """
+        self.__logger.info("Unblocking configuration update...")
+        Config.unblock_update()
+
+        self.__logger.info("Stopping job dispatcher...")
+        if self._dispatcher:
+            self._dispatcher = _OrchestratorFactory._remove_dispatcher(wait, timeout)
+        with self.__class__.__lock_is_running:
+            self.__class__._is_running = False
+        with self.__class__.__lock_version_is_initialized:
+            self.__class__._version_is_initialized = False
+        self.__logger.info("Orchestrator service has been stopped.")
+
+    @classmethod
+    def _manage_version_and_block_config(cls):
+        """
+        Manage the application's version and block the Config from updates.
+        """
+        if cls._version_is_initialized:
+            return
+
+        with cls.__lock_version_is_initialized:
+            cls._version_is_initialized = True
+
+        cls.__update_orchestrator_section()
+        cls.__manage_version()
+        cls.__check_and_block_config()
+
+    @classmethod
+    def __update_orchestrator_section(cls):
+        cls.__logger.info("Updating configuration with command-line arguments...")
+        _OrchestratorCLI.create_parser()
+        Config._applied_config._unique_sections[OrchestratorSection.name]._update(_OrchestratorCLI.handle_command())
+
+    @classmethod
+    def __manage_version(cls):
+        cls.__logger.info("Managing application's version...")
+        _VersionManagerFactory._build_manager()._manage_version()
+        Config._applied_config._unique_sections[OrchestratorSection.name]._update(
+            {"version_number": _VersionManagerFactory._build_manager()._get_latest_version()}
+        )
+
+    @classmethod
+    def __check_and_block_config(cls):
+        cls.__logger.info("Checking application's version...")
+        Config.check()
+        cls.__logger.info("Blocking configuration update...")
+        Config.block_update()
+
+    def __start_dispatcher(self, force_restart):
+        self.__logger.info("Starting job dispatcher...")
+        if self._orchestrator is None:
+            self._orchestrator = _OrchestratorFactory._build_orchestrator()
+
+        if dispatcher := _OrchestratorFactory._build_dispatcher(force_restart=force_restart):
+            self._dispatcher = dispatcher
+
+        if Config.job_config.is_development:
+            _Orchestrator._check_and_execute_jobs_if_development_mode()

+ 5 - 5
taipy/core/taipy.py

@@ -15,7 +15,6 @@ from typing import Any, Callable, Dict, List, Literal, Optional, Set, Union, ove
 from taipy.config import Scope
 from taipy.config import Scope
 from taipy.logger._taipy_logger import _TaipyLogger
 from taipy.logger._taipy_logger import _TaipyLogger
 
 
-from ._core import Core
 from ._entity._entity import _Entity
 from ._entity._entity import _Entity
 from ._version._version_manager_factory import _VersionManagerFactory
 from ._version._version_manager_factory import _VersionManagerFactory
 from .common._check_instance import (
 from .common._check_instance import (
@@ -27,7 +26,7 @@ from .common._check_instance import (
     _is_submission,
     _is_submission,
     _is_task,
     _is_task,
 )
 )
-from .common._warnings import _warn_deprecated, _warn_no_core_service
+from .common._warnings import _warn_deprecated, _warn_no_orchestrator_service
 from .config.data_node_config import DataNodeConfig
 from .config.data_node_config import DataNodeConfig
 from .config.scenario_config import ScenarioConfig
 from .config.scenario_config import ScenarioConfig
 from .cycle._cycle_manager_factory import _CycleManagerFactory
 from .cycle._cycle_manager_factory import _CycleManagerFactory
@@ -40,6 +39,7 @@ from .exceptions.exceptions import DataNodeConfigIsNotGlobal, ModelNotFound, Non
 from .job._job_manager_factory import _JobManagerFactory
 from .job._job_manager_factory import _JobManagerFactory
 from .job.job import Job
 from .job.job import Job
 from .job.job_id import JobId
 from .job.job_id import JobId
+from .orchestrator import Orchestrator
 from .reason import EntityDoesNotExist, EntityIsNotSubmittableEntity, ReasonCollection
 from .reason import EntityDoesNotExist, EntityIsNotSubmittableEntity, ReasonCollection
 from .scenario._scenario_manager_factory import _ScenarioManagerFactory
 from .scenario._scenario_manager_factory import _ScenarioManagerFactory
 from .scenario.scenario import Scenario
 from .scenario.scenario import Scenario
@@ -216,7 +216,7 @@ def is_readable(
     return ReasonCollection()._add_reason(str(entity), EntityDoesNotExist(str(entity)))
     return ReasonCollection()._add_reason(str(entity), EntityDoesNotExist(str(entity)))
 
 
 
 
-@_warn_no_core_service("The submitted entity will not be executed until the Core service is running.")
+@_warn_no_orchestrator_service("The submitted entity will not be executed until the Orchestrator service is running.")
 def submit(
 def submit(
     entity: Union[Scenario, Sequence, Task],
     entity: Union[Scenario, Sequence, Task],
     force: bool = False,
     force: bool = False,
@@ -922,7 +922,7 @@ def create_scenario(
         SystemExit: If the configuration check returns some errors.
         SystemExit: If the configuration check returns some errors.
 
 
     """
     """
-    Core._manage_version_and_block_config()
+    Orchestrator._manage_version_and_block_config()
 
 
     return _ScenarioManagerFactory._build_manager()._create(config, creation_date, name)
     return _ScenarioManagerFactory._build_manager()._create(config, creation_date, name)
 
 
@@ -947,7 +947,7 @@ def create_global_data_node(config: DataNodeConfig) -> DataNode:
     if config.scope is not Scope.GLOBAL:
     if config.scope is not Scope.GLOBAL:
         raise DataNodeConfigIsNotGlobal(config.id)
         raise DataNodeConfigIsNotGlobal(config.id)
 
 
-    Core._manage_version_and_block_config()
+    Orchestrator._manage_version_and_block_config()
 
 
     if dns := _DataManagerFactory._build_manager()._get_by_config_id(config.id):
     if dns := _DataManagerFactory._build_manager()._get_by_config_id(config.id):
         return dns[0]
         return dns[0]

+ 2 - 2
taipy/templates/scenario-management/{{cookiecutter.__root_folder_name}}/{{cookiecutter.__main_file}}.py

@@ -14,7 +14,7 @@ from pages import job_page, scenario_page
 from pages.root import content, root, selected_data_node, selected_scenario
 from pages.root import content, root, selected_data_node, selected_scenario
 
 
 import taipy as tp
 import taipy as tp
-from taipy import Core, Gui
+from taipy import Gui, Orchestrator
 
 
 
 
 def on_init(state):
 def on_init(state):
@@ -35,7 +35,7 @@ pages = {
 
 
 if __name__ == "__main__":
 if __name__ == "__main__":
     # Instantiate, configure and run the Core
     # Instantiate, configure and run the Core
-    core = Core()
+    core = Orchestrator()
     default_scenario_cfg = configure()
     default_scenario_cfg = configure()
     core.run()
     core.run()
 
 

+ 3 - 3
tests/core/_orchestrator/test_orchestrator__submit.py

@@ -18,7 +18,7 @@ import pytest
 
 
 from taipy import Scenario, Scope, Task
 from taipy import Scenario, Scope, Task
 from taipy.config import Config
 from taipy.config import Config
-from taipy.core import Core, taipy
+from taipy.core import Orchestrator, taipy
 from taipy.core._orchestrator._orchestrator import _Orchestrator
 from taipy.core._orchestrator._orchestrator import _Orchestrator
 from taipy.core._orchestrator._orchestrator_factory import _OrchestratorFactory
 from taipy.core._orchestrator._orchestrator_factory import _OrchestratorFactory
 from taipy.core.config import JobConfig
 from taipy.core.config import JobConfig
@@ -520,7 +520,7 @@ def task_sleep_2():
 
 
 
 
 def test_submit_duration_development_mode():
 def test_submit_duration_development_mode():
-    core = Core()
+    core = Orchestrator()
     core.run()
     core.run()
 
 
     task_1 = Task("task_config_id_1", {}, task_sleep_1, [], [])
     task_1 = Task("task_config_id_1", {}, task_sleep_1, [], [])
@@ -550,7 +550,7 @@ def test_submit_duration_development_mode():
 @pytest.mark.standalone
 @pytest.mark.standalone
 def test_submit_duration_standalone_mode():
 def test_submit_duration_standalone_mode():
     Config.configure_job_executions(mode=JobConfig._STANDALONE_MODE)
     Config.configure_job_executions(mode=JobConfig._STANDALONE_MODE)
-    core = Core()
+    core = Orchestrator()
     core.run()
     core.run()
 
 
     task_1 = Task("task_config_id_1", {}, task_sleep_1, [], [])
     task_1 = Task("task_config_id_1", {}, task_sleep_1, [], [])

+ 34 - 34
tests/core/_version/test_version_cli.py

@@ -18,7 +18,7 @@ from taipy._entrypoint import _entrypoint
 from taipy.config.common.frequency import Frequency
 from taipy.config.common.frequency import Frequency
 from taipy.config.common.scope import Scope
 from taipy.config.common.scope import Scope
 from taipy.config.config import Config
 from taipy.config.config import Config
-from taipy.core import Core
+from taipy.core import Orchestrator
 from taipy.core._version._cli._version_cli_factory import _VersionCLIFactory
 from taipy.core._version._cli._version_cli_factory import _VersionCLIFactory
 from taipy.core._version._version_manager import _VersionManager
 from taipy.core._version._version_manager import _VersionManager
 from taipy.core.data._data_manager import _DataManager
 from taipy.core.data._data_manager import _DataManager
@@ -39,32 +39,32 @@ def test_delete_version(caplog):
     scenario_config = config_scenario()
     scenario_config = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.1"]):
     with patch("sys.argv", ["prog", "--experiment", "1.1"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     all_versions = [version.id for version in _VersionManager._get_all()]
     all_versions = [version.id for version in _VersionManager._get_all()]
     assert len(all_versions) == 4
     assert len(all_versions) == 4
@@ -91,19 +91,19 @@ def test_delete_version(caplog):
 
 
 def test_list_versions(capsys):
 def test_list_versions(capsys):
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
-        core.stop()
+        orchestrator = Orchestrator()
+        orchestrator.run()
+        orchestrator.stop()
     sleep(0.05)
     sleep(0.05)
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
-        core.stop()
+        orchestrator = Orchestrator()
+        orchestrator.run()
+        orchestrator.stop()
     sleep(0.05)
     sleep(0.05)
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
-        core = Core()
-        core.run()
-        core.stop()
+        orchestrator = Orchestrator()
+        orchestrator.run()
+        orchestrator.stop()
 
 
     _VersionCLIFactory._build_cli().create_parser()
     _VersionCLIFactory._build_cli().create_parser()
     with pytest.raises(SystemExit):
     with pytest.raises(SystemExit):
@@ -123,18 +123,18 @@ def test_rename_version(caplog):
     scenario_config = config_scenario()
     scenario_config = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     dev_ver = _VersionManager._get_development_version()
     dev_ver = _VersionManager._get_development_version()
 
 
@@ -168,11 +168,11 @@ def test_compare_version_config(caplog, init_config):
     scenario_config_1 = config_scenario()
     scenario_config_1 = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config_1)
         scenario = _ScenarioManager._create(scenario_config_1)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     init_config()
     init_config()
 
 
@@ -180,11 +180,11 @@ def test_compare_version_config(caplog, init_config):
     Config.configure_data_node(id="d2", storage_type="csv", default_path="bar.csv")
     Config.configure_data_node(id="d2", storage_type="csv", default_path="bar.csv")
 
 
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
     with patch("sys.argv", ["prog", "--experiment", "2.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config_2)
         scenario = _ScenarioManager._create(scenario_config_2)
         _ScenarioManager._submit(scenario)
         _ScenarioManager._submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     _VersionCLIFactory._build_cli().create_parser()
     _VersionCLIFactory._build_cli().create_parser()
     with pytest.raises(SystemExit):
     with pytest.raises(SystemExit):

+ 7 - 7
tests/core/test_complex_application.py

@@ -17,7 +17,7 @@ import pandas as pd
 
 
 import taipy.core.taipy as tp
 import taipy.core.taipy as tp
 from taipy.config import Config
 from taipy.config import Config
-from taipy.core import Core, Status
+from taipy.core import Orchestrator, Status
 
 
 # ################################  USER FUNCTIONS  ##################################
 # ################################  USER FUNCTIONS  ##################################
 
 
@@ -75,8 +75,8 @@ def test_skipped_jobs():
     task_config_2 = Config.configure_task("second", mult_by_2, intermediate_config, output_config, skippable=True)
     task_config_2 = Config.configure_task("second", mult_by_2, intermediate_config, output_config, skippable=True)
     scenario_config = Config.configure_scenario("scenario", [task_config_1, task_config_2])
     scenario_config = Config.configure_scenario("scenario", [task_config_1, task_config_2])
 
 
-    core = Core()
-    core.run()
+    orchestrator = Orchestrator()
+    orchestrator.run()
 
 
     scenario = tp.create_scenario(scenario_config)
     scenario = tp.create_scenario(scenario_config)
     scenario.input_dn.write(2)
     scenario.input_dn.write(2)
@@ -92,7 +92,7 @@ def test_skipped_jobs():
             assert job.status == Status.SKIPPED
             assert job.status == Status.SKIPPED
             skipped.append(job)
             skipped.append(job)
     assert len(skipped) == 2
     assert len(skipped) == 2
-    core.stop()
+    orchestrator.stop()
 
 
 
 
 def test_complex():
 def test_complex():
@@ -171,11 +171,11 @@ def test_complex():
         ],
         ],
     )
     )
 
 
-    core = Core()
-    core.run()
+    orchestrator = Orchestrator()
+    orchestrator.run()
     scenario = tp.create_scenario(scenario_config)
     scenario = tp.create_scenario(scenario_config)
     tp.submit(scenario)
     tp.submit(scenario)
-    core.stop()
+    orchestrator.stop()
 
 
     csv_sum_res = pd.read_csv(csv_path_sum)
     csv_sum_res = pd.read_csv(csv_path_sum)
     excel_sum_res = pd.read_excel(excel_path_sum)
     excel_sum_res = pd.read_excel(excel_path_sum)

+ 11 - 11
tests/core/test_core.py

@@ -14,19 +14,19 @@ import pytest
 
 
 from taipy.config import Config
 from taipy.config import Config
 from taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked
 from taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked
-from taipy.core import Core
+from taipy.core import Orchestrator
 from taipy.core._orchestrator._dispatcher import _DevelopmentJobDispatcher, _StandaloneJobDispatcher
 from taipy.core._orchestrator._dispatcher import _DevelopmentJobDispatcher, _StandaloneJobDispatcher
 from taipy.core._orchestrator._orchestrator import _Orchestrator
 from taipy.core._orchestrator._orchestrator import _Orchestrator
 from taipy.core._orchestrator._orchestrator_factory import _OrchestratorFactory
 from taipy.core._orchestrator._orchestrator_factory import _OrchestratorFactory
 from taipy.core.config.job_config import JobConfig
 from taipy.core.config.job_config import JobConfig
-from taipy.core.exceptions.exceptions import CoreServiceIsAlreadyRunning
+from taipy.core.exceptions.exceptions import OrchestratorServiceIsAlreadyRunning
 
 
 
 
 class TestCore:
 class TestCore:
     def test_run_core_trigger_config_check(self, caplog):
     def test_run_core_trigger_config_check(self, caplog):
         Config.configure_data_node(id="d0", storage_type="toto")
         Config.configure_data_node(id="d0", storage_type="toto")
         with pytest.raises(SystemExit):
         with pytest.raises(SystemExit):
-            core = Core()
+            core = Orchestrator()
             core.run()
             core.run()
         expected_error_message = (
         expected_error_message = (
             "`storage_type` field of DataNodeConfig `d0` must be either csv, sql_table,"
             "`storage_type` field of DataNodeConfig `d0` must be either csv, sql_table,"
@@ -39,7 +39,7 @@ class TestCore:
     def test_run_core_as_a_service_development_mode(self):
     def test_run_core_as_a_service_development_mode(self):
         _OrchestratorFactory._dispatcher = None
         _OrchestratorFactory._dispatcher = None
 
 
-        core = Core()
+        core = Orchestrator()
         assert core._orchestrator is None
         assert core._orchestrator is None
         assert core._dispatcher is None
         assert core._dispatcher is None
         assert _OrchestratorFactory._dispatcher is None
         assert _OrchestratorFactory._dispatcher is None
@@ -57,7 +57,7 @@ class TestCore:
     def test_run_core_as_a_service_standalone_mode(self):
     def test_run_core_as_a_service_standalone_mode(self):
         _OrchestratorFactory._dispatcher = None
         _OrchestratorFactory._dispatcher = None
 
 
-        core = Core()
+        core = Orchestrator()
         assert core._orchestrator is None
         assert core._orchestrator is None
 
 
         assert core._dispatcher is None
         assert core._dispatcher is None
@@ -77,14 +77,14 @@ class TestCore:
         core.stop()
         core.stop()
 
 
     def test_core_service_can_only_be_run_once(self):
     def test_core_service_can_only_be_run_once(self):
-        core_instance_1 = Core()
-        core_instance_2 = Core()
+        core_instance_1 = Orchestrator()
+        core_instance_2 = Orchestrator()
 
 
         core_instance_1.run()
         core_instance_1.run()
 
 
-        with pytest.raises(CoreServiceIsAlreadyRunning):
+        with pytest.raises(OrchestratorServiceIsAlreadyRunning):
             core_instance_1.run()
             core_instance_1.run()
-        with pytest.raises(CoreServiceIsAlreadyRunning):
+        with pytest.raises(OrchestratorServiceIsAlreadyRunning):
             core_instance_2.run()
             core_instance_2.run()
 
 
         # Stop the Core service and run it again should work
         # Stop the Core service and run it again should work
@@ -98,7 +98,7 @@ class TestCore:
     def test_block_config_update_when_core_service_is_running_development_mode(self):
     def test_block_config_update_when_core_service_is_running_development_mode(self):
         _OrchestratorFactory._dispatcher = None
         _OrchestratorFactory._dispatcher = None
 
 
-        core = Core()
+        core = Orchestrator()
         core.run()
         core.run()
         with pytest.raises(ConfigurationUpdateBlocked):
         with pytest.raises(ConfigurationUpdateBlocked):
             Config.configure_data_node(id="i1")
             Config.configure_data_node(id="i1")
@@ -108,7 +108,7 @@ class TestCore:
     def test_block_config_update_when_core_service_is_running_standalone_mode(self):
     def test_block_config_update_when_core_service_is_running_standalone_mode(self):
         _OrchestratorFactory._dispatcher = None
         _OrchestratorFactory._dispatcher = None
 
 
-        core = Core()
+        core = Orchestrator()
         Config.configure_job_executions(mode=JobConfig._STANDALONE_MODE, max_nb_of_workers=2)
         Config.configure_job_executions(mode=JobConfig._STANDALONE_MODE, max_nb_of_workers=2)
         core.run()
         core.run()
         with pytest.raises(ConfigurationUpdateBlocked):
         with pytest.raises(ConfigurationUpdateBlocked):

+ 79 - 79
tests/core/test_core_cli.py

@@ -16,7 +16,7 @@ import pytest
 from taipy.config.common.frequency import Frequency
 from taipy.config.common.frequency import Frequency
 from taipy.config.common.scope import Scope
 from taipy.config.common.scope import Scope
 from taipy.config.config import Config
 from taipy.config.config import Config
-from taipy.core import Core, taipy
+from taipy.core import Orchestrator, taipy
 from taipy.core._version._version_manager import _VersionManager
 from taipy.core._version._version_manager import _VersionManager
 from taipy.core._version._version_manager_factory import _VersionManagerFactory
 from taipy.core._version._version_manager_factory import _VersionManagerFactory
 from taipy.core.common._utils import _load_fct
 from taipy.core.common._utils import _load_fct
@@ -29,63 +29,63 @@ from taipy.core.sequence._sequence_manager import _SequenceManager
 from taipy.core.task._task_manager import _TaskManager
 from taipy.core.task._task_manager import _TaskManager
 
 
 
 
-def test_core_cli_no_arguments():
+def test_orchestrator_cli_no_arguments():
     with patch("sys.argv", ["prog"]):
     with patch("sys.argv", ["prog"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "development"
         assert Config.core.mode == "development"
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
         assert not Config.core.force
         assert not Config.core.force
-        core.stop()
+        orchestrator.stop()
 
 
 
 
-def test_core_cli_development_mode():
+def test_orchestrator_cli_development_mode():
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "development"
         assert Config.core.mode == "development"
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
-        core.stop()
+        orchestrator.stop()
 
 
 
 
-def test_core_cli_dev_mode():
+def test_orchestrator_cli_dev_mode():
     with patch("sys.argv", ["prog", "-dev"]):
     with patch("sys.argv", ["prog", "-dev"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "development"
         assert Config.core.mode == "development"
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_development_version()
-        core.stop()
+        orchestrator.stop()
 
 
 
 
-def test_core_cli_experiment_mode():
+def test_orchestrator_cli_experiment_mode():
     with patch("sys.argv", ["prog", "--experiment"]):
     with patch("sys.argv", ["prog", "--experiment"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "experiment"
         assert Config.core.mode == "experiment"
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_latest_version()
         assert Config.core.version_number == _VersionManagerFactory._build_manager()._get_latest_version()
         assert not Config.core.force
         assert not Config.core.force
-        core.stop()
+        orchestrator.stop()
 
 
 
 
-def test_core_cli_experiment_mode_with_version():
+def test_orchestrator_cli_experiment_mode_with_version():
     with patch("sys.argv", ["prog", "--experiment", "2.1"]):
     with patch("sys.argv", ["prog", "--experiment", "2.1"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "experiment"
         assert Config.core.mode == "experiment"
         assert Config.core.version_number == "2.1"
         assert Config.core.version_number == "2.1"
         assert not Config.core.force
         assert not Config.core.force
-        core.stop()
+        orchestrator.stop()
 
 
 
 
-def test_core_cli_experiment_mode_with_force_version(init_config):
+def test_orchestrator_cli_experiment_mode_with_force_version(init_config):
     with patch("sys.argv", ["prog", "--experiment", "2.1", "--taipy-force"]):
     with patch("sys.argv", ["prog", "--experiment", "2.1", "--taipy-force"]):
         init_config()
         init_config()
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         assert Config.core.mode == "experiment"
         assert Config.core.mode == "experiment"
         assert Config.core.version_number == "2.1"
         assert Config.core.version_number == "2.1"
         assert Config.core.force
         assert Config.core.force
-        core.stop()
+        orchestrator.stop()
 
 
 
 
 def test_dev_mode_clean_all_entities_of_the_latest_version():
 def test_dev_mode_clean_all_entities_of_the_latest_version():
@@ -93,11 +93,11 @@ def test_dev_mode_clean_all_entities_of_the_latest_version():
 
 
     # Create a scenario in development mode
     # Create a scenario in development mode
     with patch("sys.argv", ["prog"]):
     with patch("sys.argv", ["prog"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         taipy.submit(scenario)
         taipy.submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     # Initial assertion
     # Initial assertion
     assert len(_DataManager._get_all(version_number="all")) == 2
     assert len(_DataManager._get_all(version_number="all")) == 2
@@ -109,11 +109,11 @@ def test_dev_mode_clean_all_entities_of_the_latest_version():
 
 
     # Create a new scenario in experiment mode
     # Create a new scenario in experiment mode
     with patch("sys.argv", ["prog", "--experiment"]):
     with patch("sys.argv", ["prog", "--experiment"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         taipy.submit(scenario)
         taipy.submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     # Assert number of entities in 2nd version
     # Assert number of entities in 2nd version
     assert len(_DataManager._get_all(version_number="all")) == 4
     assert len(_DataManager._get_all(version_number="all")) == 4
@@ -126,8 +126,8 @@ def test_dev_mode_clean_all_entities_of_the_latest_version():
 
 
     # Run development mode again
     # Run development mode again
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
 
 
         # The 1st dev version should be deleted run with development mode
         # The 1st dev version should be deleted run with development mode
         assert len(_DataManager._get_all(version_number="all")) == 2
         assert len(_DataManager._get_all(version_number="all")) == 2
@@ -140,7 +140,7 @@ def test_dev_mode_clean_all_entities_of_the_latest_version():
         # Submit new dev version
         # Submit new dev version
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         taipy.submit(scenario)
         taipy.submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
         # Assert number of entities with 1 dev version and 1 exp version
         # Assert number of entities with 1 dev version and 1 exp version
         assert len(_DataManager._get_all(version_number="all")) == 4
         assert len(_DataManager._get_all(version_number="all")) == 4
@@ -191,11 +191,11 @@ def test_dev_mode_clean_all_entities_when_config_is_alternated():
 
 
     # Create a scenario in development mode with the doppelganger function
     # Create a scenario in development mode with the doppelganger function
     with patch("sys.argv", ["prog"]):
     with patch("sys.argv", ["prog"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         taipy.submit(scenario)
         taipy.submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
     # Delete the twice_doppelganger function
     # Delete the twice_doppelganger function
     # and clear cache of _load_fct() to simulate a new run
     # and clear cache of _load_fct() to simulate a new run
@@ -205,75 +205,75 @@ def test_dev_mode_clean_all_entities_when_config_is_alternated():
     # Create a scenario in development mode with another function
     # Create a scenario in development mode with another function
     scenario_config = config_scenario()
     scenario_config = config_scenario()
     with patch("sys.argv", ["prog"]):
     with patch("sys.argv", ["prog"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         scenario = _ScenarioManager._create(scenario_config)
         scenario = _ScenarioManager._create(scenario_config)
         taipy.submit(scenario)
         taipy.submit(scenario)
-        core.stop()
+        orchestrator.stop()
 
 
 
 
 def test_version_number_when_switching_mode():
 def test_version_number_when_switching_mode():
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_1 = _VersionManager._get_latest_version()
         ver_1 = _VersionManager._get_latest_version()
         ver_dev = _VersionManager._get_development_version()
         ver_dev = _VersionManager._get_development_version()
         assert ver_1 == ver_dev
         assert ver_1 == ver_dev
         assert len(_VersionManager._get_all()) == 1
         assert len(_VersionManager._get_all()) == 1
-        core.stop()
+        orchestrator.stop()
 
 
     # Run with dev mode, the version number is the same
     # Run with dev mode, the version number is the same
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_2 = _VersionManager._get_latest_version()
         ver_2 = _VersionManager._get_latest_version()
         assert ver_2 == ver_dev
         assert ver_2 == ver_dev
         assert len(_VersionManager._get_all()) == 1
         assert len(_VersionManager._get_all()) == 1
-        core.stop()
+        orchestrator.stop()
 
 
     # When run with experiment mode, a new version is created
     # When run with experiment mode, a new version is created
     with patch("sys.argv", ["prog", "--experiment"]):
     with patch("sys.argv", ["prog", "--experiment"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_3 = _VersionManager._get_latest_version()
         ver_3 = _VersionManager._get_latest_version()
         assert ver_3 != ver_dev
         assert ver_3 != ver_dev
         assert len(_VersionManager._get_all()) == 2
         assert len(_VersionManager._get_all()) == 2
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment", "2.1"]):
     with patch("sys.argv", ["prog", "--experiment", "2.1"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_4 = _VersionManager._get_latest_version()
         ver_4 = _VersionManager._get_latest_version()
         assert ver_4 == "2.1"
         assert ver_4 == "2.1"
         assert len(_VersionManager._get_all()) == 3
         assert len(_VersionManager._get_all()) == 3
-        core.stop()
+        orchestrator.stop()
 
 
     with patch("sys.argv", ["prog", "--experiment"]):
     with patch("sys.argv", ["prog", "--experiment"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_5 = _VersionManager._get_latest_version()
         ver_5 = _VersionManager._get_latest_version()
         assert ver_5 != ver_3
         assert ver_5 != ver_3
         assert ver_5 != ver_4
         assert ver_5 != ver_4
         assert ver_5 != ver_dev
         assert ver_5 != ver_dev
         assert len(_VersionManager._get_all()) == 4
         assert len(_VersionManager._get_all()) == 4
-        core.stop()
+        orchestrator.stop()
 
 
     # Run with dev mode, the version number is the same as the first dev version to override it
     # Run with dev mode, the version number is the same as the first dev version to override it
     with patch("sys.argv", ["prog", "--development"]):
     with patch("sys.argv", ["prog", "--development"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_7 = _VersionManager._get_latest_version()
         ver_7 = _VersionManager._get_latest_version()
         assert ver_1 == ver_7
         assert ver_1 == ver_7
         assert len(_VersionManager._get_all()) == 4
         assert len(_VersionManager._get_all()) == 4
-        core.stop()
+        orchestrator.stop()
 
 
 
 
 def test_force_override_experiment_version():
 def test_force_override_experiment_version():
     scenario_config = config_scenario()
     scenario_config = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_1 = _VersionManager._get_latest_version()
         ver_1 = _VersionManager._get_latest_version()
         assert ver_1 == "1.0"
         assert ver_1 == "1.0"
         # When create new experiment version, a development version entity is also created as a placeholder
         # When create new experiment version, a development version entity is also created as a placeholder
@@ -288,21 +288,21 @@ def test_force_override_experiment_version():
         assert len(_ScenarioManager._get_all()) == 1
         assert len(_ScenarioManager._get_all()) == 1
         assert len(_CycleManager._get_all()) == 1
         assert len(_CycleManager._get_all()) == 1
         assert len(_JobManager._get_all()) == 1
         assert len(_JobManager._get_all()) == 1
-        core.stop()
+        orchestrator.stop()
 
 
     Config.configure_global_app(foo="bar")
     Config.configure_global_app(foo="bar")
 
 
     # Without --taipy-force parameter, a SystemExit will be raised
     # Without --taipy-force parameter, a SystemExit will be raised
     with pytest.raises(SystemExit):
     with pytest.raises(SystemExit):
         with patch("sys.argv", ["prog", "--experiment", "1.0"]):
         with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-            core = Core()
-            core.run()
-    core.stop()
+            orchestrator = Orchestrator()
+            orchestrator.run()
+    orchestrator.stop()
 
 
     # With --taipy-force parameter
     # With --taipy-force parameter
     with patch("sys.argv", ["prog", "--experiment", "1.0", "--taipy-force"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0", "--taipy-force"]):
-        core = Core()
-        core.run()
+        orchestrator = Orchestrator()
+        orchestrator.run()
         ver_2 = _VersionManager._get_latest_version()
         ver_2 = _VersionManager._get_latest_version()
         assert ver_2 == "1.0"
         assert ver_2 == "1.0"
         assert len(_VersionManager._get_all()) == 2  # 2 version include 1 experiment 1 development
         assert len(_VersionManager._get_all()) == 2  # 2 version include 1 experiment 1 development
@@ -317,36 +317,36 @@ def test_force_override_experiment_version():
         assert len(_ScenarioManager._get_all()) == 2
         assert len(_ScenarioManager._get_all()) == 2
         assert len(_CycleManager._get_all()) == 1
         assert len(_CycleManager._get_all()) == 1
         assert len(_JobManager._get_all()) == 2
         assert len(_JobManager._get_all()) == 2
-        core.stop()
+        orchestrator.stop()
 
 
 
 
 def test_modified_job_configuration_dont_block_application_run(caplog, init_config):
 def test_modified_job_configuration_dont_block_application_run(caplog, init_config):
     _ = config_scenario()
     _ = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
+        orchestrator = Orchestrator()
         Config.configure_job_executions(mode="development")
         Config.configure_job_executions(mode="development")
-        core.run()
-        core.stop()
+        orchestrator.run()
+        orchestrator.stop()
     init_config()
     init_config()
     _ = config_scenario()
     _ = config_scenario()
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
+        orchestrator = Orchestrator()
         Config.configure_job_executions(mode="standalone", max_nb_of_workers=3)
         Config.configure_job_executions(mode="standalone", max_nb_of_workers=3)
-        core.run()
+        orchestrator.run()
         error_message = str(caplog.text)
         error_message = str(caplog.text)
         assert 'JOB "mode" was modified' in error_message
         assert 'JOB "mode" was modified' in error_message
         assert 'JOB "max_nb_of_workers" was added' in error_message
         assert 'JOB "max_nb_of_workers" was added' in error_message
-        core.stop()
+        orchestrator.stop()
 
 
 
 
 def test_modified_config_properties_without_force(caplog, init_config):
 def test_modified_config_properties_without_force(caplog, init_config):
     _ = config_scenario()
     _ = config_scenario()
 
 
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
     with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-        core = Core()
-        core.run()
-        core.stop()
+        orchestrator = Orchestrator()
+        orchestrator.run()
+        orchestrator.stop()
 
 
     init_config()
     init_config()
 
 
@@ -354,9 +354,9 @@ def test_modified_config_properties_without_force(caplog, init_config):
 
 
     with pytest.raises(SystemExit):
     with pytest.raises(SystemExit):
         with patch("sys.argv", ["prog", "--experiment", "1.0"]):
         with patch("sys.argv", ["prog", "--experiment", "1.0"]):
-            core = Core()
-            core.run()
-    core.stop()
+            orchestrator = Orchestrator()
+            orchestrator.run()
+    orchestrator.stop()
     error_message = str(caplog.text)
     error_message = str(caplog.text)
 
 
     assert 'DATA_NODE "d3" was added' in error_message
     assert 'DATA_NODE "d3" was added' in error_message

+ 5 - 5
tests/core/test_taipy.py

@@ -20,11 +20,11 @@ from taipy.config.common.scope import Scope
 from taipy.config.config import Config
 from taipy.config.config import Config
 from taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked
 from taipy.config.exceptions.exceptions import ConfigurationUpdateBlocked
 from taipy.core import (
 from taipy.core import (
-    Core,
     Cycle,
     Cycle,
     CycleId,
     CycleId,
     DataNodeId,
     DataNodeId,
     JobId,
     JobId,
+    Orchestrator,
     Scenario,
     Scenario,
     ScenarioId,
     ScenarioId,
     Sequence,
     Sequence,
@@ -348,7 +348,7 @@ class TestTaipy:
                 tp.submit(scenario)
                 tp.submit(scenario)
 
 
         assert len(warning) == 1
         assert len(warning) == 1
-        assert "The Core service is NOT running" in warning[0].message.args[0]
+        assert "The Orchestrator service is NOT running" in warning[0].message.args[0]
 
 
     def test_get_tasks(self):
     def test_get_tasks(self):
         with mock.patch("taipy.core.task._task_manager._TaskManager._get_all") as mck:
         with mock.patch("taipy.core.task._task_manager._TaskManager._get_all") as mck:
@@ -649,7 +649,7 @@ class TestTaipy:
         Config.configure_scenario("s1", [task_cfg_1], [], Frequency.DAILY)
         Config.configure_scenario("s1", [task_cfg_1], [], Frequency.DAILY)
 
 
         with mock.patch("sys.argv", ["prog"]):
         with mock.patch("sys.argv", ["prog"]):
-            core = Core()
+            core = Orchestrator()
             core.run()
             core.run()
 
 
         with pytest.raises(ConfigurationUpdateBlocked):
         with pytest.raises(ConfigurationUpdateBlocked):
@@ -699,7 +699,7 @@ class TestTaipy:
         dn_cfg_global = DataNodeConfig("id", "pickle", Scope.GLOBAL)
         dn_cfg_global = DataNodeConfig("id", "pickle", Scope.GLOBAL)
         dn_cfg_scenario = DataNodeConfig("id", "pickle", Scope.SCENARIO)
         dn_cfg_scenario = DataNodeConfig("id", "pickle", Scope.SCENARIO)
         with mock.patch("taipy.core.data._data_manager._DataManager._create_and_set") as dn_create_mock:
         with mock.patch("taipy.core.data._data_manager._DataManager._create_and_set") as dn_create_mock:
-            with mock.patch("taipy.core._core.Core._manage_version_and_block_config") as mv_mock:
+            with mock.patch("taipy.core.orchestrator.Orchestrator._manage_version_and_block_config") as mv_mock:
                 dn = tp.create_global_data_node(dn_cfg_global)
                 dn = tp.create_global_data_node(dn_cfg_global)
                 dn_create_mock.assert_called_once_with(dn_cfg_global, None, None)
                 dn_create_mock.assert_called_once_with(dn_cfg_global, None, None)
                 mv_mock.assert_called_once()
                 mv_mock.assert_called_once()
@@ -719,7 +719,7 @@ class TestTaipy:
     def test_create_scenario(self):
     def test_create_scenario(self):
         scenario_config = ScenarioConfig("scenario_config")
         scenario_config = ScenarioConfig("scenario_config")
         with mock.patch("taipy.core.scenario._scenario_manager._ScenarioManager._create") as mck:
         with mock.patch("taipy.core.scenario._scenario_manager._ScenarioManager._create") as mck:
-            with mock.patch("taipy.core._core.Core._manage_version_and_block_config") as mv_mock:
+            with mock.patch("taipy.core.orchestrator.Orchestrator._manage_version_and_block_config") as mv_mock:
                 tp.create_scenario(scenario_config)
                 tp.create_scenario(scenario_config)
                 mck.assert_called_once_with(scenario_config, None, None)
                 mck.assert_called_once_with(scenario_config, None, None)
                 mv_mock.assert_called_once()
                 mv_mock.assert_called_once()

+ 4 - 4
tests/templates/test_default_template.py

@@ -58,7 +58,7 @@ def test_main_file_with_and_without_extension(tmpdir):
     assert sorted(os.listdir(os.path.join(tmpdir, "foo_app"))) == sorted(["requirements.txt", "app.py"])
     assert sorted(os.listdir(os.path.join(tmpdir, "foo_app"))) == sorted(["requirements.txt", "app.py"])
 
 
 
 
-def test_with_core_service(tmpdir):
+def test_with_orchestrator_service(tmpdir):
     cookiecutter(
     cookiecutter(
         template="taipy/templates/default",
         template="taipy/templates/default",
         output_dir=str(tmpdir),
         output_dir=str(tmpdir),
@@ -73,7 +73,7 @@ def test_with_core_service(tmpdir):
         ["requirements.txt", "main.py", "configuration", "algorithms"]
         ["requirements.txt", "main.py", "configuration", "algorithms"]
     )
     )
     with open(os.path.join(tmpdir, "taipy_application", "main.py")) as main_file:
     with open(os.path.join(tmpdir, "taipy_application", "main.py")) as main_file:
-        assert "core = Core()" in main_file.read()
+        assert "orchestrator = Orchestrator()" in main_file.read()
 
 
     taipy_path = os.getcwd()
     taipy_path = os.getcwd()
     stdout = _run_template(taipy_path, os.path.join(tmpdir, "taipy_application"), "main.py")
     stdout = _run_template(taipy_path, os.path.join(tmpdir, "taipy_application"), "main.py")
@@ -106,7 +106,7 @@ def test_with_rest_service(tmpdir):
     assert "[Taipy][INFO] Development mode: " in stdout
     assert "[Taipy][INFO] Development mode: " in stdout
 
 
 
 
-def test_with_both_core_rest_services(tmpdir):
+def test_with_both_orchestrator_rest_services(tmpdir):
     cookiecutter(
     cookiecutter(
         template="taipy/templates/default",
         template="taipy/templates/default",
         output_dir=str(tmpdir),
         output_dir=str(tmpdir),
@@ -122,7 +122,7 @@ def test_with_both_core_rest_services(tmpdir):
     )
     )
     with open(os.path.join(tmpdir, "taipy_application", "main.py")) as main_file:
     with open(os.path.join(tmpdir, "taipy_application", "main.py")) as main_file:
         assert "rest = Rest()" in main_file.read()
         assert "rest = Rest()" in main_file.read()
-        assert "core = Core()" not in main_file.read()
+        assert "orchestrator = Orchestrator()" not in main_file.read()
 
 
     taipy_path = os.getcwd()
     taipy_path = os.getcwd()
     stdout = _run_template(taipy_path, os.path.join(tmpdir, "taipy_application"), "main.py")
     stdout = _run_template(taipy_path, os.path.join(tmpdir, "taipy_application"), "main.py")

+ 4 - 4
tests/test_run.py

@@ -12,7 +12,7 @@
 from unittest import mock
 from unittest import mock
 
 
 from taipy._run import _run
 from taipy._run import _run
-from taipy.core import Core
+from taipy.core import Orchestrator
 from taipy.gui import Gui
 from taipy.gui import Gui
 from taipy.rest import Rest
 from taipy.rest import Rest
 
 
@@ -25,7 +25,7 @@ def test_run_pass_with_gui(gui_run):
 
 
 @mock.patch("taipy.core.Core.run")
 @mock.patch("taipy.core.Core.run")
 def test_run_pass_with_core(core_run):
 def test_run_pass_with_core(core_run):
-    _run(Core())
+    _run(Orchestrator())
     core_run.assert_called_once()
     core_run.assert_called_once()
 
 
 
 
@@ -40,7 +40,7 @@ def test_run_pass_with_rest(rest_run, core_run):
 @mock.patch("taipy.rest.Rest.run")
 @mock.patch("taipy.rest.Rest.run")
 @mock.patch("taipy.core.Core.run")
 @mock.patch("taipy.core.Core.run")
 def test_run_pass_with_core_and_rest(core_run, rest_run):
 def test_run_pass_with_core_and_rest(core_run, rest_run):
-    _run(Core(), Rest())
+    _run(Orchestrator(), Rest())
     core_run.assert_called_once()
     core_run.assert_called_once()
     rest_run.assert_called_once()
     rest_run.assert_called_once()
 
 
@@ -58,6 +58,6 @@ def test_run_pass_with_gui_and_rest(core_run, rest_run, gui_run):
 @mock.patch("taipy.gui.Gui.run")
 @mock.patch("taipy.gui.Gui.run")
 @mock.patch("taipy.core.Core.run")
 @mock.patch("taipy.core.Core.run")
 def test_run_pass_with_gui_and_core(core_run, gui_run):
 def test_run_pass_with_gui_and_core(core_run, gui_run):
-    _run(Gui(), Core())
+    _run(Gui(), Orchestrator())
     gui_run.assert_called_once()
     gui_run.assert_called_once()
     core_run.assert_called_once()
     core_run.assert_called_once()