Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

feat(ci): dispatch the dagster ml image digest to charts (#117172)

posthog[bot]e33526a14653
diff --git a/.github/workflows/container-images-cd.yml b/.github/workflows/container-images-cd.yml
index a87c03e6d877..1f89e0ddc64e 100644
--- a/.github/workflows/container-images-cd.yml
+++ b/.github/workflows/container-images-cd.yml
@@ -1455,8 +1455,8 @@ jobs:
# Main image plus the inbox-ranking dependency group, for the inbox ranking training code
# location. Nothing depends on this job, and continue-on-error keeps the run green, so a
# failure here never blocks the main image publish or its deploy dispatches.
- # The `ml-image-digest` output is the digest of posthog-dagster-ml:<sha>. A code location
- # dispatch that runs this image reads it as needs.dagster_ml_build.outputs.ml-image-digest.
+ # The `ml-image-digest` output is the digest of posthog-dagster-ml:<sha>. The job dispatches
+ # that digest to PostHog/charts, which reloads the ML code location in Dagster+.
dagster_ml_build:
name: Build and push Dagster ML image
needs: posthog_build
@@ -1544,6 +1544,49 @@ jobs:
echo "digest=$DIGEST" >> "$GITHUB_OUTPUT"
echo "ML image digest: $DIGEST" >> "$GITHUB_STEP_SUMMARY"
+ - name: Get deployer token
+ id: deployer
+ if: steps.image.outputs.digest != ''
+ continue-on-error: true
+ uses: actions/create-github-app-token@1b10c78c7865c340bc4f6099eb2f838309f1e8c3 # v3.1.1
+ with:
+ client-id: ${{ secrets.GH_APP_CHARTS_DEPLOYER_APP_ID }}
+ private-key: ${{ secrets.GH_APP_CHARTS_DEPLOYER_PRIVATE_KEY }}
+ owner: PostHog
+ repositories: charts
+
+ - name: get PR labels
+ id: labels
+ if: steps.deployer.outputs.token != ''
+ continue-on-error: true
+ uses: ./.github/actions/get-pr-labels
+ with:
+ token: ${{ secrets.GITHUB_TOKEN }}
+
+ # Moves the ML code location in Dagster+ to this image. The payload carries the
+ # digest, never a tag, so the location runs exactly the image this job built.
+ - name: Trigger Dagster ML Code Location Reload
+ if: steps.deployer.outputs.token != ''
+ continue-on-error: true
+ uses: peter-evans/repository-dispatch@28959ce8df70de7be546dd1250a005dd32156697 # v4.0.1
+ with:
+ token: ${{ steps.deployer.outputs.token }}
+ repository: PostHog/charts
+ event-type: restart_dagster_ml_code_location
+ client-payload: |
+ {
+ "values": {
+ "image": {
+ "sha": "${{ steps.image.outputs.digest }}"
+ }
+ },
+ "release": "dagster-ml-code-location",
+ "commit": ${{ toJson(github.event.head_commit) }},
+ "repository": ${{ toJson(github.repository) }},
+ "labels": ${{ toJson(steps.labels.outputs.labels || '[]') }},
+ "timestamp": "${{ github.event.head_commit.timestamp }}"
+ }
+
- name: Warn when the ML image failed
if: failure()
run: echo "::warning title=Dagster ML image not published::The Dagster ML image build failed. The main image publish and deploys are not affected."
diff --git a/products/signals/dags/inbox_ranking/README.md b/products/signals/dags/inbox_ranking/README.md
index 9ccfade08d9c..1fdf88f05b88 100644
--- a/products/signals/dags/inbox_ranking/README.md
+++ b/products/signals/dags/inbox_ranking/README.md
@@ -339,7 +339,7 @@ Nothing here touches the prod bucket: the reader credential is read-only and the
`multihead/` is an offline experiment and not a dag. It tests whether one shared network over the report vector, with or without the team's project vectors, beats the per-head XGBoost champion recipe of the `report_embeddings` family. It reads the disk cache the sync script fills, so sync with `INBOX_RANKING_SYNC_EMBEDDINGS=1` first. The dev stack does not need to be up.
-The network is PyTorch. torch is not a main dependency: it comes from the `inbox-ranking` dependency group, with the CPU-only wheels, together with `onnx` and `onnxruntime`. The group conflicts with the `sentiment` group, which takes the CUDA build of torch, so install one or the other. Only `Dockerfile.dagster-ml`, the image of the `signals_ml` code location, installs the group.
+The network is PyTorch. torch is not a main dependency: it comes from the `inbox-ranking` dependency group, with the CPU-only wheels, together with `onnx` and `onnxruntime`. The group conflicts with the `sentiment` group, which takes the CUDA build of torch, so install one or the other. Only `Dockerfile.dagster-ml`, the image of the `signals_ml` code location, installs the group. Each master push publishes that image, and `container-images-cd.yml` sends its digest to PostHog/charts with the `restart_dagster_ml_code_location` dispatch. A failed build or dispatch does not block CD.
```bash
uv sync --group inbox-ranking