Skip to content

Fix distribution part of dstool readme #14750

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

Merged
merged 1 commit into from
Feb 19, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 14 additions & 46 deletions ydb/apps/dstool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,20 @@

## Install ydb-dstool package

For Unix-like systems:

```bash
user@host:~$ pip install ydb-dstool
user@host:~$ curl -sSL 'https://install.ydb.tech/dstool' | bash
```

## Set up environment and run
For Windows:

```bash
user@host:~$ export PATH=${PATH}:${HOME}/.local/bin
user@host:~$ ydb-dstool -e ydb.endpoint cluster list
```powershell
iex (New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows')
```

```cmd
@"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://install.ydb.tech/dstool-windows'))"
```

# How to run ydb-dstool from source
Expand All @@ -23,49 +28,12 @@ user@host:~$ cd github
user@host:~/github$ git clone https://github.com/ydb-platform/ydb.git
```

## Install grpc_tools python package

Follow the steps described at https://grpc.io/docs/languages/python/quickstart.

Typical command to install the `grpc_tools` package:
## Use ya make to build ydb-dstool

```bash
pip3 install grpcio-tools 'protobuf<5.0.0,>=3.13.0'
```

## Compile proto files for python

```bash
user@host:~$ cd ~/github/ydb
user@host:~/github/ydb$ ydb_root=$(pwd)
user@host:~/github/ydb$ ./ydb/apps/dstool/compile_protos.py --ydb-root ${ydb_root} 2>/dev/null
```

## Set up environment and run

```bash
user@host:~$ cd ~/github/ydb
user@host:~/github/ydb$ ydb_root=$(pwd)
user@host:~/github/ydb$ export PATH=${PATH}:${ydb_root}/ydb/apps/dstool
user@host:~/github/ydb$ export PYTHONPATH=${PYTHONPATH}:${ydb_root}
user@host:~/github/ydb$ alias ydb-dstool=${PWD}/main.py
user@host:~/github/ydb$ ydb-dstool -e ydb.endpoint cluster list
```

# How to build and upload ydb-dstool package

```bash
user@host:~$ mkdir github
user@host:~$ cd github
user@host:~/github$ git clone https://github.com/ydb-platform/ydb.git
user@host:~/github$ cd ydb
user@host:~/github/ydb$ ydb_root=$(pwd)
user@host:~/github/ydb$ ./ydb/apps/dstool/compile_protos.py --ydb-root ${ydb_root} 2>/dev/null
user@host:~/github/ydb$ mv ydb/apps/dstool/setup.py .
user@host:~/github/ydb$ python3 -m pip install --upgrade build
user@host:~/github/ydb$ python3 -m build
user@host:~/github/ydb$ python3 -m pip install --upgrade twine
user@host:~/github/ydb$ python3 -m twine upload dist/*
user@host:~/github$ cd ydb/apps/dstool
user@host:~/github/ydb/apps/dstool$ ya make
user@host:~/github/ydb/apps/dstool$ ./ydb-dstool --help
```

# How to do things with ydb-dstool
Expand Down
Loading