Skip to content

Issue #1490, Issue #1491: fix: pin Dagster 1.13.26 and SQLAlchemy below 2.1 in the Dagster images - #1504

Merged
bjagg merged 5 commits into
mainfrom
issue-1490-pin-dagster
Nov 12, 2026
Merged

bjagg merged 5 commits into
mainfrom
issue-1490-pin-dagster

Conversation

@dereck-symmetry

Copy link
Copy Markdown
Contributor
Description of Change

Two unpinned installs in the Dagster images, fixed together because neither can ship alone (bjagg's call on #1490).

#1490: the webserver/daemon images install the newest Dagster on every build. Both Dockerfile.dagster files ran pip install dagster dagster-graphql … with no versions. From 1.13.29, the Orchestrator API's dagster-graphql 1.11.4 client can't build a schema from the server's introspection: POST /jobs returns 500, and every orchestrated query comes back without its fetched fields. This pins them to 1.13.26 (dagster-postgres/dagster-docker 0.29.26), which is what dev's webserver and daemon have run since 2026-10-14 (bjagg read it from the running tasks), against the Dagster database they've been migrating. Moving to 1.11.12 or anything else is a separate, deliberate step.

#1491: the code-location images still get SQLAlchemy 2.1. #1383 pinned sqlalchemy<2.1 only in Dockerfile.dagster. Dockerfile.code_location's runtime stage installs the project wheel from PyPI, and none of the three projects/dagster_*/pyproject.toml constrained SQLAlchemy. 2.1 defaults postgresql to psycopg (v3), while dagster-postgres brings psycopg2, so runs failed to launch with No module named 'psycopg'. This adds "sqlalchemy<2.1" to all three.

Why one PR: dagster.yml and dagster_code_location.yml both watch projects/dagster_oss_ecs/**. The #1491 fix alone would rebuild dev's webserver with unpinned Dagster (now ≥ 1.13.29) and break run submission in the same deploy that fixed run launch.

Side effects / rollout: merging rebuilds and redeploys dev's dagster-webserver, dagster-daemon and dagster-code-location services. The webserver and daemon land on the version they already run, so nothing changes there. The code location moves from SQLAlchemy 2.1.x to 2.0.x. Demo gets both at its next promotion. dagster_plus_hybrid has no build workflow; its pin only matters if someone builds it.

Not in this PR: installing the runtime stage from a lock file (#1491's second option), which would remove this class of bug. Also aligning pyproject.toml's dagster==1.11.12 (the code location) with the server's 1.13.26.

How to review: read the two Dockerfile.dagster pins and the three pyproject.toml lines. To reproduce the version check:

tar -cf - projects/dagster_oss_ecs | docker build -t t -f projects/dagster_oss_ecs/Dockerfile.dagster -
docker run --rm t python -c "import importlib.metadata as m; print(m.version('dagster'), m.version('sqlalchemy'))"
Related Issues

Closes #1490
Closes #1491
Refs #1383

Type of Change
  • Bug fix (non-breaking change which fixes an issue)
  • Infrastructure/deployment change
Project Area(s) Affected
  • projects/

Checklist
  • commit message follows commit guidelines (see commitlint.config.mjs)
  • pre-commit hooks have been run successfully (uv-lock, cspell, check-workflow-paths, commitlint; no Python changed)
Testing
  • Manual testing performed

Built from this branch on 2026-11-10:

Image Dagster SQLAlchemy Postgres driver
dagster_oss_ecs/Dockerfile.dagster 1.13.26 (graphql/webserver 1.13.26, postgres/docker 0.29.26) 2.0.57 psycopg2 2.9.13
dagster_docker_compose/Dockerfile.dagster same 2.0.57 psycopg2 2.9.13
dagster_oss_ecs/Dockerfile.code_location 1.11.12 2.0.57 create_engine("postgresql://…") → psycopg2

On main, the code-location images fail to create a PostgreSQL engine (No module named 'psycopg'), measured on 11-09. That 1.13.26 accepts the Orchestrator's run submission comes from #1490's measurement on the local stack (11-07: 1.11.12 and 1.13.26 submit, 1.13.29 returns 500). I didn't re-run that end to end here.

Additional Notes

No CHANGELOG conflicts expected: both entries sit at the top of ### Fixed.

🤖 Generated with Claude Code

dereck and others added 2 commits November 10, 2026 17:47
…on images

The runtime stage installs the project wheel from PyPI, and none of the three
projects/dagster_* pyproject files constrained SQLAlchemy, so the image got 2.1, whose
postgresql dialect needs psycopg (v3). dagster-postgres brings psycopg2, so every run
failed to launch with "No module named 'psycopg'". #1383 pinned only the webserver image.

Measured: main's dagster_oss_ecs and dagster_docker_compose images fail to create a
postgresql engine; with this, both get SQLAlchemy 2.0.57 on psycopg2, and the code
location's definitions validate.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… images

Both Dockerfile.dagster files installed the newest Dagster on every build. From
1.13.29 the Orchestrator API's 1.11.4 client can't build a schema from the
server's introspection, so POST /jobs returns 500 and no orchestrated query runs.

Pin 1.13.26 (dagster-postgres/dagster-docker 0.29.26): what dev's webserver and
daemon have run since 2026-10-14 (bjagg read it from the running tasks), against
the Dagster database they have been migrating. Moving to another version is a
separate, deliberate step.

Measured: both images build with exactly these versions, SQLAlchemy 2.0.57 on
psycopg2.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@bjagg bjagg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Dereck. I checked it at cc50c7c:

  • Webserver and daemon: the pinned set resolves for Python 3.13 to dagster, dagster-graphql, dagster-webserver, dagster-pipes and dagster-shared 1.13.26, dagster-postgres and dagster-docker 0.29.26, psycopg2-binary 2.9.13 and SQLAlchemy 2.0.57. That's the same Dagster that dev runs today. The only difference is SQLAlchemy, a patch bump from 2.0.54.
  • Code location: dagster_oss_ecs's dependencies now resolve to SQLAlchemy 2.0.57 with psycopg2-binary, so the wheel the runtime stage installs no longer brings in 2.1.
  • No uv.lock in the three projects needs regenerating.

Approving. Keeping both fixes in one PR is right, given both workflows watch projects/dagster_oss_ecs/**.

bjagg added a commit that referenced this pull request Nov 12, 2026
…1510)

##### Description of Change

Eight eMudhra intermediate CAs were compromised (#1480). Mozilla's NSS
3.131.1 removed trust in three emSign roots: **emSign Root CA - C1**,
**emSign ECC Root CA - C3** and **emSign ECC Root CA - G3**. It still
trusts **emSign Root CA - G1**. Our service images still trusted the
removed roots through both of Python's trust paths:

| Trust store | Used by | Before | After |
|---|---|---|---|
| `certifi`'s bundle | `requests`, and anything that passes
`certifi.where()` | 2025.4.26 to 2026.7.22, depending on the lock; dev's
MDR image had 2025.10.05 with all 4 emSign roots | 2026.10.23: G1 only |
| Debian's `ca-certificates` (`20250419+deb13u1`, current
`python:3.13-slim`) | `ssl.create_default_context()`, `urllib`, OpenSSL
| C1, C3 and G1, in 148 certificates | G1 only, in 146 |

Rebuilding alone doesn't fix the second row. Today's `python:3.13-slim`
still ships C1 and C3, as dev's MDR image, rebuilt 11-10, shows.

**What changes:**
- **Lock files:** `certifi` is 2026.10.23 in all 11 `uv.lock` files that
list it. Only the `certifi` block changes in each; the lock `revision`
and every other package are untouched, and `uv lock --check` passes for
each. The Query Cache, Control Plane and example data source locks don't
include `certifi`.
- **Dockerfiles:** the 12 service Dockerfiles that `build.sh` and the
deploy workflows build, and `dagster_oss_ecs/Dockerfile.dagster` and
`Dockerfile.code_location` (its runtime stage), each get one step. It
marks the three removed roots `!` in `/etc/ca-certificates.conf` and
runs `update-ca-certificates --fresh`.

**Not changed:**
- The `Dockerfile2` variants, which no workflow builds.
- `dagster_docker_compose` and `dagster_plus_hybrid`.
- The frontends, which serve static files and rely on the browser's own
store.
- The MongoDB, MariaDB and Flyway images.

The Dagster webserver image installs Dagster unpinned (#1504 pins it),
so it gets `certifi` 2026.10.23 from PyPI on rebuild. This PR merges
cleanly with #1504.

**Deploys on merge** (by each workflow's `push.paths`):
- Advisor, GraphQL, Identity Mapper, Learner Data Export, Orchestrator,
Query Cache, Query Planner, Semantic Search, Translator, the example
data source, and both Dagster images.
- The **MDR API's workflow doesn't watch `projects/lif_mdr_api/`**, so
it needs a manual `workflow_dispatch` after merge.
- The Control Plane has no push trigger and isn't deployed.

##### Related Issues

Closes #1480

##### Type of Change

- [x] Bug fix (non-breaking change which fixes an issue)
- [x] Infrastructure/deployment change

##### Project Area(s) Affected

- [x] projects/
- [x] orchestrators/

---

##### Checklist

- [x] commit message follows commit guidelines (see
commitlint.config.mjs)
- [ ] tests are included (unit and/or integration tests): no code
changes; verified by building images (see Testing)
- [x] pre-commit hooks have been run successfully
- [x] CHANGELOG.md entry added (Security)

##### Testing

- [x] Manual testing performed

- **Bundle contents**, checked by reading `cacert.pem` in each `certifi`
wheel from PyPI:
  - 2025.10.5 has 4 emSign roots;
  - 2026.10.19 has 3;
  - 2026.10.23 has 1, G1.
- **The real MDR image** (`build.sh`, then `docker build`, on this
branch):
  - `/etc/ssl/certs` keeps only `emSign_Root_CA_-_G1.pem`;
- `ssl.create_default_context()` loads 146 CAs, of which G1 is the only
emSign root;
  - `certifi` is 2026.10.23, with G1 as its only emSign root.
- **HTTPS still works** from that image, through both paths:
`requests.get('https://pypi.org/...')` returns 200, and `urllib` with
the default context to `https://aws.amazon.com` returns 200.
- **Plain `python:3.13-slim`** for comparison: 3 emSign files, 148
certificates.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
@dereck-symmetry

Copy link
Copy Markdown
Contributor Author

@bjagg, I merged main (#1510) into this, and CI is green at b6fbb31. The merge was clean. dagster_oss_ecs/Dockerfile.dagster now has both #1510's update-ca-certificates --fresh step and the 1.13.26 / sqlalchemy<2.1 pins. It's ready to merge whenever you want dev's Dagster redeployed.

@bjagg
bjagg merged commit 6058d3d into main Nov 12, 2026
4 checks passed
@bjagg
bjagg deleted the issue-1490-pin-dagster branch November 12, 2026 08:56
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Current Community Efforts Nov 12, 2026
dereck-symmetry pushed a commit that referenced this pull request Nov 13, 2026
…verlay conversion

#1504 pinned the Dagster images (#1490, #1491), so chapter 1's manual
workaround is replaced by "rebuild images older than 11-12". #1388 is
done and applied on dev, but the local seed keeps 17 and 18 as overlays
until #1511, so chapters 3 and 7 now describe both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bjagg added a commit that referenced this pull request Nov 13, 2026
…er's schema (#1515)

##### Description of Change

Every orchestrator job submission on dev fails:

```
TypeError: deprecated locations must be specified as a collection of DirectiveLocation enum values.
dagster_graphql.client.utils.DagsterGraphQLClientError: Exception occured during execution of query ... repositoriesOrError ...
```

The Query Planner then returns 503, and the MDR Export Playground shows
"Unable to retrieve learner data from Query Planner".

**Cause:** the Dagster webserver now runs 1.13.26 (#1504). The
orchestrator's `dagster-graphql` client builds a client schema from the
webserver's introspection, using graphql-core 3.2.6, and that
graphql-core can't build the newer schema. I reproduced this locally: I
took the introspection result from `dagster-graphql==1.13.26`'s schema
and ran `build_client_schema` on it. graphql-core 3.2.6 and 3.2.7 fail
with the same `TypeError`, and 3.2.14 succeeds.

**Fix:** `projects/lif_orchestrator_api/pyproject.toml` gets a
`graphql-core>=3.2.14,<3.3` floor. gql 3.5.1–3.5.3 cap graphql-core
below 3.2.7, and `dagster-graphql` 1.11.4 needs gql < 4, so the lock
resolves:
- graphql-core: 3.2.6 → 3.2.14
- gql: 3.5.3 → 3.5.0, the last 3.x that allows graphql-core < 3.3
- `dagster` and `dagster-graphql`: unchanged at 1.11.4

**Limitations:**
- The lock was regenerated with uv 0.13.4, which also bumps the lockfile
`revision` from 2 to 5.
- Demo isn't affected by this PR.

##### Related Issues

Refs #1504

##### Type of Change

- [x] Bug fix (non-breaking change which fixes an issue)

##### Project Area(s) Affected

- [x] projects/

---

##### Checklist

- [x] commit message follows commit guidelines (see
commitlint.config.mjs)
- [x] code passes linting checks (`uv run ruff check`)
- [x] code passes formatting checks (`uv run ruff format`)
- [x] code passes type checking (`uv run ty check`)
- [x] pre-commit hooks have been run successfully

##### Testing

- Reproduced the failure and verified the fix locally: graphql-core
3.2.14 with gql 3.5.0 and dagster-graphql 1.11.4 builds the 1.13.26
schema, and `DagsterGraphQLClient` imports cleanly.
- `uv run pytest test/ -k orchestrator` passes 51 tests.
- `uv lock --check` passes in `projects/lif_orchestrator_api`.
- After the merge deploys the orchestrator to dev, the check is the MDR
Playwright happy path (`e2e`, `@happy-path`) against `mdr.dev`.

There's no unit test, because the failure needs a live Dagster
webserver.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
bjagg pushed a commit that referenced this pull request Nov 14, 2026
##### Description of Change

**Needs buy-in from the other teams before it merges.** The handbook
describes how every team works. Please comment on anything that doesn't
match how your team works or what you'd tell a new developer.

**What problem does this solve?** A developer starting on LIF has
catalogs of docs (`docs/INDEX.md`, the brick READMEs) but no reading
path through them: nothing explains how the services fit together end to
end, how to run them locally, or how to make the common kinds of change.

**What is the solution?** `docs/developer-handbook/`, a guided reading
path for a developer who knows Python and web APIs but is new to LIF,
Polylith, the MDR and Dagster, and has no AWS access. This PR adds the
backend half (chapters 0–10). The frontend half is the stacked follow-up
PR.

| Chapter | Covers |
|---|---|
| 0. Start here | What LIF is, reading order, glossary; LIF doesn't
require AWS |
| 1. Your development environment | Tools, checks, the tests that skip
without PostgreSQL, the local stack, resetting data, integration tests |
| 2. The codebase map | Polylith layout, bricks, bases and projects,
blast radius of shared components |
| 3. The data model and the MDR | Models, overlays (being retired),
mappings and activation, tenants, migrations |
| 4. Follow the data | One GraphQL query traced through planner, cache,
orchestrator, Dagster and Translator |
| 5. Cross-cutting concerns | Auth, configuration, schema loading,
timeouts, PII in logs, errors |
| 6. How we work | Branches, commits, PRs, required checks, ADRs, docs
layers |
| 7. Recipes | Add a field, a mapping, a data source, a service, a
brick, a migration; change the MDR seed |
| 8. Debugging and traps | Where to look first, a symptom table, traps
we keep relearning |
| 9. Environments and deployment | dev and demo, what a merge deploys,
who to ask |
| 10. Extending LIF | Which services run without the full system, and
where a new feature plugs in |

Outside the handbook:

- **`docs/README.md`**: `docs/README.md` asks that a new top-level
folder be justified. The handbook isn't a new layer of content: it's a
reading path *over* the existing layers, with the rule "connect, don't
duplicate". It links into overview, specs, design and operations for the
detail. This PR adds that rule, the folder to the layout, and an item to
the decision tree.
- **`docs/INDEX.md`**: one line per chapter.
- **`ARCHITECTURE.md`, `CONTRIBUTING.md`, `CLAUDE.md`**: one line each
pointing at the handbook (`CLAUDE.md` stays under 200 lines).
- **`cspell.json`**: 10 words the chapters use.

**How it was checked.** Every chapter was checked against main `2967cb9`
and, where it describes behaviour, against the running local stack (each
chapter says so at the top). Readers new to the repo tried several
recipes using only the handbook, and what they tripped on was fixed.
Problems found in the code along the way were filed separately: #1490,
#1491, #1492.

**Side effects or limitations.** Docs only. Some content is time-bound
and says so: chapter 1's integration failures (#1492), and chapter 3's
overlay section, which says the local seed keeps models 17 and 18 as
overlays until #1511. Updated 11-13 after #1504 (the Dagster pins, so
chapter 1's manual workaround is gone) and #1388 (overlays converted on
dev). The handbook README says to update a chapter in the same PR that
changes what it describes.

**How should reviewers test this?** Read it as a newcomer would:
[`docs/developer-handbook/README.md`](https://github.com/LIF-Initiative/lif-core/blob/issue-1493-developer-handbook-backend/docs/developer-handbook/README.md),
then chapter 0. Chapter 4 is the core; chapters 6 (how we work) and 9
(environments) are where team conventions are most likely to need
correcting. Every command in chapters 1, 4, 7 and 10 can be run on the
local stack.

##### Related Issues

Refs #1493 (the frontend PR closes it)
Refs #1388, #1490, #1491, #1492

##### Type of Change

- [x] Documentation update

##### Project Area(s) Affected

- [x] Documentation (docs/, READMEs, ARCHITECTURE.md, CLAUDE.md)

---

##### Checklist

- [x] commit message follows commit guidelines (see
commitlint.config.mjs)
- [x] documentation is changed or added (in /docs directory)
- [x] code passes type checking (`uv run ty check`)
- [x] pre-commit hooks have been run successfully

##### Testing

- [x] Manual testing performed: every relative link resolves (320
checked); cspell passes; `ty check` and `pytest test/` pass on the
branch (no Python changed); the commands in the chapters were run on the
local stack against main `2967cb9`.

##### Additional Notes

- Merge order: this PR first, then the frontend PR stacked on it. No
other open PR touches the shared files (`docs/README.md`,
`docs/INDEX.md`, `cspell.json`, `ARCHITECTURE.md`, `CONTRIBUTING.md`,
`CLAUDE.md`).
- Before merging, re-check the dated numbers (test counts, lint
warnings, latest migration) and the "Checked against" commit if main has
moved a lot.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: dereck <dereck.haskins@gmail.com>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

2 participants