Skip to content

cli: implement cluster worker publish command#1277

Open
oleg-jukovec wants to merge 1 commit intomasterfrom
oleg-jukovec/tntp-7062-worker-publish
Open

cli: implement cluster worker publish command#1277
oleg-jukovec wants to merge 1 commit intomasterfrom
oleg-jukovec/tntp-7062-worker-publish

Conversation

@oleg-jukovec
Copy link
Copy Markdown
Contributor

@oleg-jukovec oleg-jukovec commented Apr 16, 2026

@TarantoolBot document
Title: tt cluster worker publish implementation

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[?args]
  • 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

@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-7062-worker-publish branch 4 times, most recently from f45f071 to e33c53a Compare April 16, 2026 14:34
@oleg-jukovec oleg-jukovec marked this pull request as ready for review April 17, 2026 10:38
@oleg-jukovec oleg-jukovec requested review from bigbes and sssciel April 17, 2026 10:39
@oleg-jukovec oleg-jukovec added the full-ci Enables full ci tests label Apr 17, 2026
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-7059-cluster-worker-prepare branch from 7a6bee5 to 804c2e8 Compare April 27, 2026 15:22
Base automatically changed from oleg-jukovec/tntp-7059-cluster-worker-prepare to master April 29, 2026 04:41
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-7062-worker-publish branch 4 times, most recently from 459fa06 to afbf1f6 Compare May 1, 2026 16:31
@oleg-jukovec oleg-jukovec requested review from bigbes and sssciel and removed request for bigbes May 1, 2026 16:39
@patapenka-alexey patapenka-alexey self-requested a review May 4, 2026 07:16
Copy link
Copy Markdown
Member

@sssciel sssciel left a comment

Choose a reason for hiding this comment

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

CI is red

@TarantoolBot document
Title: `tt cluster worker publish` implementation

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
@oleg-jukovec oleg-jukovec force-pushed the oleg-jukovec/tntp-7062-worker-publish branch from afbf1f6 to ab12573 Compare May 4, 2026 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

full-ci Enables full ci tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants