Skip to content
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

Adapt the server to use the declarative config #384

Merged

Conversation

ochaplashkin
Copy link

@ochaplashkin ochaplashkin commented Jul 10, 2024

You can use a declarative config file to configure a server instance via the following options:

  • config_file (optional) Declarative YAML configuration for a server
    instance. Used to deduce advertise URI to connect net.box to the
    instance. The special value '' means running without --config ...
    CLI option (but still passes --name <alias>).

  • remote_config (optional) If config_file is not passed, this config
    value is used to deduce the advertise URI to connect net.box to
    the instance.

Close #367

@ochaplashkin ochaplashkin force-pushed the adapt-server-to-declarative-config branch 3 times, most recently from e19c102 to d4db96a Compare July 10, 2024 16:34
@ochaplashkin
Copy link
Author

diff for the tarantool tests
diff --git a/test/config-luatest/basic_test.lua b/test/config-luatest/basic_test.lua
index 571e8335b..e14c6d506 100644
--- a/test/config-luatest/basic_test.lua
+++ b/test/config-luatest/basic_test.lua
@@ -4,7 +4,7 @@ local fio = require('fio')
 local t = require('luatest')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 local cbuilder = require('test.config-luatest.cbuilder')
 
diff --git a/test/config-luatest/box_cfg_env_test.lua b/test/config-luatest/box_cfg_env_test.lua
index 16282aaf3..47d1f5694 100644
--- a/test/config-luatest/box_cfg_env_test.lua
+++ b/test/config-luatest/box_cfg_env_test.lua
@@ -3,7 +3,7 @@ local yaml = require('yaml')
 local net_box = require('net.box')
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 
 local g = helpers.group()
diff --git a/test/config-luatest/cluster.lua b/test/config-luatest/cluster.lua
index 420501f1f..fb4d6fcc9 100644
--- a/test/config-luatest/cluster.lua
+++ b/test/config-luatest/cluster.lua
@@ -29,7 +29,7 @@ local yaml = require('yaml')
 local t = require('luatest')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 
 local function init(g)
     treegen.init(g)
diff --git a/test/config-luatest/conditional_section_test.lua b/test/config-luatest/conditional_section_test.lua
index bb2b09809..d4f7ba653 100644
--- a/test/config-luatest/conditional_section_test.lua
+++ b/test/config-luatest/conditional_section_test.lua
@@ -2,7 +2,7 @@ local fun = require('fun')
 local fio = require('fio')
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 local cluster_config = require('internal.config.cluster_config')
 
diff --git a/test/config-luatest/config_test.lua b/test/config-luatest/config_test.lua
index d831f1531..d91364581 100644
--- a/test/config-luatest/config_test.lua
+++ b/test/config-luatest/config_test.lua
@@ -1,5 +1,5 @@
 local t = require('luatest')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
diff --git a/test/config-luatest/helpers.lua b/test/config-luatest/helpers.lua
index e3cfed91f..cecf65654 100644
--- a/test/config-luatest/helpers.lua
+++ b/test/config-luatest/helpers.lua
@@ -5,7 +5,7 @@ local cluster_config = require('internal.config.cluster_config')
 local t = require('luatest')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 
 local function group(name, params)
     local g = t.group(name, params)
@@ -82,6 +82,7 @@ local function start_example_replicaset(g, dir, config_file, opts)
     g.server_1 = server:new(fun.chain(opts, {alias = 'instance-001'}):tomap())
     g.server_2 = server:new(fun.chain(opts, {alias = 'instance-002'}):tomap())
     g.server_3 = server:new(fun.chain(opts, {alias = 'instance-003'}):tomap())
+    print('server_3 is ready \n\n\n\n')
 
     g.server_1:start({wait_until_ready = false})
     g.server_2:start({wait_until_ready = false})
diff --git a/test/config-luatest/names_upgrade_test.lua b/test/config-luatest/names_upgrade_test.lua
index 4438b4e2d..3b6bd3642 100644
--- a/test/config-luatest/names_upgrade_test.lua
+++ b/test/config-luatest/names_upgrade_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local yaml = require('yaml')
 local fun = require('fun')
 local fio = require('fio')
diff --git a/test/config-luatest/reload_test.lua b/test/config-luatest/reload_test.lua
index 464b2ddb7..08190d32b 100644
--- a/test/config-luatest/reload_test.lua
+++ b/test/config-luatest/reload_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 
 local g = t.group()
 
diff --git a/test/config-luatest/rpc_test.lua b/test/config-luatest/rpc_test.lua
index 4e4b26f12..2909cc6bd 100644
--- a/test/config-luatest/rpc_test.lua
+++ b/test/config-luatest/rpc_test.lua
@@ -1,7 +1,7 @@
 local t = require('luatest')
 local fun = require('fun')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 
 local g = helpers.group()
diff --git a/test/config-luatest/set_names_reload_test.lua b/test/config-luatest/set_names_reload_test.lua
index 65cc82ec8..82697de22 100644
--- a/test/config-luatest/set_names_reload_test.lua
+++ b/test/config-luatest/set_names_reload_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local replica_set = require('luatest.replica_set')
 local yaml = require('yaml')
 local uuid = require('uuid')
diff --git a/test/config-luatest/set_names_test.lua b/test/config-luatest/set_names_test.lua
index 93445f341..ee5dc9ecd 100644
--- a/test/config-luatest/set_names_test.lua
+++ b/test/config-luatest/set_names_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local replica_set = require('luatest.replica_set')
 local yaml = require('yaml')
 local uuid = require('uuid')
diff --git a/test/config-luatest/sources_test.lua b/test/config-luatest/sources_test.lua
index f20aaf19c..ebd0a1949 100644
--- a/test/config-luatest/sources_test.lua
+++ b/test/config-luatest/sources_test.lua
@@ -5,7 +5,7 @@ local yaml = require('yaml')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
 local source_file = require('internal.config.source.file').new()
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 
 local g = t.group()
 
diff --git a/test/config-luatest/upgrade_test.lua b/test/config-luatest/upgrade_test.lua
index cb3383f31..5420a9653 100644
--- a/test/config-luatest/upgrade_test.lua
+++ b/test/config-luatest/upgrade_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local yaml = require('yaml')
 local fio = require('fio')
 
diff --git a/test/config-luatest/vshard_test.lua b/test/config-luatest/vshard_test.lua
index 7abd2a62c..ebd40b206 100644
--- a/test/config-luatest/vshard_test.lua
+++ b/test/config-luatest/vshard_test.lua
@@ -2,7 +2,7 @@ local fun = require('fun')
 local t = require('luatest')
 local treegen = require('test.treegen')
 local justrun = require('test.justrun')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 
 local g = helpers.group()
diff --git a/test/config-luatest/vshard_upgrade_test.lua b/test/config-luatest/vshard_upgrade_test.lua
index 2a6620e8d..9a53d2494 100644
--- a/test/config-luatest/vshard_upgrade_test.lua
+++ b/test/config-luatest/vshard_upgrade_test.lua
@@ -1,6 +1,6 @@
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local yaml = require('yaml')
 local fun = require('fun')
 local fio = require('fio')
diff --git a/test/config-luatest/work_dir_test.lua b/test/config-luatest/work_dir_test.lua
index 30d7bf337..62ea19032 100644
--- a/test/config-luatest/work_dir_test.lua
+++ b/test/config-luatest/work_dir_test.lua
@@ -2,7 +2,7 @@ local fun = require('fun')
 local yaml = require('yaml')
 local t = require('luatest')
 local treegen = require('test.treegen')
-local server = require('test.luatest_helpers.server')
+local server = require('luatest.server')
 local helpers = require('test.config-luatest.helpers')
 
 local g = helpers.group()

luatest/server.lua Outdated Show resolved Hide resolved
luatest/server.lua Outdated Show resolved Hide resolved
luatest/server.lua Outdated Show resolved Hide resolved
luatest/server.lua Outdated Show resolved Hide resolved
luatest/server.lua Outdated Show resolved Hide resolved
luatest/server.lua Outdated Show resolved Hide resolved
Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've no objections, LGTM. Let's consider some suggestions above.

@ylobankov ylobankov force-pushed the adapt-server-to-declarative-config branch 2 times, most recently from 29cabb0 to ec308ed Compare July 26, 2024 15:54
@ylobankov ylobankov removed their request for review July 26, 2024 15:57
Oleg Chaplashkin and others added 2 commits July 26, 2024 19:03
You can use a declarative config file to configure a server instance
via the following options:

  - config_file (optional) Declarative YAML configuration for a server
    instance. Used to deduce advertise URI to connect `net.box` to the
    instance. The special value '' means running without `--config ...`
    CLI option (but still passes `--name <alias>`).

  - remote_config (optional) If `config_file` is not passed, this config
    value is used to deduce the advertise URI to connect `net.box` to
    the instance.

Close tarantool#367
@ylobankov ylobankov force-pushed the adapt-server-to-declarative-config branch from ec308ed to a878839 Compare July 26, 2024 16:04
@ylobankov ylobankov merged commit a978383 into tarantool:master Aug 2, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Tarantool 3.0+ stuff in server.lua
3 participants