tarantool / tarantool/tt

cluster: implement environment variable parsing based on a schema

Open
#731 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

5sp feature teamE
Dominant language
Go
Stars
113
Forks
18
Avg merge
4d 11h
Merged PRs (30d)
23

Description

At this moment we use environment variables just as strings. It leads to incompatibility with tarantool:

It fails for tt:

$ TT_CONFIG_ETCD_ENDPOINTS="http://127.0.0.1:2379" TT_CONFIG_ETCD_PREFIX="/default" tt start app1
   ⨯ can't collect instance information for app1: error loading instance "router-a-001" configuration from config "/home/user/work/tmp/vshard_template/instances.enabled/app1/config.yaml": unable to parse cluster config from file: failed to parse a configuration data as a cluster config: failed to unmarshal ClusterConfig: yaml: unmarshal errors:
  line 3: cannot unmarshal !!str `http://...` into []string

But if you run tarantool with the same environment variables, then everything works fine.

So we need to re-implement logic from the tarantool to parse environment variables in the same way:

https://github.com/tarantool/tarantool/blob/b8d733df8ce0c5da137fa2bba7c185b2fd877935/src/box/lua/config/utils/schema.lua#L1594-L1781

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with the documented TT_CONFIG_ETCD_ENDPOINTS and TT_CONFIG_ETCD_PREFIX values while loading instances.enabled/app1/config.yaml. Read Tarantool's schema.lua environment-variable parsing implementation at the linked lines, then verify that tt start app1 accepts the same values and loads the cluster configuration successfully.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.