From 80fea38f185cec175338a66b434d9cce51dc2687 Mon Sep 17 00:00:00 2001 From: Edgar Sipki Date: Fri, 20 Nov 2026 03:45:44 +0300 Subject: [PATCH 1/2] docs(api-service): align with the StatefulSet chart and v1.3.x Scaling is horizontal with a cache per pod and S3 for more than one replica. Security links SECURITY.md and private reporting. Upgrading gains v1.3.0 to v1.3.1 and the chart's Deployment-to-StatefulSet migration. The removed dev stand and host alert files are no longer referenced. Quickstart pins v1.3.2, notes UID 65532 and is retitled. MCP paging, SDK Platform(), plugin.yaml smoke, mTLS default and Russian wording fixes. Co-Authored-By: Claude Opus 5.5 --- content/docs/api-service/architecture.mdx | 40 ++++--- content/docs/api-service/architecture.ru.mdx | 37 ++++-- content/docs/api-service/backup.ru.mdx | 4 +- content/docs/api-service/client-usage.mdx | 11 +- content/docs/api-service/client-usage.ru.mdx | 15 ++- content/docs/api-service/installation.mdx | 16 +-- content/docs/api-service/installation.ru.mdx | 16 +-- content/docs/api-service/mcp.mdx | 5 + content/docs/api-service/mcp.ru.mdx | 6 + content/docs/api-service/observability.mdx | 11 +- content/docs/api-service/observability.ru.mdx | 12 +- content/docs/api-service/operator-cli.mdx | 14 +-- content/docs/api-service/operator-cli.ru.mdx | 15 +-- content/docs/api-service/overview.mdx | 6 +- content/docs/api-service/overview.ru.mdx | 8 +- content/docs/api-service/plugins.mdx | 13 +++ content/docs/api-service/plugins.ru.mdx | 13 +++ content/docs/api-service/quickstart.mdx | 37 +++--- content/docs/api-service/quickstart.ru.mdx | 45 ++++---- content/docs/api-service/runbooks.mdx | 32 ++--- content/docs/api-service/runbooks.ru.mdx | 40 ++++--- content/docs/api-service/security.mdx | 9 +- content/docs/api-service/security.ru.mdx | 11 +- content/docs/api-service/upgrading.mdx | 107 +++++++++++++++++ content/docs/api-service/upgrading.ru.mdx | 109 ++++++++++++++++++ content/docs/api-service/vs-buf-bsr.mdx | 4 +- content/docs/api-service/vs-buf-bsr.ru.mdx | 4 +- scripts/sync-plugin-catalog.mjs | 2 +- 28 files changed, 475 insertions(+), 167 deletions(-) diff --git a/content/docs/api-service/architecture.mdx b/content/docs/api-service/architecture.mdx index c75ecf1..242fbad 100644 --- a/content/docs/api-service/architecture.mdx +++ b/content/docs/api-service/architecture.mdx @@ -188,16 +188,30 @@ reports 503 while the database does not answer; `/live` checks nothing and stays `audit.partition_check_interval`; partitions older than `audit.retention_months` are dropped. -## Single replica - -The plugin cache on disk is not safe to share between processes: unpacking ends -with a remove and a rename serialised only by an in-process lock, and each -process accounts `cache_max_bytes` separately. The Helm chart runs one replica -with a `ReadWriteOnce` volume and the `Recreate` strategy. It *permits* -`replicaCount > 1` with a `ReadWriteMany` volume; that combination is not -supported and corrupts the cache under concurrent misses. The database side is -safe for several processes (migrations and partition maintenance take locks), -which is what makes a restart into a new version safe. Scale vertically: -more CPU and a higher `max_concurrent_generations`, keeping -`max_concurrent_generations × max_output_size` inside the memory limit (the -chart refuses an install where it is not). +## Scaling out + +The service scales horizontally, with a plugin cache per pod. The cache on disk +is not safe to share between processes: unpacking ends with a remove and a +rename serialised only by an in-process lock, and each process accounts +`cache_max_bytes` separately, so two pods on one `ReadWriteMany` volume corrupt +it under concurrent misses. + +Since v1.2.0 the Helm chart runs a StatefulSet that gives every replica a +`ReadWriteOnce` claim of its own, `plugins--easyp-service-N` (or an +`emptyDir` with `persistence.enabled=false`), and refuses a shared access mode. +Upgrades roll one pod at a time. `autoscaling.enabled` adds a +HorizontalPodAutoscaler on CPU. + +Every replica's cache starts empty and is filled from object storage, so more +than one replica — `replicaCount` above 1, or an autoscaler whose +`maxReplicas` is — needs `config.registry.s3.bucket`, and the chart refuses the +install without it. Without S3 the plugins directory is the only copy of every +plugin, and only one replica can hold it. + +The database side is safe for several processes: migrations and partition +maintenance take locks, which is also what makes a restart into a new version +safe. Everything else a replica enforces is its own — the worker pool, +`max_concurrent_generations` and the per-client rate limit — so capacity grows +with the replica count, and a client spread across N pods gets up to N times its +limit. Within one pod, keep `max_concurrent_generations × max_output_size` +inside the memory limit (the chart refuses an install where it is not). diff --git a/content/docs/api-service/architecture.ru.mdx b/content/docs/api-service/architecture.ru.mdx index e493bfd..b3bc9ba 100644 --- a/content/docs/api-service/architecture.ru.mdx +++ b/content/docs/api-service/architecture.ru.mdx @@ -189,13 +189,30 @@ health-порту отвечает 503, пока БД не отвечает; `/l `audit.partition_check_interval`; партиции старше `audit.retention_months` удаляются. -## Одна реплика [#single-replica] - -Кеш плагинов на диске нельзя делить между процессами: распаковка заканчивается -удалением и переименованием, которые сериализует только блокировка внутри -процесса, а `cache_max_bytes` каждый процесс считает сам. Helm-чарт запускает -одну реплику с томом `ReadWriteOnce` и стратегией `Recreate`. Он *разрешает* -`replicaCount > 1` с томом `ReadWriteMany`; такая комбинация не поддерживается и -портит кеш при одновременных промахах. Сторона БД безопасна для нескольких -процессов (миграции и обслуживание партиций берут блокировки) — именно поэтому -перезапуск на новую версию безопасен. +## Горизонтальное масштабирование [#scaling-out] + +Сервис масштабируется горизонтально, и у каждого пода свой кеш плагинов. Общим +кеш на диске быть не может: распаковка заканчивается удалением и +переименованием, которые сериализует только блокировка внутри процесса, а +`cache_max_bytes` каждый процесс считает сам. Два пода на одном томе +`ReadWriteMany` портят кеш при одновременных промахах. + +С v1.2.0 Helm-чарт запускает StatefulSet: каждая реплика получает собственный +том `ReadWriteOnce`, `plugins--easyp-service-N` (или `emptyDir` при +`persistence.enabled=false`), а общий режим доступа чарт отвергает. Обновление +идёт по одному поду. `autoscaling.enabled` добавляет HorizontalPodAutoscaler по +CPU. + +Кеш новой реплики пуст и наполняется из объектного хранилища, поэтому для +нескольких реплик — `replicaCount` больше 1 или автоскейлер с таким +`maxReplicas` — нужен `config.registry.s3.bucket`; без него чарт откажется +устанавливаться. Без S3 каталог плагинов — единственная копия всех плагинов, и +держать её может только одна реплика. + +База данных несколько процессов выдерживает: миграции и обслуживание партиций +берут блокировки, поэтому и перезапуск на новую версию безопасен. Всё остальное +у каждой реплики своё — пул воркеров, `max_concurrent_generations` и лимит +запросов на клиента, — так что пропускная способность растёт с числом реплик, а +клиент, чьи запросы расходятся по N подам, получает до N своих лимитов. В +пределах одного пода держите `max_concurrent_generations × max_output_size` в +рамках лимита памяти (иначе чарт откажется устанавливаться). diff --git a/content/docs/api-service/backup.ru.mdx b/content/docs/api-service/backup.ru.mdx index a11c68e..495eb77 100644 --- a/content/docs/api-service/backup.ru.mdx +++ b/content/docs/api-service/backup.ru.mdx @@ -14,7 +14,7 @@ description: "Что обязано попасть в бэкап API Service, с | **Таблица `plugins`** | Сам реестр: какие версии плагинов существуют, их конфигурация, командная строка, записанные контрольные суммы. Больше это не хранится нигде. | | **Партиции `audit_log`** | Журнал аудита. Он продаётся в Enterprise, существует в единственном экземпляре, второй копии нет. | | **Таблица `goose_db_version`** | Какие миграции применены. Восстановление данных без неё приводит к тому, что следующий старт либо прогонит миграции заново, либо откажется стартовать. | -| **Бакет объектного хранилища** | Архивы плагинов. Локальный кэш — это кэш, из него вытесняют, так что бакет остаётся единственной копией бинарей. | +| **Бакет объектного хранилища** | Архивы плагинов. Локальный кеш — это кеш, из него вытесняют, так что бакет остаётся единственной копией бинарей. | | **`DB_POSTGRES_DSN`, `AUTH_WRITE_TOKENS`, ключи S3** | Секретов нет в базе, и обычно их нет и в бэкапе кластера. | | **`LICENSE_KEY` и `LICENSE_PUBLIC_KEYS`** | Восстановимы из реестра лицензий — но не вами и не в три часа ночи. Без них восстановленный сервис работает в community: без аудита, четыре воркера, десять плагинов. | @@ -75,7 +75,7 @@ RPO в несколько часов нормален для `plugins`: реги собой **вперёд**. **Считайте откат ограниченным `config.audit.preCreateMonths`** (по умолчанию три) и предпочитайте восстановление на соответствующий релиз. -4. **Ожидайте пустой кэш плагинов.** Это кэш, и при `persistence.enabled=false` +4. **Ожидайте пустой кеш плагинов.** Это кеш, и при `persistence.enabled=false` он пуст после каждого перезапуска в любом случае. Первый запрос к каждому плагину скачает его заново. Смотрите, как растёт `easyp_plugin_cache_bytes`; делать ничего не нужно. diff --git a/content/docs/api-service/client-usage.mdx b/content/docs/api-service/client-usage.mdx index 3996f14..d30bb24 100644 --- a/content/docs/api-service/client-usage.mdx +++ b/content/docs/api-service/client-usage.mdx @@ -128,8 +128,9 @@ ceiling) and `DEADLINE_EXCEEDED` are returned immediately: retrying the first adds load exactly when the server has none to spare, and retrying the second re-runs a generation that already used its full timeout. -Methods: `GenerateCode`, `ListPlugins` (walks every page), `CreatePlugin`, -`UpdatePlugin`, `DeletePlugin`, `Close`. +Methods: `GenerateCode`, `ListPlugins` (walks every page), `Platform` (the +`os/arch` the service runs plugins on, empty from a server older than v1.3.0), +`CreatePlugin`, `UpdatePlugin`, `DeletePlugin`, `Close`. `CreatePlugin` and `UpdatePlugin` take a `config` struct. On a v1.2.0 or newer service `command` may be omitted: the service derives @@ -171,8 +172,10 @@ grpcurl -protoset api.protoset -plaintext localhost:23410 \ ### Errors -Every non-OK status carries `google.rpc.ErrorInfo` with domain `easyp.tech` and a -stable `reason`. Branch on the reason, not the message. +Every error the handlers return carries `google.rpc.ErrorInfo` with domain +`easyp.tech` and a stable `reason`. Branch on the reason, not the message. +Refusals from the interceptors in front of the handlers carry none; they are +listed below the table. | Reason | gRPC code | Typical cause | |---|---|---| diff --git a/content/docs/api-service/client-usage.ru.mdx b/content/docs/api-service/client-usage.ru.mdx index 9077d80..b08939a 100644 --- a/content/docs/api-service/client-usage.ru.mdx +++ b/content/docs/api-service/client-usage.ru.mdx @@ -1,5 +1,5 @@ --- -title: "Использование клиентами" +title: "Подключение клиентов" description: "Как направить easyp CLI на сервис, как пользоваться Go SDK и как вызывать gRPC API напрямую." --- @@ -128,8 +128,9 @@ func main() { добавляет нагрузки ровно тогда, когда у сервера её некуда девать, а повтор второго заново запускает генерацию, уже потратившую весь таймаут. -Методы: `GenerateCode`, `ListPlugins` (обходит все страницы), `CreatePlugin`, -`UpdatePlugin`, `DeletePlugin`, `Close`. +Методы: `GenerateCode`, `ListPlugins` (обходит все страницы), `Platform` +(`os/arch`, на которой сервис запускает плагины; сервер старше v1.3.0 отдаёт +пустую строку), `CreatePlugin`, `UpdatePlugin`, `DeletePlugin`, `Close`. `CreatePlugin` и `UpdatePlugin` принимают структуру `config`. На сервисе v1.2.0 или новее `command` можно не указывать: сервис выводит @@ -171,8 +172,10 @@ grpcurl -protoset api.protoset -plaintext localhost:23410 \ ### Ошибки -Каждый не-OK статус несёт `google.rpc.ErrorInfo` с доменом `easyp.tech` и -стабильным `reason`. Ветвитесь по reason, а не по тексту. +Каждая ошибка, которую возвращают обработчики, несёт `google.rpc.ErrorInfo` с +доменом `easyp.tech` и стабильным `reason`. Проверяйте `reason`, а не текст +сообщения. У отказов от интерсепторов, стоящих перед обработчиками, `ErrorInfo` +нет — они перечислены под таблицей. | Reason | Код gRPC | Типичная причина | |---|---|---| @@ -189,7 +192,7 @@ grpcurl -protoset api.protoset -plaintext localhost:23410 \ | `SHUTTING_DOWN` | `UNAVAILABLE` | Сервис останавливается. | | `FEATURE_DENIED` | `PERMISSION_DENIED` | Функции нет в лицензии. | | `DEADLINE_EXCEEDED` | `DEADLINE_EXCEEDED` | Плагин не уложился в таймаут. | -| `CANCELED` | `CANCELLED` | Клиент ушёл. | +| `CANCELED` | `CANCELLED` | Клиент отменил запрос. | | `INTERNAL` | `INTERNAL` | Всё остальное. | Отказы rate limit и лимита одновременных запросов на клиента приходят от diff --git a/content/docs/api-service/installation.mdx b/content/docs/api-service/installation.mdx index fdf6269..432c1ff 100644 --- a/content/docs/api-service/installation.mdx +++ b/content/docs/api-service/installation.mdx @@ -1,6 +1,6 @@ --- title: "Installation" -description: "Container image tags, the Helm chart and its required values, the compose stack, and release binaries." +description: "Container image tags, the Helm chart and its required values, Docker Compose, and release binaries." --- Every release publishes a container image, a Helm chart and binaries. The @@ -90,7 +90,7 @@ Helm release history. | Value | Default | Why it matters | |---|---|---| -| `replicaCount` | `1` | Do not raise it on a shared volume. See [Architecture](/docs/api-service/architecture#single-replica). | +| `replicaCount` | `1` | Each replica gets its own volume; above 1 needs `config.registry.s3.bucket`. See [Architecture](/docs/api-service/architecture#scaling-out). | | `image.tag` | `""` (chart appVersion) | Pin it. | | `ports.grpc` / `metric` / `health` / `mcp` | `8080` / `8081` / `8082` / `8083` | The chart overrides the binary's 23410–23413. | | `mcp.enabled` | `false` | MCP sits outside the gRPC interceptor chain. | @@ -98,7 +98,7 @@ Helm release history. | `config.workerPool.*` | binary defaults | `workers: 4`, `queueSize: 16`, `maxConcurrentGenerations: 16`, `generationTimeoutSeconds: 120`. | | `config.registry.s3.bucket` | `""` | Empty means local mode. | | `config.license.publicKeys` | easyp.tech key `2026-08` | The licence trust anchor. Replace only if you issue your own licences. | -| `tls.enabled` / `tls.clientCASecret` | `true` / `""` | With a CA the listener requires client certificates (mTLS). `"-"` disables the client check. | +| `tls.enabled` / `tls.clientCASecret` | `true` / `""` | With TLS on, mTLS is on by default: an empty value checks client certificates against `ca.crt` in the server certificate's secret (`tls.serverSecret` or cert-manager's). `"-"` disables the client check. | | `certManager.enabled` | `false` | Let cert-manager issue server and ingress client certificates. | | `ingress.*` | disabled, Traefik | Defaults target Traefik because it can express an mTLS backend leg (`ServersTransport`). | | `persistence.size` | `25Gi` | Must exceed `cacheMaxBytes`. | @@ -119,11 +119,11 @@ same pod. See [Security](/docs/api-service/security). ## Docker Compose -`deploy/docker-compose.yml` in the service repository is the development stack: -PostgreSQL, RustFS as S3, Traefik with mutual TLS in front, and a Grafana/Loki/ -Tempo/Mimir/Pyroscope suite. It is driven by `task up` and is the reference for -how the pieces fit, not a production template. A minimal compose file is in the -[Quickstart](/docs/api-service/quickstart). +The service repository ships no compose stack. A minimal compose file — +PostgreSQL and the released image — is in the +[API Service quickstart](/docs/api-service/quickstart); running the binary from +a checkout is in the service README's +[From source](https://github.com/easyp-tech/service#from-source) section. ## Binaries diff --git a/content/docs/api-service/installation.ru.mdx b/content/docs/api-service/installation.ru.mdx index 3bd861d..1d41c3c 100644 --- a/content/docs/api-service/installation.ru.mdx +++ b/content/docs/api-service/installation.ru.mdx @@ -1,6 +1,6 @@ --- title: "Установка" -description: "Теги образа, Helm-чарт и его обязательные значения, compose-стек и бинарники релизов." +description: "Теги образа, Helm-чарт и его обязательные значения, Docker Compose и бинарники релизов." --- Каждый релиз публикует образ контейнера, Helm-чарт и бинарники. Текущий релиз — @@ -90,7 +90,7 @@ helm install easyp oci://ghcr.io/easyp-tech/charts/easyp-service \ | Значение | По умолчанию | Почему важно | |---|---|---| -| `replicaCount` | `1` | Не увеличивайте на общем томе. См. [Архитектура](/ru/docs/api-service/architecture#single-replica). | +| `replicaCount` | `1` | У каждой реплики свой том; больше одной — только с `config.registry.s3.bucket`. См. [Архитектура](/ru/docs/api-service/architecture#scaling-out). | | `image.tag` | `""` (appVersion чарта) | Зафиксируйте. | | `ports.grpc` / `metric` / `health` / `mcp` | `8080` / `8081` / `8082` / `8083` | Чарт переопределяет порты бинарника 23410–23413. | | `mcp.enabled` | `false` | MCP стоит вне цепочки gRPC-интерсепторов. | @@ -98,7 +98,7 @@ helm install easyp oci://ghcr.io/easyp-tech/charts/easyp-service \ | `config.workerPool.*` | значения бинарника | `workers: 4`, `queueSize: 16`, `maxConcurrentGenerations: 16`, `generationTimeoutSeconds: 120`. | | `config.registry.s3.bucket` | `""` | Пусто — локальный режим. | | `config.license.publicKeys` | ключ easyp.tech `2026-08` | Якорь доверия лицензий. Меняйте, только если выпускаете лицензии сами. | -| `tls.enabled` / `tls.clientCASecret` | `true` / `""` | С CA listener требует клиентские сертификаты (mTLS). `"-"` отключает проверку клиента. | +| `tls.enabled` / `tls.clientCASecret` | `true` / `""` | С включённым TLS mTLS тоже включён: при пустом значении клиентские сертификаты проверяются по `ca.crt` из секрета серверного сертификата (`tls.serverSecret` или выпущенного cert-manager). `"-"` отключает проверку клиента. | | `certManager.enabled` | `false` | Выпуск серверного и клиентского (для ingress) сертификатов через cert-manager. | | `ingress.*` | выключен, Traefik | По умолчанию под Traefik: он умеет декларативно описать mTLS до бэкенда (`ServersTransport`). | | `persistence.size` | `25Gi` | Должен быть больше `cacheMaxBytes`. | @@ -119,11 +119,11 @@ helm install easyp oci://ghcr.io/easyp-tech/charts/easyp-service \ ## Docker Compose -`deploy/docker-compose.yml` в репозитории сервиса — стенд для разработки: -PostgreSQL, RustFS как S3, Traefik со взаимным TLS спереди и набор Grafana/Loki/ -Tempo/Mimir/Pyroscope. Им управляет `task up`; это образец того, как всё -соединяется, а не шаблон для продакшена. Минимальный compose-файл — в -[Быстром старте](/ru/docs/api-service/quickstart). +Готового compose-стека в репозитории сервиса нет. Минимальный compose-файл — +PostgreSQL и опубликованный образ — есть в +[быстром старте API Service](/ru/docs/api-service/quickstart), а запуск бинарника +из исходников описан в разделе +[From source](https://github.com/easyp-tech/service#from-source) README сервиса. ## Бинарники diff --git a/content/docs/api-service/mcp.mdx b/content/docs/api-service/mcp.mdx index ec1e771..be2b75d 100644 --- a/content/docs/api-service/mcp.mdx +++ b/content/docs/api-service/mcp.mdx @@ -25,6 +25,11 @@ Every field is lowerCamelCase, in the arguments (`pageSize`, `pageToken`) as in the result. The same JSON arrives as `structuredContent` and as the text content. `version` filters on an exact version; `latest` is not resolved here. +Paging works as in gRPC: `pageSize` defaults to 100 and is capped at 1000 — +values outside that range are normalised rather than rejected. To read past the +first page, call again with the same filters and `pageToken` set to the previous +`nextPageToken`, until `nextPageToken` comes back empty. + The `initialize` response names the server `easyp-service-mcp` and reports the service's own version in `serverInfo.version` — `1.3.2` on a release build — so a client can tell which release it is talking to. diff --git a/content/docs/api-service/mcp.ru.mdx b/content/docs/api-service/mcp.ru.mdx index 1ca1302..c5c8c11 100644 --- a/content/docs/api-service/mcp.ru.mdx +++ b/content/docs/api-service/mcp.ru.mdx @@ -25,6 +25,12 @@ description: "Необязательный эндпоинт Model Context Protoc результате. Один и тот же JSON приходит в `structuredContent` и в текстовом содержимом. Фильтр `version` ищет точную версию, `latest` здесь не разрешается. +Страницы устроены так же, как в gRPC: `pageSize` по умолчанию 100, максимум +1000, а значения вне этого диапазона приводятся к нему, а не отвергаются. Чтобы +читать дальше первой страницы, повторяйте вызов с теми же фильтрами и +`pageToken`, равным предыдущему `nextPageToken`, пока `nextPageToken` не придёт +пустым. + Ответ на `initialize` называет сервер `easyp-service-mcp` и сообщает версию самого сервиса в `serverInfo.version` — `1.3.2` у релизной сборки, — так что клиент видит, с каким релизом говорит. diff --git a/content/docs/api-service/observability.mdx b/content/docs/api-service/observability.mdx index 2da01ba..b905aea 100644 --- a/content/docs/api-service/observability.mdx +++ b/content/docs/api-service/observability.mdx @@ -138,10 +138,11 @@ Prometheus Operator CRDs). Every alert carries a `runbook_url` pointing at | EasypPanics | `increase(easyp_panics_total[5m]) > 0` | [link](/docs/api-service/runbooks#easyppanics) | | EasypAuthFailures | `rate(easyp_auth_failures_total[5m]) > authFailureRate` (0.5) for 10m | [link](/docs/api-service/runbooks#easypauthfailures) | -The compose stack adds host and edge alerts, evaluated by its own Mimir from what -Grafana Alloy collects — EasypHostDiskLow, EasypHostDiskFillingUp, EasypHostMemoryLow, -EasypTargetDown, EasypServiceMissing, EasypCertificateExpiringSoon — in -`deploy/observability/mimir/rules/anonymous/host.yaml`. They are also in -[Runbooks](/docs/api-service/runbooks#the-host). +Host and edge alerts are not shipped: the machine, the proxy in front and their +monitoring are the operator's own. [Runbooks](/docs/api-service/runbooks#the-host) +keeps procedures for the six the maintainers run on a compose host — +EasypHostDiskLow, EasypHostDiskFillingUp, EasypHostMemoryLow, EasypTargetDown, +EasypServiceMissing, EasypCertificateExpiringSoon — for anyone who defines +alerts under the same names. `ServiceMonitor` (`serviceMonitor.enabled=true`) scrapes `/metrics` every 30 s. diff --git a/content/docs/api-service/observability.ru.mdx b/content/docs/api-service/observability.ru.mdx index f7214ae..61367e7 100644 --- a/content/docs/api-service/observability.ru.mdx +++ b/content/docs/api-service/observability.ru.mdx @@ -140,12 +140,12 @@ Prometheus Operator). У каждого алерта есть `runbook_url`: э | EasypPanics | `increase(easyp_panics_total[5m]) > 0` | [ссылка](/ru/docs/api-service/runbooks#easyppanics) | | EasypAuthFailures | `rate(easyp_auth_failures_total[5m]) > authFailureRate` (0.5) 10 мин | [ссылка](/ru/docs/api-service/runbooks#easypauthfailures) | -Compose-стек добавляет алерты хоста и edge, которые считает его собственный Mimir -по тому, что собирает Grafana Alloy, — EasypHostDiskLow, EasypHostDiskFillingUp, -EasypHostMemoryLow, EasypTargetDown, EasypServiceMissing, -EasypCertificateExpiringSoon — в -`deploy/observability/mimir/rules/anonymous/host.yaml`. Они тоже есть в -[Ранбуках](/ru/docs/api-service/runbooks#the-host). +Алерты хоста и edge в поставку не входят: машина, прокси перед сервисом и их +мониторинг — забота оператора. В [Ранбуках](/ru/docs/api-service/runbooks#the-host) +остались процедуры для шести алертов, которые мейнтейнеры держат на своём +compose-хосте, — EasypHostDiskLow, EasypHostDiskFillingUp, EasypHostMemoryLow, +EasypTargetDown, EasypServiceMissing, EasypCertificateExpiringSoon, — на случай, +если вы заведёте алерты с теми же именами. `ServiceMonitor` (`serviceMonitor.enabled=true`) опрашивает `/metrics` каждые 30 с. diff --git a/content/docs/api-service/operator-cli.mdx b/content/docs/api-service/operator-cli.mdx index 38b88ef..dd24c38 100644 --- a/content/docs/api-service/operator-cli.mdx +++ b/content/docs/api-service/operator-cli.mdx @@ -193,10 +193,10 @@ then the environment, then the default 23412. ## Taskfile shortcuts -The service repository's `Taskfile.yml` wraps these for development: -`task build-plugins`, `FILTER=… task build-plugins-filter`, `task publish-plugins` -(build, upload and register into the development stack; `FILTER=…` for a slice), -`task publish-archives` (a `build --archive` tree to any service and storage), -`task up`, `task up-minimal`, `task run`, `task run-local`. Except -`publish-archives`, they assume the development stack's addresses and -credentials. +The service repository's `Taskfile.yml` has three tasks: `task build-plugins` +(`plugins build` over the whole registry into `plugins/`), +`FILTER=… task build-plugins-filter` (one slice, e.g. +`FILTER='grpc/go:v1.6.2'`) and `task generate` (regenerates `api/`). Publishing +is `easyp-svc plugins publish` itself; the repository has no development stack +to publish into. Running the service from a checkout is in the README's +[From source](https://github.com/easyp-tech/service#from-source) section. diff --git a/content/docs/api-service/operator-cli.ru.mdx b/content/docs/api-service/operator-cli.ru.mdx index da2913a..93d852f 100644 --- a/content/docs/api-service/operator-cli.ru.mdx +++ b/content/docs/api-service/operator-cli.ru.mdx @@ -196,10 +196,11 @@ PostgreSQL, а перезапуск контейнера при каждом с ## Сокращения в Taskfile -`Taskfile.yml` репозитория сервиса оборачивает эти команды для разработки: -`task build-plugins`, `FILTER=… task build-plugins-filter`, `task publish-plugins` -(собрать, загрузить и зарегистрировать на стенде разработки; `FILTER=…` — для -части каталога), `task publish-archives` (дерево `build --archive` в любой сервис -и хранилище), `task up`, `task up-minimal`, `task run`, `task run-local`. Все, -кроме `publish-archives`, рассчитаны на адреса и учётные данные стенда -разработки. +В `Taskfile.yml` репозитория сервиса три задачи: `task build-plugins` +(`plugins build` по всему реестру в `plugins/`), +`FILTER=… task build-plugins-filter` (часть каталога, например +`FILTER='grpc/go:v1.6.2'`) и `task generate` (перегенерирует `api/`). +Публикация — это сама команда `easyp-svc plugins publish`: стенда для +разработки, куда публиковать, в репозитории нет. Как запустить сервис из +исходников, описано в разделе +[From source](https://github.com/easyp-tech/service#from-source) README. diff --git a/content/docs/api-service/overview.mdx b/content/docs/api-service/overview.mdx index ca2ceb5..39f7665 100644 --- a/content/docs/api-service/overview.mdx +++ b/content/docs/api-service/overview.mdx @@ -64,6 +64,10 @@ sequenceDiagram The full request path is in [Architecture](/docs/api-service/architecture). +The service scales horizontally. Each pod keeps its own plugin cache and fills it +from object storage, so more than one replica needs S3 — see +[Scaling out](/docs/api-service/architecture#scaling-out). + ## What it is not - **Not a sandbox.** Plugins run as ordinary processes on the service host. @@ -76,8 +80,6 @@ The full request path is in [Architecture](/docs/api-service/architecture). [Package manager](/docs/cli/package-manager). - **Not a package publisher.** It returns generated files to the caller; it does not publish Go modules, npm or Maven packages. -- **Not horizontally scalable.** One replica per plugin cache volume. Scale by - giving the pod more CPU and raising the generation limit. - **Not a hosted service you can sign up for.** The documentation describes the software you deploy. diff --git a/content/docs/api-service/overview.ru.mdx b/content/docs/api-service/overview.ru.mdx index 559e44c..003e6b9 100644 --- a/content/docs/api-service/overview.ru.mdx +++ b/content/docs/api-service/overview.ru.mdx @@ -63,6 +63,10 @@ sequenceDiagram Полный путь запроса — в [Архитектуре](/ru/docs/api-service/architecture). +Сервис масштабируется горизонтально. У каждого пода свой кеш плагинов, который +наполняется из объектного хранилища, поэтому для нескольких реплик нужен S3 — +см. [Горизонтальное масштабирование](/ru/docs/api-service/architecture#scaling-out). + ## Чем он не является - **Это не песочница.** Плагины выполняются обычными процессами на хосте @@ -76,8 +80,6 @@ sequenceDiagram [Менеджер пакетов](/ru/docs/cli/package-manager). - **Это не публикатор пакетов.** Он возвращает сгенерированные файлы вызывающему и не публикует Go-модули, npm- или Maven-пакеты. -- **Он не масштабируется горизонтально.** Одна реплика на том кеша плагинов. - Масштабируйте, давая поду больше CPU и поднимая лимит генераций. - **Это не облачный сервис, на который можно зарегистрироваться.** Документация описывает ПО, которое разворачиваете вы. @@ -121,7 +123,7 @@ sequenceDiagram | Запустить локально и сгенерировать код | [Быстрый старт](/ru/docs/api-service/quickstart) | | Развернуть | [Установка](/ru/docs/api-service/installation), [Конфигурация](/ru/docs/api-service/configuration) | | Добавить плагины | [Плагины](/ru/docs/api-service/plugins), [CLI оператора](/ru/docs/api-service/operator-cli) | -| Подключить клиентов | [Использование клиентами](/ru/docs/api-service/client-usage) | +| Подключить клиентов | [Подключение клиентов](/ru/docs/api-service/client-usage) | | Эксплуатировать | [Наблюдаемость](/ru/docs/api-service/observability), [Ранбуки](/ru/docs/api-service/runbooks), [Резервное копирование](/ru/docs/api-service/backup), [Обновление](/ru/docs/api-service/upgrading) | | Сравнить с Buf | [EasyP и Buf BSR](/ru/docs/api-service/vs-buf-bsr), [Миграция с BSR](/ru/docs/api-service/migrating-from-bsr) | diff --git a/content/docs/api-service/plugins.mdx b/content/docs/api-service/plugins.mdx index 63e4a6e..a0c0eb1 100644 --- a/content/docs/api-service/plugins.mdx +++ b/content/docs/api-service/plugins.mdx @@ -67,6 +67,19 @@ Optional keys in `plugin.yaml`: `build_args` (passed to every build), version entry may be a mapping that overrides these for itself or sets `skip: true`. +`smoke` tunes the smoke run that `plugins build` and `plugins publish` make on +every built version, for all versions of the plugin at once. +`smoke: {parameter: "…"}` passes that string as the `CodeGeneratorRequest` +parameter, for a plugin that will not answer without options; +`smoke: {skip: true}` turns the run off for a plugin that cannot be exercised +with a synthetic request. Leave a comment saying why: skipping removes the only +check that the archive actually runs. + +```yaml +smoke: + parameter: "extern_path=.=crate::proto" +``` + ### What the Dockerfile must produce - **An executable at `/plugin`.** It reads a `CodeGeneratorRequest` on stdin, diff --git a/content/docs/api-service/plugins.ru.mdx b/content/docs/api-service/plugins.ru.mdx index 026d0b2..4b9652e 100644 --- a/content/docs/api-service/plugins.ru.mdx +++ b/content/docs/api-service/plugins.ru.mdx @@ -66,6 +66,19 @@ versions: `dockerfile` (другой файл), `args` (аргументы entrypoint). Элемент версии может быть отображением, которое переопределяет их для себя или задаёт `skip: true`. +`smoke` настраивает пробный запуск, который `plugins build` и `plugins publish` +делают для каждой собранной версии, — сразу для всех версий плагина. +`smoke: {parameter: "…"}` передаёт строку как параметр `CodeGeneratorRequest`, +если плагин без опций не отвечает; `smoke: {skip: true}` отключает запуск для +плагина, который синтетическим запросом не проверить. Оставьте комментарий с +причиной: без пробного запуска не остаётся ни одной проверки, что архив +действительно работает. + +```yaml +smoke: + parameter: "extern_path=.=crate::proto" +``` + ### Что должен собрать Dockerfile - **Исполняемый файл `/plugin`.** Читает `CodeGeneratorRequest` из stdin, пишет diff --git a/content/docs/api-service/quickstart.mdx b/content/docs/api-service/quickstart.mdx index 67e7ebd..3183ed0 100644 --- a/content/docs/api-service/quickstart.mdx +++ b/content/docs/api-service/quickstart.mdx @@ -1,5 +1,5 @@ --- -title: "Quickstart" +title: "API Service quickstart" description: "From nothing to a first remote code generation: PostgreSQL, the service image, one plugin, easyp generate." --- @@ -63,7 +63,7 @@ services: retries: 30 service: - image: ghcr.io/easyp-tech/service:v1.3.0 + image: ghcr.io/easyp-tech/service:v1.3.2 command: ["service", "start"] depends_on: postgres: @@ -93,6 +93,12 @@ default, and warns that gRPC is running without TLS. Mount `plugins/` read-write. The service creates `plugins/.tmp` on start even without object storage, and a read-only mount stops it with `mkdir /plugins/.tmp: read-only file system`. + +The image runs as UID and GID 65532, not as root. On Linux the bind-mounted +directory keeps its host owner, so it must be writable by that user: +`sudo chown -R 65532:65532 plugins`, or set `user:` on the service to your own +UID and GID (`id -u`, `id -g`), for example `user: "1000:1000"`. Docker Desktop +on macOS maps ownership itself. ## 4. Register the plugin @@ -135,25 +141,18 @@ generate: easyp generate ``` -The CLI talks plaintext to `localhost` and TLS to any other host. Always pin the -version in `remote:` — see [Client usage](/docs/api-service/client-usage) for -why `latest` is not "newest" in the semantic-version sense. - -## The full development stack - -`service/deploy/docker-compose.yml` is the stack the maintainers develop -against: PostgreSQL, an S3-compatible store (RustFS), Traefik in front with -mutual TLS, and Grafana, Loki, Tempo, Mimir and Pyroscope. The service -repository's `Taskfile.yml` drives it: +The CLI talks plaintext to `localhost` and TLS to any other host. `latest` is +the highest registered version, but pin the version in `remote:` anyway: +`latest` moves when a newer version is registered, and generated code changes +with it. See [Client usage](/docs/api-service/client-usage). -```bash -task up # generates dev certificates, starts the stack -FILTER='protocolbuffers/go:v1.36.10' task publish-plugins # builds, uploads and registers through Traefik -``` +## Running from source -There the gRPC port is reached through Traefik at `easyp.api.localhost:4443`, -and Grafana is on `localhost:3000`. See the service -[README](https://github.com/easyp-tech/service#quick-start) for details. +The service repository carries no development stack of its own. To run the +binary from a checkout against your own PostgreSQL instead of the image, see +[From source](https://github.com/easyp-tech/service#from-source) in its README. +On macOS keep the image: plugins built by `plugins build` are Linux binaries, +and a service running natively fails them with `exec format error`. ## Next diff --git a/content/docs/api-service/quickstart.ru.mdx b/content/docs/api-service/quickstart.ru.mdx index 974d479..5992646 100644 --- a/content/docs/api-service/quickstart.ru.mdx +++ b/content/docs/api-service/quickstart.ru.mdx @@ -1,11 +1,11 @@ --- -title: "Быстрый старт" +title: "Быстрый старт API Service" description: "С нуля до первой удалённой генерации: PostgreSQL, образ сервиса, один плагин, easyp generate." --- Здесь сервис запускается с минимальным окружением: один контейнер PostgreSQL, -релизный образ, без объектного хранилища и без TLS. Это чтобы увидеть, из чего -всё состоит, а не чтобы выставлять в сеть. +релизный образ, без объектного хранилища и без TLS. Конфигурация для +знакомства, не для продакшена. ## Что понадобится @@ -63,7 +63,7 @@ services: retries: 30 service: - image: ghcr.io/easyp-tech/service:v1.3.0 + image: ghcr.io/easyp-tech/service:v1.3.2 command: ["service", "start"] depends_on: postgres: @@ -93,6 +93,12 @@ curl -i http://localhost:23412/ # 200, как только отвечае Монтируйте `plugins/` на запись. Сервис при старте создаёт `plugins/.tmp` даже без объектного хранилища, и с томом только для чтения падает с `mkdir /plugins/.tmp: read-only file system`. + +Образ работает не от root, а с UID и GID 65532. На Linux примонтированный +каталог сохраняет владельца с хоста, поэтому у этого пользователя должно быть +право записи: `sudo chown -R 65532:65532 plugins` или `user:` у сервиса с вашими +UID и GID (`id -u`, `id -g`), например `user: "1000:1000"`. Docker Desktop на +macOS подстраивает права сам. ## 4. Зарегистрировать плагин @@ -135,25 +141,18 @@ easyp generate ``` С `localhost` CLI работает без шифрования, с любым другим хостом — по TLS. -Всегда фиксируйте версию в `remote:` — почему `latest` не значит «самая новая» в -смысле семантических версий, объяснено в -[Использовании клиентами](/ru/docs/api-service/client-usage). - -## Полный стенд для разработки - -`service/deploy/docker-compose.yml` — стенд, на котором работают мейнтейнеры: -PostgreSQL, S3-совместимое хранилище (RustFS), Traefik с взаимным TLS спереди и -Grafana, Loki, Tempo, Mimir и Pyroscope. Им управляет `Taskfile.yml` -репозитория сервиса: - -```bash -task up # генерирует dev-сертификаты, поднимает стенд -FILTER='protocolbuffers/go:v1.36.10' task publish-plugins # собирает, загружает и регистрирует через Traefik -``` - -Там gRPC доступен через Traefik на `easyp.api.localhost:4443`, а Grafana — на -`localhost:3000`. Подробности — в -[README сервиса](https://github.com/easyp-tech/service#quick-start). +`latest` — самая новая зарегистрированная версия, но версию в `remote:` всё +равно фиксируйте: `latest` сдвигается, как только регистрируют более новую, и +сгенерированный код меняется вместе с ней. Подробнее — в +[Подключении клиентов](/ru/docs/api-service/client-usage). + +## Запуск из исходников + +Своего стенда для разработки в репозитории сервиса нет. Как запустить бинарник +из рабочей копии против своего PostgreSQL вместо образа, описано в разделе +[From source](https://github.com/easyp-tech/service#from-source) README +сервиса. На macOS оставайтесь на образе: `plugins build` собирает плагины под +Linux, и сервис, запущенный нативно, падает на них с `exec format error`. ## Дальше diff --git a/content/docs/api-service/runbooks.mdx b/content/docs/api-service/runbooks.mdx index 45aa5c8..5d57b1d 100644 --- a/content/docs/api-service/runbooks.mdx +++ b/content/docs/api-service/runbooks.mdx @@ -3,10 +3,11 @@ title: "Runbooks" description: "One procedure per alert the API Service ships: what the alert means, what is actually broken, and what to do about it." --- -One section per alert in `deploy/charts/easyp-service/templates/prometheusrule.yaml` -and in `deploy/observability/mimir/rules/anonymous/`. Each alert's `runbook_url` -annotation points at the matching anchor here, so the heading text is -load-bearing: renaming one breaks the link from the alert. +One section per alert in `deploy/charts/easyp-service/templates/prometheusrule.yaml`, +plus the host alerts at the end, which are not shipped (see +[The host](#the-host)). Each alert's `runbook_url` annotation points at the +matching anchor here, so the heading text is load-bearing: renaming one breaks +the link from the alert. Most of what follows is environment-independent: configuration keys, PromQL, and what a number means. Where a procedure needs to read logs it is written twice, @@ -84,9 +85,11 @@ intended. Note that CI runners behind one NAT share an address. Work has been queued continuously for ten minutes. Same knobs as above; the difference is that this is sustained rather than bursty, so it is a capacity statement, not a spike. Add capacity rather than a deeper queue — a longer queue -only moves the latency around. Capacity here means a bigger pod: more CPU and a -higher `maxConcurrentGenerations` (with the memory to match). More replicas on a -shared cache volume are not supported. +only moves the latency around. Capacity here means more replicas — each runs +its own worker pool, and with S3 configured `replicaCount` or +`autoscaling.maxReplicas` can go above 1 — or a bigger pod: more CPU and a +higher `maxConcurrentGenerations` (with the memory to match). See +[Scaling out](/docs/api-service/architecture#scaling-out). ## EasypPluginCacheAtLimit @@ -254,11 +257,12 @@ digest). ## The host -These six exist only on the compose stack, in -`deploy/observability/mimir/rules/anonymous/host.yaml`. The disk and memory -alerts come from `prometheus.exporter.unix` in `config.alloy`, the target and -discovery alerts from Alloy's own scraping, and the certificate alert from -Traefik. On Kubernetes the cluster's own node monitoring owns this +The service repository does not ship these six. They are host-level alerts the +maintainers run on their own compose host, where the disk and memory alerts come +from a node exporter, the target and discovery alerts from the scraper's own +view of its targets, and the certificate alert from the Traefik edge in front. +On a compose deployment, host monitoring is the operator's own; the procedures +apply to alerts defined under these names. On Kubernetes the cluster's own node monitoring owns this ground, so the chart does not ship them. The commands assume `ssh user@host` and the stack in `~/easyp`. @@ -366,8 +370,8 @@ Two ways to get here, and they need different answers. The edge certificate expires within 21 days and Traefik has not replaced it. Traefik attempts renewal at 30 days, so reaching 21 means an attempt has already -failed. Note that on this stand issuance was proven once, at setup, and renewal -has never run — the first attempt is due around 7 October 2026. +failed. A first renewal is the one most likely to fail: issuance at setup proves +the challenge worked once, not that it still does. 1. `docker logs easyp-traefik 2>&1 | grep -i acme | tail -30`. The reason is almost always the HTTP-01 challenge. diff --git a/content/docs/api-service/runbooks.ru.mdx b/content/docs/api-service/runbooks.ru.mdx index cb418be..c347f73 100644 --- a/content/docs/api-service/runbooks.ru.mdx +++ b/content/docs/api-service/runbooks.ru.mdx @@ -4,8 +4,9 @@ description: "По одной процедуре на каждый алерт, --- По одному разделу на каждый алерт в -`deploy/charts/easyp-service/templates/prometheusrule.yaml` и в -`deploy/observability/mimir/rules/anonymous/`. Аннотация `runbook_url` каждого +`deploy/charts/easyp-service/templates/prometheusrule.yaml` и, в конце, на +алерты хоста, которые в поставку не входят (см. [Хост](#the-host)). Аннотация +`runbook_url` каждого алерта указывает на соответствующий якорь здесь, поэтому текст заголовка несущий: переименование ломает ссылку из алерта. @@ -88,15 +89,17 @@ Reason у отказа — `SERVER_OVERLOADED`. Алерт смотрит на Работа стоит в очереди непрерывно десять минут. Ручки те же, что выше; разница в том, что это устойчиво, а не всплеском, — то есть утверждение о ёмкости, а не пик. Добавляйте мощность, а не глубину очереди: длинная очередь лишь -переставляет задержку с места на место. Мощность здесь — это под побольше: -больше CPU и выше `maxConcurrentGenerations` (с памятью под это). Несколько -реплик на общем томе кеша не поддерживаются. +переставляет задержку с места на место. Мощность здесь — это больше реплик (у +каждой свой пул воркеров, а при настроенном S3 `replicaCount` или +`autoscaling.maxReplicas` можно поднять выше 1) либо под побольше: больше CPU и +выше `maxConcurrentGenerations` (с памятью под это). См. +[Горизонтальное масштабирование](/ru/docs/api-service/architecture#scaling-out). ## EasypPluginCacheAtLimit Распакованные плагины на диске достигли `config.registry.cacheMaxBytes`. -Само по себе это не неисправность: кэш и должен достигать предела и вытеснять. +Само по себе это не неисправность: кеш и должен достигать предела и вытеснять. Смотрите на `easyp_plugin_cache_evictions_total`. Ровное вытеснение при ровной задержке генерации означает, что всё работает. @@ -262,10 +265,12 @@ easyp CLI даёт отказ, потому что CLI не отправляет ## Хост [#the-host] -Эти шесть существуют только в compose-стеке, в -`deploy/observability/mimir/rules/anonymous/host.yaml`. Алерты диска и памяти -приходят из `prometheus.exporter.unix` в `config.alloy`, алерты целей и -обнаружения — из собственного скрейпинга Alloy, алерт сертификата — из Traefik. В Kubernetes этой землёй владеет собственный мониторинг +Этих шести алертов в репозитории сервиса нет. Это алерты уровня хоста, которые +мейнтейнеры держат на своём compose-хосте: алерты диска и памяти там приходят из +node exporter, алерты целей и обнаружения — из того, как сборщик метрик видит +свои цели, алерт сертификата — из Traefik на входе. В compose-развёртывании +мониторинг хоста — забота оператора; процедуры подходят к алертам, заведённым +под этими именами. В Kubernetes этой землёй владеет собственный мониторинг узлов кластера, поэтому чарт их не поставляет. Команды предполагают `ssh user@host` и стек в `~/easyp`. @@ -281,13 +286,13 @@ easyp CLI даёт отказ, потому что CLI не отправляет что растёт медленно. 1. `df -h` для общей картины, затем `docker system df` — на этом хосте ответом - каждый раз был кэш сборки, и `ACTIVE 0` рядом с большим числом означает, что + каждый раз был кеш сборки, и `ACTIVE 0` рядом с большим числом означает, что всё это освобождаемо. 2. `docker builder prune -af` и `docker image prune -f`. Освобождение 3,4 ГБ таким способом уже однажды увело диск с 73% на 49%. -3. Если дело не в кэше сборки — `du -xh --max-depth=2 / | sort -h | tail -20`. +3. Если дело не в кеше сборки — `du -xh --max-depth=2 / | sort -h | tail -20`. `-x` здесь важен: без него вы уйдёте в overlay каждого контейнера. -4. Кэш сборки, который возвращается снова, означает, что на этом хосте что-то +4. Кеш сборки, который возвращается снова, означает, что на этом хосте что-то собирает образы. Оно должно вместо этого тянуть опубликованный: `docker compose pull`, а не локальная сборка. @@ -300,7 +305,7 @@ easyp CLI даёт отказ, потому что CLI не отправляет пока это ещё дёшево, и который сработал бы за несколько дней до того, как предыдущую проблему с диском заметили руками. -1. Первый шаг тот же: `docker system df`. Рост без причины в кэше сборки здесь +1. Первый шаг тот же: `docker system df`. Рост без причины в кеше сборки здесь необычен. 2. Проверьте, не данные ли это, а не мусор: `docker system df -v` разделяет тома и образы. Postgres и телеметрические бакеты растут законно, и ответ для них — @@ -319,7 +324,7 @@ easyp CLI даёт отказ, потому что CLI не отправляет Доступно меньше 10% памяти. Доступно, а не свободно. Свободная память на здоровой Linux-машине близка к -нулю, потому что ядро тратит её на страничный кэш, поэтому меряется +нулю, потому что ядро тратит её на страничный кеш, поэтому меряется `MemAvailable` — то, что реально сможет получить новая аллокация. 1. `docker stats --no-stream` для разбивки по контейнерам. @@ -378,9 +383,8 @@ easyp CLI даёт отказ, потому что CLI не отправляет Пограничный сертификат истекает в течение 21 дня, и Traefik его не заменил. Traefik пытается обновить за 30 дней, так что дойти до 21 означает, что попытка -уже провалилась. Учтите, что на этом стенде выпуск был доказан один раз, при -установке, а обновление не запускалось ни разу — первая попытка ожидается около -7 октября 2026. +уже провалилась. Чаще всего срывается первое обновление: выпуск при установке +доказывает лишь, что проверка прошла однажды, а не что проходит до сих пор. 1. `docker logs easyp-traefik 2>&1 | grep -i acme | tail -30`. Причина почти всегда в HTTP-01-челлендже. diff --git a/content/docs/api-service/security.mdx b/content/docs/api-service/security.mdx index f352fbd..e2aba4b 100644 --- a/content/docs/api-service/security.mdx +++ b/content/docs/api-service/security.mdx @@ -119,6 +119,9 @@ time; the cache is a separate volume). Beyond that: ## Reporting vulnerabilities -As of v1.3.2 the service repository publishes no security policy and has -GitHub's private vulnerability reporting turned off. Contact the maintainers -privately before opening a public issue about a vulnerability. +Do not open a public issue. Report a vulnerability privately through GitHub: +[Report a vulnerability](https://github.com/easyp-tech/service/security/advisories/new) +on the service repository. The +[security policy](https://github.com/easyp-tech/service/blob/master/SECURITY.md) +lists the supported versions, what to include in a report, and which documented +limitations are not treated as vulnerabilities. diff --git a/content/docs/api-service/security.ru.mdx b/content/docs/api-service/security.ru.mdx index f28c18f..98cab15 100644 --- a/content/docs/api-service/security.ru.mdx +++ b/content/docs/api-service/security.ru.mdx @@ -60,7 +60,7 @@ description: "Что плагин может сделать на хосте се поверхностью атаки для любого, кто достучался до порта. Если это важно, включите `auth.require_authentication: true` или ограничьте сеть, учитывая, что easyp CLI не умеет отправлять токен (см. -[Использование клиентами](/ru/docs/api-service/client-usage)). +[Подключение клиентов](/ru/docs/api-service/client-usage)). ## Что регистрировать @@ -119,6 +119,9 @@ Helm-чарт уже запускает под от UID 65532 с `runAsNonRoot`, ## Сообщения об уязвимостях -На v1.3.2 репозиторий сервиса не публикует политику безопасности, и приватные -сообщения об уязвимостях GitHub в нём выключены. Прежде чем открывать публичный -issue об уязвимости, свяжитесь с мейнтейнерами напрямую. +Не открывайте публичный issue. Об уязвимости сообщайте приватно через GitHub: +[Report a vulnerability](https://github.com/easyp-tech/service/security/advisories/new) +в репозитории сервиса. В +[политике безопасности](https://github.com/easyp-tech/service/blob/master/SECURITY.md) +перечислены поддерживаемые версии, что приложить к сообщению и какие +задокументированные ограничения уязвимостями не считаются. diff --git a/content/docs/api-service/upgrading.mdx b/content/docs/api-service/upgrading.mdx index b23898d..8fa2e86 100644 --- a/content/docs/api-service/upgrading.mdx +++ b/content/docs/api-service/upgrading.mdx @@ -34,6 +34,37 @@ A rename is handled without breaking anyone: the old configuration key keeps working for one release while warning, naming both spellings and the line to change, and only then stops. +## v1.3.0 → v1.3.1 + +v1.3.1 was tagged but never published: the release job's image scan stopped it +before anything left the runner. v1.3.2 carries the same changes plus a +dependency fix, so upgrade from v1.3.0 straight to v1.3.2. Only the `api/v1.3.1` +and `sdk/v1.3.1` Go modules exist under that number. + +### `latest` resolves to the highest version number + +`latest` used to be chosen by sorting version strings, which ranks `v1.36.9` +above `v1.36.11`. It now compares versions component by component, a missing +patch counting as zero. **A registry holding such versions serves a different +`latest` after the upgrade**: on plugins.easyp.tech `protocolbuffers/go:latest` +moved from v1.36.9 to v1.36.11 and `bufbuild/es:latest` from v2.9.0 to v2.12.0, +nine plugins of 80 in all. An unpinned `remote:` generates different code from +the first run after the upgrade; pin the version to keep the old output. + +### MCP `plugins_list` items carry `createdAt` + +Each item in `plugins` had `created_at` while everything else in the result — +`nextPageToken`, `platform` — was lowerCamelCase. The field is now `createdAt`. +A client reading `created_at` gets nothing and must switch. Only the MCP JSON +changed: the gRPC wire, the Go SDK and the database are as before. + +### MCP reports the service's real version + +`serverInfo.version` in the `initialize` response was the literal `v1.0.0` +whatever was running. It is now the version the release build stamps, so a +deployed service can be identified from outside. Anything that compared it +with `v1.0.0` must change. + ## v1.2.1 → v1.3.0 ### `plugins publish` builds for the service's platform @@ -94,6 +125,82 @@ A refused request reads `rate limit exceeded for , retry after s`. The ## v1.1.x → v1.2.0 +### The Helm chart runs a StatefulSet + +Chart 1.2.0 renders a StatefulSet instead of a Deployment. Each replica gets a +`ReadWriteOnce` claim of its own from a claim template, +`plugins--easyp-service-N`, and upgrades roll instead of using +`Recreate`. Along with it: + +- `persistence.existingClaim` is removed. An upgrade that still sets it fails + before any pod starts, naming the claim to rebind the volume to. +- `persistence.accessMode` must be `ReadWriteOnce` or `ReadWriteOncePod`; a + shared mode is refused. +- More than one replica, or `autoscaling.enabled` with `maxReplicas` above 1, + needs `config.registry.s3.bucket`. +- New values: `autoscaling.*` and `persistence.retentionPolicy`. + +The old standalone claim, `-easyp-service-plugins`, is no longer +mounted. It carries `helm.sh/resource-policy: keep`, so Helm leaves it in place, +and the install notes name it. What to do with it depends on object storage: + +- **With S3** nothing is lost. Upgrade, let the new claims fill on demand — a + cold start per replica — and delete the old claim once the pods are serving. +- **Without S3** the old claim holds the only copy of every plugin. Before + upgrading, rebind its PersistentVolume to the name the StatefulSet looks for; + the StatefulSet then adopts it as replica 0's claim instead of creating an + empty one. For a release named `easyp`: + +```bash +release=easyp +old=easyp-easyp-service-plugins # or the claim existingClaim named +new=plugins-easyp-easyp-service-0 + +pv="$(kubectl get pvc "$old" -o jsonpath='{.spec.volumeName}')" +class="$(kubectl get pvc "$old" -o jsonpath='{.spec.storageClassName}')" +size="$(kubectl get pvc "$old" -o jsonpath='{.spec.resources.requests.storage}')" + +# Keep the volume when its claim goes away, and stop the pod that mounts it. +kubectl patch pv "$pv" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' +kubectl scale deploy/easyp-easyp-service --replicas=0 +kubectl delete pvc "$old" + +# Free the volume, then claim it under the StatefulSet's name. +kubectl patch pv "$pv" --type=json -p '[{"op":"remove","path":"/spec/claimRef"}]' +kubectl create -f - < --reuse-values \ + --set persistence.existingClaim=null --set persistence.size="$size" +``` + +`--reuse-values` works here, with one catch: it replaces the new chart's +defaults with the old release's values, so `autoscaling` and +`persistence.retentionPolicy` arrive absent and are read as off and `Retain`. +To turn autoscaling on in the same upgrade use `--reset-then-reuse-values` +(Helm 3.14+); `--set autoscaling.enabled=true` alone is refused. + +If the pod already started on an empty claim, the same steps apply with +`kubectl scale statefulset/easyp-easyp-service --replicas=0` instead of the +Deployment, deleting the empty `plugins-easyp-easyp-service-0` along with the +old claim, and scaling back to one afterwards. Anything that addressed +`deploy/-easyp-service` — `kubectl rollout`, `kubectl logs`, +dashboards, alerts on `kube_deployment_*` — needs `statefulset/` instead. The +chart README has the full procedure: +[Upgrading from a release that rendered a Deployment](https://github.com/easyp-tech/service/blob/master/deploy/charts/easyp-service/README.md#upgrading-from-a-release-that-rendered-a-deployment). + ### `plugins publish` replaces `push`, `register` and `pack` The three commands, `--packed` and `--plugins-prefix` are gone, and so are the diff --git a/content/docs/api-service/upgrading.ru.mdx b/content/docs/api-service/upgrading.ru.mdx index 249dc69..7899e88 100644 --- a/content/docs/api-service/upgrading.ru.mdx +++ b/content/docs/api-service/upgrading.ru.mdx @@ -34,6 +34,38 @@ description: "Заметки по обновлению API Service от рели работать один релиз, предупреждая и называя оба написания и строку, которую надо поправить, и только после этого перестаёт. +## v1.3.0 → v1.3.1 + +Тег v1.3.1 поставлен, но релиз так и не вышел: сканер образа в релизной сборке +остановил его до того, как что-либо было опубликовано. В v1.3.2 те же изменения +плюс исправленная зависимость, так что обновляйтесь с v1.3.0 сразу на v1.3.2. +Под номером v1.3.1 существуют только Go-модули `api/v1.3.1` и `sdk/v1.3.1`. + +### `latest` — самая новая версия по номеру + +Раньше `latest` выбирался сортировкой строк версий, и `v1.36.9` оказывался +старше `v1.36.11`. Теперь версии сравниваются покомпонентно, отсутствующий патч +считается нулём. **Реестр с такими версиями после обновления отдаёт другой +`latest`**: на plugins.easyp.tech `protocolbuffers/go:latest` сменился с v1.36.9 +на v1.36.11, а `bufbuild/es:latest` — с v2.9.0 на v2.12.0, всего девять плагинов +из 80. Незафиксированный `remote:` с первого запуска после обновления +сгенерирует другой код; чтобы оставить прежний результат, зафиксируйте версию. + +### Элементы `plugins_list` в MCP несут `createdAt` + +У каждого элемента `plugins` было поле `created_at`, хотя всё остальное в +результате — `nextPageToken`, `platform` — в lowerCamelCase. Теперь поле +называется `createdAt`. Клиент, читающий `created_at`, ничего не получит — его +нужно поправить. Изменился только JSON в MCP: gRPC, Go SDK и база данных +прежние. + +### MCP сообщает настоящую версию сервиса + +`serverInfo.version` в ответе на `initialize` всегда был `v1.0.0`, что бы ни +работало на самом деле. Теперь это версия, которую проставляет релизная сборка, +так что развёрнутый сервис можно опознать снаружи. Всё, что сравнивало это поле +с `v1.0.0`, нужно поправить. + ## v1.2.1 → v1.3.0 ### `plugins publish` собирает под платформу сервиса @@ -96,6 +128,83 @@ SDK и `easyp-svc` подключаются к обычному `host:port` че ## v1.1.x → v1.2.0 +### Helm-чарт запускает StatefulSet + +Чарт 1.2.0 рендерит StatefulSet вместо Deployment. Каждая реплика получает +собственный claim `ReadWriteOnce` из шаблона, `plugins--easyp-service-N`, +а обновление идёт по одному поду вместо `Recreate`. Вместе с этим: + +- `persistence.existingClaim` убран. Обновление, где он ещё задан, падает до + запуска пода и называет claim, к которому нужно перепривязать том. +- `persistence.accessMode` — только `ReadWriteOnce` или `ReadWriteOncePod`; + общий режим чарт отвергает. +- Для нескольких реплик или `autoscaling.enabled` с `maxReplicas` больше 1 + нужен `config.registry.s3.bucket`. +- Новые значения: `autoscaling.*` и `persistence.retentionPolicy`. + +Старый отдельный claim, `-easyp-service-plugins`, больше не +монтируется. У него стоит `helm.sh/resource-policy: keep`, поэтому Helm его не +удаляет, а заметки установки его называют. Что с ним делать, зависит от +объектного хранилища: + +- **С S3** ничего не теряется. Обновитесь, дайте новым claim'ам заполниться по + мере обращений — по холодному старту на реплику — и удалите старый claim, + когда поды начнут обслуживать запросы. +- **Без S3** старый claim хранит единственную копию всех плагинов. До + обновления перепривяжите его PersistentVolume к имени, которое ищет + StatefulSet; тогда StatefulSet возьмёт его как claim реплики 0 вместо пустого. + Для релиза с именем `easyp`: + +```bash +release=easyp +old=easyp-easyp-service-plugins # или claim, названный в existingClaim +new=plugins-easyp-easyp-service-0 + +pv="$(kubectl get pvc "$old" -o jsonpath='{.spec.volumeName}')" +class="$(kubectl get pvc "$old" -o jsonpath='{.spec.storageClassName}')" +size="$(kubectl get pvc "$old" -o jsonpath='{.spec.resources.requests.storage}')" + +# Сохранить том, когда его claim удалят, и остановить под, который его монтирует. +kubectl patch pv "$pv" -p '{"spec":{"persistentVolumeReclaimPolicy":"Retain"}}' +kubectl scale deploy/easyp-easyp-service --replicas=0 +kubectl delete pvc "$old" + +# Освободить том и занять его под именем, которое ждёт StatefulSet. +kubectl patch pv "$pv" --type=json -p '[{"op":"remove","path":"/spec/claimRef"}]' +kubectl create -f - < --reuse-values \ + --set persistence.existingClaim=null --set persistence.size="$size" +``` + +`--reuse-values` здесь работает, но с оговоркой: он подменяет значения по +умолчанию нового чарта значениями старого релиза, поэтому `autoscaling` и +`persistence.retentionPolicy` приходят пустыми и читаются как «выключено» и +`Retain`. Чтобы включить автоскейлинг в том же обновлении, используйте +`--reset-then-reuse-values` (Helm 3.14+); один `--set autoscaling.enabled=true` +чарт отвергнет. + +Если под уже запустился на пустом claim, шаги те же, только вместо Deployment — +`kubectl scale statefulset/easyp-easyp-service --replicas=0`, вместе со старым +claim удаляется пустой `plugins-easyp-easyp-service-0`, а в конце реплику +возвращают обратно. Всё, что обращалось к `deploy/-easyp-service`, — +`kubectl rollout`, `kubectl logs`, дашборды, алерты на `kube_deployment_*` — +теперь должно указывать `statefulset/`. Полная процедура — в README чарта: +[Upgrading from a release that rendered a Deployment](https://github.com/easyp-tech/service/blob/master/deploy/charts/easyp-service/README.md#upgrading-from-a-release-that-rendered-a-deployment). + ### `plugins publish` вместо `push`, `register` и `pack` Трёх команд больше нет, как и флагов `--packed` и `--plugins-prefix`, и задач diff --git a/content/docs/api-service/vs-buf-bsr.mdx b/content/docs/api-service/vs-buf-bsr.mdx index a057593..4484f68 100644 --- a/content/docs/api-service/vs-buf-bsr.mdx +++ b/content/docs/api-service/vs-buf-bsr.mdx @@ -75,8 +75,8 @@ and accept that plugins are not sandboxed. version is ready to use. EasyP's catalogue is a set of recipes: each deployment builds and registers the versions it wants. - **Availability and scale.** A SaaS with published uptime SLAs on paid plans - [⁹](#sources). The EasyP service runs as one replica per cache and scales - vertically only. + [⁹](#sources). The EasyP service scales horizontally: each replica keeps its + own plugin cache, and more than one replica needs S3. - **Semantics of "latest".** An unpinned BSR plugin resolves to the latest version [²](#sources). EasyP's `latest` is the same: the highest registered version, compared by number (`v1.36.11` over `v1.36.9`). On both, it moves diff --git a/content/docs/api-service/vs-buf-bsr.ru.mdx b/content/docs/api-service/vs-buf-bsr.ru.mdx index 4a03bf2..ddf6c73 100644 --- a/content/docs/api-service/vs-buf-bsr.ru.mdx +++ b/content/docs/api-service/vs-buf-bsr.ru.mdx @@ -75,8 +75,8 @@ API Service — ПО, которое вы эксплуатируете сами: опубликованная версия сразу готова к использованию. Каталог EasyP — набор рецептов: каждое развёртывание само собирает и регистрирует нужные версии. - **Доступность и масштаб.** SaaS с опубликованными SLA доступности на платных - тарифах [⁹](#sources). Сервис EasyP работает одной репликой на кеш и - масштабируется только вертикально. + тарифах [⁹](#sources). Сервис EasyP масштабируется горизонтально: у каждой + реплики свой кеш плагинов, а для нескольких реплик нужен S3. - **Семантика «latest».** Незафиксированный плагин BSR разрешается в последнюю версию [²](#sources). `latest` в EasyP устроен так же: самая новая зарегистрированная версия при сравнении номеров как чисел (`v1.36.11` новее diff --git a/scripts/sync-plugin-catalog.mjs b/scripts/sync-plugin-catalog.mjs index 3c84769..7d36669 100644 --- a/scripts/sync-plugin-catalog.mjs +++ b/scripts/sync-plugin-catalog.mjs @@ -183,7 +183,7 @@ const text = { 'где-то уже работает: в развёртывании есть только версии, которые оператор собрал и', 'зарегистрировал (лицензия Community допускает 10 версий). Как их собрать и зарегистрировать —', 'в [Плагинах](/ru/docs/api-service/plugins), как указать в `easyp.yaml` — в', - '[Использовании клиентами](/ru/docs/api-service/client-usage).', + '[Подключении клиентов](/ru/docs/api-service/client-usage).', '', 'Что прямо сейчас зарегистрировано в публичном реестре — на странице [Плагины на plugins.easyp.tech](/ru/plugins).', ], From 5f748062452cd84532f71903f528326ea51f1366 Mon Sep 17 00:00:00 2001 From: Edgar Sipki Date: Fri, 20 Nov 2026 03:46:48 +0300 Subject: [PATCH 2/2] docs(api-service): regenerate the plugin catalog wording Co-Authored-By: Claude Opus 5.5 --- content/docs/api-service/plugin-catalog.ru.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/api-service/plugin-catalog.ru.mdx b/content/docs/api-service/plugin-catalog.ru.mdx index 93f2066..c4c6694 100644 --- a/content/docs/api-service/plugin-catalog.ru.mdx +++ b/content/docs/api-service/plugin-catalog.ru.mdx @@ -10,7 +10,7 @@ description: "Все рецепты плагинов, которые поста где-то уже работает: в развёртывании есть только версии, которые оператор собрал и зарегистрировал (лицензия Community допускает 10 версий). Как их собрать и зарегистрировать — в [Плагинах](/ru/docs/api-service/plugins), как указать в `easyp.yaml` — в -[Использовании клиентами](/ru/docs/api-service/client-usage). +[Подключении клиентов](/ru/docs/api-service/client-usage). Что прямо сейчас зарегистрировано в публичном реестре — на странице [Плагины на plugins.easyp.tech](/ru/plugins).