tarantool / tarantool/doc

`tt cluster worker publish` implementation

Open
#5,660 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
CSS
Stars
15
Forks
49
Avg merge
1d 13h
Merged PRs (30d)
3

Description

Implement tt cluster worker publish command for publishing worker
configurations to etcd or tarantool config storage (TCS). The command
accepts a URL with format:

http(s)://[username:password@]host:port/prefix/host-name/worker-name
  • prefix - a base path to the worker configuration.
  • host-name - a name of the host.
  • worker-name - a name of the worker.

Possible arguments:

  • timeout - a request timeout in seconds (default 3.0).
  • ssl_key_file - a path to a private SSL key file.
  • ssl_cert_file - a path to an SSL certificate file.
  • ssl_ca_file - a path to a trusted certificate authorities
    (CA) file.
  • ssl_ca_path - a path to a trusted certificate authorities
    (CA) directory.
  • ssl_ciphers - a list of allowed SSL ciphers.
  • verify_host - set off (default true) verification of the
    certificate’s name against the host.
  • verify_peer - set off (default true) verification of the peer’s
    SSL certificate.

The command supports the following environment variables:

  • TT_CLI_USERNAME - specifies a Tarantool username;
  • TT_CLI_PASSWORD - specifies a Tarantool password.
  • TT_CLI_ETCD_USERNAME - specifies a Etcd username;
  • TT_CLI_ETCD_PASSWORD - specifies a Etcd password.

The priority of credentials:

environment variables < command flags < URL credentials.

Usage:

tt cluster worker publish <URI> <FILE>

Supported flags:

--force             force publish and skip checking existence

-h, --help help for publish
-p, --password string password (used as etcd/tarantool config
storage credentials)
-u, --username string username (used as etcd/tarantool config
storage credentials)

Example:

tt cluster worker publish \
  https://user:pass@localhost:2379/cluster/workers/host/server-1 \
  worker.yaml

The implementation uses go-storage library for both etcd and TCS.
Without --force flag, it checks if the key already exists before
publishing. Due to go-storage limitations (no "count" predicate
support), this check is done via two separate transactions with a
potential race condition.

Closes TNTP-7062
Requested by @oleg-jukovec in https://github.com/tarantool/tt/commit/303dc241ea3b4efab3da93481f256dc5f82a3d9a.

Contributor guide

Open the contributing guide

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

Start at the tt cluster worker publish command entry point and inspect how the go-storage library is used for etcd and Tarantool config storage. Trace URI parsing, credential precedence, SSL options, and the existence check before publishing. Done means the command accepts the documented URI, flags, environment variables, and worker file, and honors --force when publishing.

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
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.