App service
Services/Dagster code location

Dagster code location service

Dagster code location service that builds your Dagster project from Git and serves its assets, jobs, and schedules to the Dagster webserver and daemon.

This service runs your code: its image is built from a Git repository, and each build is deployed to an app environment.

On Wodby

How Dagster code location runs on Wodby

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.

Overview

Technical profile of Dagster code location

The versions are the ones you can select for Dagster code location in a stack or an app environment. The service itself is published in revisions, and a stack references a specific revision.

Service type

App service

Versions

1

Stacks

Stacks that include Dagster code location

This public stack includes Dagster code location. You can create an app from a public stack as it is, or add the service to a stack of your own.

CI/CD

Build Dagster code location from a Git repository

Start from a public boilerplate or connect your own repository. With Wodby CI, a push to the branch that an app environment follows starts a build of Dagster code location, and the pipeline deploys it.

Git providers

You connect a repository through an integration with its Git provider.

CI providers

Wodby CI is built in: the pipeline is the file .wodby/pipeline.yml in the repository. For a repository you connect, an external CI provider can run the same steps with Wodby CLI.

Container registries

Built images go to Wodby Registry by default, or to an external registry that you connect as an integration.

Environment variables from integrations

A variable integration stores the credentials of a third-party service once. Attach it to Dagster code location and Wodby passes them to the container as environment variables at runtime, not during the image build.

Configuration

Dagster code location service configuration

The Dagster code location service declares the following. Where a value can be changed, a stack sets it and each app environment can override it.

Settings

2 settings that a stack or an app environment can change.

Service links

Each link is a connection from Dagster code location to another service. A stack sets which service a link points to. The cards list the public services that can satisfy each link.