Сервис приложения
Сервисы/Dagster code location

Сервис Dagster code location

Сервис code location для Dagster: собирает ваш проект Dagster из Git и предоставляет его ассеты, задания и расписания веб-серверу и демону Dagster.

Этот сервис запускает ваш код: его образ собирается из Git-репозитория, а каждая сборка развёртывается в окружение.

В StackMaster

Как Dagster code location работает в StackMaster

A Dagster code location built from the app's repository: a gRPC code server that the dagster service's webserver and daemon load. Use them together, as in the Dagster stack.

Image

The image is built from the app's Git repository on top of the Dagster image of the dagster service's version (dagster/dagster-celery-k8s), so the code server runs the same Dagster as the webserver and daemon. Start the repository from the Dagster boilerplate. The build:

  • copies the repository to /opt/dagster/app, which is on the Python path;
  • installs the packages in requirements.txt, when the repository has one. It fails when they change Dagster's own version: Dagster comes with the image, and Dagster libraries must match it;
  • writes Dagster's instance settings ($DAGSTER_HOME/dagster.yaml), which read the PostgreSQL connection of the postgres link from the environment.

Code server

The container runs dagster code-server start on port 4000 (private), loading the module in the "Python module" setting (DAGSTER_CODE_MODULE, default app.definitions) under the name in the "Location name" setting (DAGSTER_CODE_LOCATION, default app). The dagster service's workspace (workspace.yaml) must list it as a gRPC server with the stack service's name as the host, port 4000 and the same location name. Startup and readiness use dagster api grpc-health-check.

A deployment builds a new image and restarts the code server; Dagster reloads the code location.

Runs

The Dagster stack sets the dagster service's run launcher to Dagster's DefaultRunLauncher: the daemon starts each run inside this code server, which has the project's code and packages, instead of in a Kubernetes job. Runs and their events are stored in the linked PostgreSQL database. Run outputs that Dagster's default IO manager writes to the code server's disk don't survive a restart: configure an IO manager that writes to external storage for outputs that later runs read.

Give the code server enough memory and CPU for the runs it executes.

Обзор

Технический профиль Dagster code location

Здесь перечислены версии, которые можно выбрать для Dagster code location в стеке или окружении. Сам сервис публикуется ревизиями, и стек ссылается на конкретную ревизию.

Тип сервиса

Сервис приложения

Версии

1

Стеки

Стеки, в которые входит Dagster code location

Dagster code location входит в этот публичный стек. Можно создать приложение из публичного стека как есть или добавить сервис в собственный стек.

CI/CD

Сборка Dagster code location из Git-репозитория

Начните с публичного шаблона проекта или подключите собственный репозиторий. В StackMaster CI push в ветку, за которой следит окружение, запускает сборку Dagster code location, а пайплайн её развёртывает.

Vanilla Dagster project

Используйте его как есть или клонируйте в свой Git-аккаунт.

wodby/dagster-boilerplate

Git-провайдеры

Репозиторий подключается через интеграцию с его Git-провайдером.

CI-провайдеры

StackMaster CI встроен в платформу: пайплайн описывается в файле .wodby/pipeline.yml в репозитории. Для подключённого репозитория те же шаги может выполнять внешний CI-провайдер с помощью StackMaster CLI.

Реестры контейнеров

Собранные образы по умолчанию попадают в StackMaster Registry или во внешний реестр, подключённый как интеграция.

Переменные окружения из интеграций

Интеграция с переменными один раз сохраняет учётные данные стороннего сервиса. Подключите её к Dagster code location, и StackMaster передаст их в контейнер как переменные окружения во время работы, а не при сборке образа.

Конфигурация

Конфигурация сервиса Dagster code location

Сервис Dagster code location объявляет следующее. Если значение можно изменить, его задаёт стек, а каждое окружение может его переопределить.

Настройки

2 настройки, которые стек или окружение могут изменить.

Связи сервиса

Каждая связь — это подключение Dagster code location к другому сервису. На какой сервис указывает связь, задаёт стек. На карточках перечислены публичные сервисы, которые подходят для каждой связи.