Skip to content

Commit 471d8ac

Browse files
elabproEugene Arbatskyanton-bobkovblinkovshmel1k
authored
YDBOPS-11054 Install description (#13636)
Co-authored-by: Eugene Arbatsky <elabpro@yandex-team.ru> Co-authored-by: anton-bobkov <anton-bobkov@ydb.tech> Co-authored-by: Ivan Blinkov <ivan@blinkov.ru> Co-authored-by: Alexander Petrukhin <shmel1k@ydb.tech>
1 parent e702c13 commit 471d8ac

File tree

2 files changed

+143
-26
lines changed

2 files changed

+143
-26
lines changed

ydb/docs/en/core/reference/ydbops/install.md

Lines changed: 73 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,90 @@
22

33
{% include [warning.md](_includes/warning.md) %}
44

5-
Currently, only building from source is available as an installation option. The pre-compiled executables will be available later.
5+
## Download the binary from the releases page
66

7-
## Building from source
7+
You can download binary releases from [{#T}](../../downloads/index.md#ydbops).
88

9-
1. [Install Go](https://go.dev/doc/install). The minimal required Go version is 1.21.
9+
## Building from source
1010

11-
2. Clone the `ydbops` repository from GitHub:
11+
1. Clone the `ydbops` repository from GitHub:
1212

1313
```bash
1414
git clone https://github.com/ydb-platform/ydbops.git
1515
```
1616

17-
3. Invoke `go build` in the repository root folder:
17+
2. There are two ways to build `ydbops`:
18+
1. [Directly with Go](#go)
19+
2. [Inside a Docker container](#docker)
1820

19-
```bash
20-
go build
21-
```
21+
The second approach requires a prepared [Docker](https://en.wikipedia.org/wiki/Docker_(software)) environment and uses the official Docker image for [Golang](https://en.wikipedia.org/wiki/Go_(programming_language)) [v1.22](https://hub.docker.com/_/golang/tags?name=1.22), guaranteeing a successful build. The Docker container operates using the `Dockerfile` from the repository. The build process in Docker also performs additional tasks: running linter checks and substituting the version for the `ydbops` assembly to register it in the executable file.
22+
23+
### Building directly with Go {#go}
24+
25+
#### Prerequsites
26+
27+
[Install Go](https://go.dev/doc/install). The recommended version is 1.22.
28+
29+
30+
#### Compiling
31+
32+
Invoke `go build` in the repository root folder:
33+
34+
```bash
35+
go build
36+
```
37+
38+
The `ydbops` executable will be available in the repository root folder.
39+
40+
#### Installing
41+
42+
You can copy the executable file manually or use `make`:
43+
44+
```bash
45+
make install INSTALL_DIR=install_folder BUILD_DIR=.
46+
```
47+
48+
### Inside a Docker container {#docker}
49+
50+
#### Prerequsites
51+
52+
- make
53+
- [Install docker engine](https://docs.docker.com/engine/install/)
54+
55+
#### Compiling
56+
57+
Invoke this command in the repository root folder:
58+
59+
```bash
60+
make build-in-docker
61+
```
62+
63+
The `ydbops` executables will be available in the `bin` folder. Binary files are generated for Linux and macOS (arm64, amd64).
64+
65+
| Binary name | Platform |
66+
|------------------------|--------------|
67+
| ydbops | Linux (amd64) |
68+
| ydbops_darwin_amd64 | macOS (amd64) |
69+
| ydbops_darwin_arm64 | macOS (arm64) |
70+
71+
72+
#### Installing
73+
74+
To install the binary file, execute the command `make`.
75+
76+
Optional parameters:
77+
78+
- `INSTALL_DIR`: The folder where the executable file will be installed. Default value: `~/ydb/bin`.
2279

23-
The `ydbops` executable will be available in the repository root folder.
80+
- `BUILD_DIR`: The folder that contains the generated executable file. Use this parameter if you created the executable file manually. For example, use `BUILD_DIR=.` if the executable file is in the current working directory.
2481

25-
## Download the binary from releases page
82+
```bash
83+
make install [INSTALL_DIR=<path_to_install_folder>] [BUILD_DIR=<path_to_build_folder>]
84+
```
2685

27-
{% note warning %}
86+
Sample command to install into `install_folder` from the current folder:
2887

29-
This option has yet to be made available.
88+
```bash
89+
make install INSTALL_DIR=install_folder BUILD_DIR=.
90+
```
3091

31-
{% endnote %}

ydb/docs/ru/core/reference/ydbops/install.md

Lines changed: 70 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,30 +2,87 @@
22

33
{% include [warning.md](_includes/warning.md) %}
44

5-
В настоящее время доступна только сборка из исходного кода. Скомпилированные исполняемые файлы станут доступны позже.
5+
## Загрузка бинарного файла со страницы релизов
66

7-
## Сборка из исходного кода
7+
Скомпилированные исполняемые файлы можно скачать с [YDBOps Releases](../../downloads/index.md#ydbops).
88

9-
1. [Установите Go](https://go.dev/doc/install). Минимально требуемая версия Go — 1.21.
9+
## Сборка из исходного кода
1010

11-
2. Склонируйте репозиторий `ydbops` с GitHub:
11+
1. Склонируйте репозиторий `ydbops` с GitHub:
1212

1313
```bash
1414
git clone https://github.com/ydb-platform/ydbops.git
1515
```
1616

17-
3. Вызовите `go build` в корневой папке репозитория:
17+
2. Сборка исполняемого файла может быть выполнена одним из двух вариантов:
18+
1. [Сборка с использованием компилятора Go](#go)
19+
2. [Сборка внутри docker-контейнера](#docker)
1820

19-
```bash
20-
go build
21-
```
21+
Для сборки с помощью [Docker](https://en.wikipedia.org/wiki/Docker_(software)) используется официальный docker image для [Golang](https://en.wikipedia.org/wiki/Go_(programming_language)) [v1.22](https://hub.docker.com/_/golang/tags?name=1.22), это гарантирует то, что сборка будет проведена успешно. Описание работы docker-контейнера в `Dockerfile` репозитория. Так же сборка в Docker проводит дополнительные манипуляции: выполняет проверки линтером, подставляет версию для сборки ydbops, чтобы она прописалась в исполняемом файле ydbops.
2222

23-
Исполняемый файл `ydbops` будет доступен в корневой папке репозитория.
23+
### Сборка с использованием компилятора Go {#go}
2424

25-
## Загрузка бинарного файла со страницы релизов
25+
#### Требования
26+
27+
[Установите Go](https://go.dev/doc/install). Рекомендуемая версия Go — 1.22.
28+
29+
#### Компиляция
30+
31+
Вызовите `go build` в корневой папке репозитория:
32+
33+
```bash
34+
go build
35+
```
36+
37+
Исполняемый файл `ydbops` будет доступен в корневой папке репозитория.
38+
39+
#### Установка
40+
41+
Вручную переместите исполняемый файл в требуемый каталог или используйте утилиту `make` для установки в каталог `install_folder` из текущего каталога:
42+
43+
```bash
44+
make install INSTALL_DIR=install_folder BUILD_DIR=.
45+
```
46+
47+
### Сборка внутри docker-контейнера {#docker}
48+
49+
#### Требования
50+
51+
- make;
52+
- [docker engine](https://docs.docker.com/engine/install/).
53+
54+
#### Компиляция
55+
56+
Выполните в папке репозитория команду:
57+
58+
```bash
59+
make build-in-docker
60+
```
61+
62+
Исполняемый файл `ydbops` будет доступен в корневой папке `bin`. Автоматически собираются исполняемые файлы для Linux и MacOS (arm64, amd64).
63+
64+
| Исполняемый файл | Платформа
65+
|-|-|
66+
| ydbops | Linux(amd64) |
67+
| ydbops_darwin_amd64 | MacOS(amd64) |
68+
| ydbops_darwin_arm64 | MacOS(arm64) |
69+
70+
#### Установка
71+
72+
Для установки исполняемого файла выполните команду `make`.
73+
74+
Дополнительные параметры:
75+
76+
- `INSTALL_DIR`: каталог, в который будет установлен исполняемый файл. По умолчанию: `~/ydb/bin`.
77+
78+
- `BUILD_DIR`: каталог, содержащий скомпилированный исполняемый файл. Этот параметр используется, если файл собран самостоятельно. Например, если файл находится в текущем каталоге, используйте `BUILD_DIR=.`.
2679

27-
{% note warning %}
80+
```bash
81+
make install [INSTALL_DIR=<путь_к_каталогу>] [BUILD_DIR=<путь_к_каталогу>]
82+
```
2883

29-
Этот вариант ещё не доступен.
84+
Пример команды для установки в каталог `install_folder` из текущего каталога:
3085

31-
{% endnote %}
86+
```bash
87+
make install INSTALL_DIR=install_folder BUILD_DIR=.
88+
```

0 commit comments

Comments
 (0)