Skip to content

Core config

The CoreSection holds configuration fields related to the Core service.

Here are the (optional) configurable properties:

  • root_folder: The path of the base folder for the Taipy application, its default value is "./taipy/".
  • storage_folder: The folder name used to store Taipy data, its default value is ".data/". It is used in conjunction with the root_folder field. That means the default storage path is "./taipy/.data/".
  • read_entity_retry: An integer number only used with filesystem repository_type.
    It corresponds to the number of times Taipy retries reading an entity after a failed attempt for concurrent access.
    The default value is 1.
  • repository_type: The type of storage that will be used to hold Taipy entities. Available options are: filesystem, sql and mongo. The filesystem will be used as the default repository if no repository type is informed.
  • repository_properties: A dictionary of properties that will be used to instantiate the chosen repository. Only required if the chosen repository is sql or mongo.
    If repository_type is set to filesystem, Taipy uses root_folder and storage_folder to store entities. In this case, repository_properties attribute is not required.
    If repository_type is set to sql, the db_location attribute is required as the path of a sqlite3 database file. Please refer to SQL storage section.
    If repository_type is set to mongo, the possible properties are mongodb_hostname, mongodb_user, mongodb_password, mongodb_port, application_db, properties. Please refer to MongoDB storage section.
  • mode: A string that indicates the mode of the version management system. Possible values are "development", "experiment", or "production".
  • version_number: The identifier of the version. In development mode, the version number is ignored.
  • force: Indicates whether Taipy will override a version even if the configuration has changed or not and run the application. Default to False.
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
from taipy import Config

Config.configure_core(
    root_folder=".taipy_root_folder/",
    storage_folder=".data_folder",
    read_entity_retry=2,
    mode="experiment",
    version_number="1.0.0",
    application_name="my_application",
)
1
2
3
from taipy import Config

Config.load("config.toml")
config.toml
1
2
3
4
5
6
7
8
9
[TAIPY]

[CORE]
root_folder = ".taipy_root_folder/"
storage_folder = ".data_folder"
read_entity_retry = "2:int"
mode = "experiment"
version_number = "1.0.0"
application_name = "my_application"

In this example, we configure:

  • Custom values for the root_folder, storage_folder, and read_entity_retry parameters. Note that most of the time, the default values can be used.
  • The mode of the version management system to experiment mode, and the version_number is set to "1.0.0".
    Please refer to the Version management configuration documentation page for more details.
  • In lines 9, a custom application_name property are specified.

SQL storage for Taipy entities

The configuration needed to use a SQL database, through sqlite3 engine, is described in the lines 6-7.

1
2
3
4
5
6
7
8
from taipy import Config

Config.configure_core(
    root_folder=".taipy_root_folder/",
    storage_folder=".data_folder",
    repository_type="sql",
    repository_properties={"db_location": "path_to_sqlite_file/database.db"},
)
Taipy creates a table called taipy_model in the database described in the configuration, where it stores information about the taipy entities.

Here are the configurable properties for the SQL repository: - db_location: The path of a sqlite3 database file.

MongoDB storage for Taipy entities

Available in Taipy Enterprise edition

This section is relevant only to the Enterprise edition of Taipy.

The configuration needed to use a mongo database is described in the lines 6-14.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
from taipy import Config

Config.configure_core(
    root_folder=".taipy_root_folder/",
    storage_folder=".data_folder",
    repository_type="mongo",
    repository_properties={
        "mongodb_hostname": "localhost",
        "mongodb_user": "username",
        "mongodb_password": "passwd",
        "mongodb_port": 27017,
        "application_db": "taipy",
    }
)

Taipy will create a collection, in the database described in the configuration, for each Taipy entity (Cycle, Scenario, DataNode, Task and Job), where it will store information about the Taipy entities.

Here are the configurable properties for the Mongo repository:

  • mongodb_hostname: The URL for the mongo database.
  • mongodb_user: The username to access the database.
  • mongodb_password: The password to access the database.
  • mongodb_port: The port to access the database. This property is optional and has 27017 as a default value.
  • application_db: The database that will hold the taipy collections.

The next section introduces the job orchestration configuration.