Skip to content

[Epic] 3.0 config - Part 1 #3544

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
14 tasks done
veod32 opened this issue Jun 26, 2023 · 2 comments
Closed
14 tasks done

[Epic] 3.0 config - Part 1 #3544

veod32 opened this issue Jun 26, 2023 · 2 comments
Assignees

Comments

Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 24, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema, no need to update the issue.
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 24, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 24, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 24, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 26, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 26, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 26, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 26, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Jul 27, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Totktonada pushed a commit to tarantool/tarantool that referenced this issue Jul 27, 2023
The following box.cfg options were described in instance_config
with defaults similar to ones in box.cfg:
* auth_type
* auth_delay
* disable_guest
* password_lifetime_days
* password_min_length
* password_enforce_uppercase
* password_enforce_lowercase
* password_enforce_digits
* password_enforce_specialchars
* password_history_length

Part of #8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 27, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 28, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 28, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of tarantool#8862

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 31, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of tarantool#8862

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 31, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 31, 2023
It lists the environment variables that are taken into account by the
config module.

TBD: Part of #xxxx

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to Totktonada/tarantool that referenced this issue Jul 31, 2023
It lists the environment variables that are taken into account by the
config module.

TBD: Part of #xxxx

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to Totktonada/tarantool that referenced this issue Aug 2, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of tarantool#8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to tarantool/tarantool that referenced this issue Aug 2, 2023
The usual environment configuration source is useful for parametrized
run:

```
TT_MEMTX_MEMORY=<...> tarantool --name <...> --config <...>
```

However, sometimes a user may need to set a default value, which doesn't
rewrite one that is provided in the configuration. Now, it is possible
to do using the environment variables with the `_DEFAULT` suffix.

```
TT_MEMTX_MEMORY_DEFAULT=<...> tarantool --name <...> --config <...>
```

This feature may be especially useful for wrappers that run tarantool
internally with some default paths for data directories, socket files,
pid file. We likely will use it in the `tt` tool.

Part of #8862

NO_DOC=added into tarantool/doc#3544 manually
Totktonada added a commit to Totktonada/tarantool that referenced this issue Aug 2, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of tarantool#8862

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to tarantool/tarantool that referenced this issue Aug 3, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of #8862

NO_DOC=reflected in tarantool/doc#3544
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Aug 3, 2023
This patch introduces all metrics configuration.

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA pushed a commit to Lord-KA/tarantool that referenced this issue Aug 3, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of tarantool#8862

NO_DOC=reflected in tarantool/doc#3544
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Aug 3, 2023
This patch introduces all metrics configuration.

Part of tarantool#8861

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA pushed a commit to Lord-KA/tarantool that referenced this issue Aug 3, 2023
It is convenient to access configuration using `config:get()` from the
application script (`app.file` or `app.module`).

However, before this commit, it was not possible, because the
configuration was not considered as applied before the application
script is loaded.

Now, the script loading is moved into the post-apply phase.

The resulting sequence of steps on startup/reload is the following.

* collect configuration information (from all the sources)
* <if the previous step is failed, set `check_errors` status and break>
* apply the configuration (call all the appliers)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>
* call post-apply hooks (including application script loading)
* <if the previous step is failed, set `check_errors` status and break>
* <set the new successful status: `ready` or `check_warnings`>

I would like to briefly comment the changes in the tests.

* `app_test.lua`: added the check for the new behavior (call
  config:get() from the app script)
* `appliers_test.lua`: fixed the applier call (`.apply` ->
  `.post_apply`)
* `config_test.lua`: fixed status observed in the app script
  (`*_in_progress` -> `ready`)

Part of tarantool#8862

NO_DOC=reflected in tarantool/doc#3544
Totktonada added a commit to tarantool/tarantool that referenced this issue Aug 22, 2023
It is convenient for development environments, when the configuration
file and the application sources reside in the same directory.

The same logic was recently implemented for the main script, see #8182.
The same problems appears in context of startup from a configuration
file, so it seems meaningful to adjust module search paths in this case
too.

Part of #8862

NO_DOC=This change is too minor to describe in the documentation issue
       tarantool/doc#3544. I'll work with the
       documentation team regarding details of startup/reload flow and
       we'll determine what should go to the user documentation and what
       shouldn't.
@veod32 veod32 added the config label Aug 28, 2023
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Sep 4, 2023
All user-defined users and roles are not being removed and their
privileges are not being revoked when this user or role is removed
from config. This is done to prevent extreme repercussions of
misconfiguration, e.g. empty config is provided to cluster and it
breaks up.

Default users and roles are not supposed to be changed, so this rule
does not apply to them. Now all of non-default privileges will be
revoked if such user or role is removed from config.

Default users:
* guest
* admin

Default roles:
* super
* public
* replication

Part of tarantool#8967

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
Lord-KA added a commit to Lord-KA/tarantool that referenced this issue Sep 4, 2023
All user-defined users and roles are not being removed and their
privileges are not being revoked when this user or role is removed
from config. This is done to prevent extreme repercussions of
misconfiguration, e.g. empty config is provided to cluster and it
breaks up.

Default users and roles are not supposed to be changed, so this rule
does not apply to them. Now all of non-default privileges will be
revoked if such user or role is removed from config.

Default users:
* guest
* admin

Default roles:
* super
* public
* replication

Part of tarantool#8967

NO_DOC=tarantool/doc#3544 links the most actual schema,
       no need to update the issue.
@tarantool tarantool deleted a comment from andreyaksenov Sep 8, 2023
@veod32 veod32 removed their assignment Sep 21, 2023
@andreyaksenov andreyaksenov changed the title [Epic] 3.0 config [Epic] 3.0 config - Part 1 Dec 21, 2023
@andreyaksenov
Copy link
Contributor

andreyaksenov commented Dec 21, 2023

Details

  • Describe the concept.
    • The idea of a declarative configuration (Declarative server and cluster configuration tarantool#8724).
    • The idea of a centralized configuration available in Tarantool EE (https://github.com/tarantool/tarantool-ee/issues/476).
    • Instance and cluster config. Global, group, replicaset, instance scopes in the cluster config. How the cluster config folded into the instance config.
    • Configuration sources: env (CE/EE), file (CE/EE), etcd (EE), env default (CE/EE). Difference between instance/cluster config sources. Sources priority. How the values are merged.
    • Etcd source: content of the etcd keys (yaml), how the keys are searched, priority of the keys, how the keys are merged.
    • Etcd source: config.reload option and when the configuration is reloaded.
    • CLI options: --name (-n), --config (-c), --help-env-list.
    • Instance config schema (https://github.com/tarantool/tarantool/blob/master/src/box/lua/config/instance_config.lua).
    • Instance config defaults.
    • Templating ({{ instance_name }}).
    • Option constraints: sections/options that can't appear in any scope.
    • Recipe: how to work with etcd.
    • Recipe: how to start an instance without a local file config in EE (configure etcd source from env variables).
    • replication.peers option and its default (URI list autoconstruction).
    • replication.failover option and a two phase startup process with configuration reloading.
    • Configuration examples (https://github.com/tarantool/tarantool/tree/master/doc/examples/config).
    • Configuration applying idempotence: how the config's 'target state' approach differs from the 'state changes' box.cfg() approach.
    • How non-dynamic box.cfg() options are applied (no error, wait for restart).
    • config module API: :get(), :info(), :reload().
    • How and when status is changed (state diagram).
  • Step-by-step/how-to guides

Demo:

Recording: https://cloud.mail.ru/public/3KEi/gnVzVELJL
Notes: https://www.notion.so/tarantool/Getting-Started-with-3-0-03d461efc01c43dd9e09f2bc4903717b

Demo 2024-08-24 (3.0.0-alpha2)

Recording: https://cloud.mail.ru/public/ANBh/WPUNQk8Wg
Slides: https://docs.google.com/presentation/d/1nGGOLzVik4vGppN9jpbLXsXCMl-M4j9--ZC_nEkyHb0/edit?usp=sharing
Sharding example code: https://gist.github.com/Totktonada/6339517a32cd7df4ac7df700fc3fa6b8

State diagram

stateDiagram-v2
    pre_ready: ready
    pre_check_warnings: check_warnings
    pre_check_errors: check_errors
    wait_for_reload: wait for config#colon;reload()
    note left of pre_check_errors: waits for config#colon;reload()

    [*] --> startup_in_progress: broadcast
    startup_in_progress --> _collect

    wait_for_reload --> reload_in_progress: broadcast
    reload_in_progress --> _collect

    _collect --> _apply

    state _apply {
        [*] --> pre_ready: broadcast
        [*] --> pre_check_warnings: broadcast
        [*] --> pre_check_errors: broadcast
    }

    pre_ready --> _post_apply
    pre_check_warnings --> _post_apply
    _apply --> wait_for_reload

    state _post_apply {
        [*] --> ready: broadcast
        [*] --> check_warnings: broadcast
        [*] --> check_errors: broadcast
    }

    _post_apply --> wait_for_reload
Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants