Use modal deploy + spawn to decouple pipeline from GitHub runner#635
Merged
juaristi22 merged 2 commits intomainfrom Mar 26, 2026
Merged
Use modal deploy + spawn to decouple pipeline from GitHub runner#635juaristi22 merged 2 commits intomainfrom
juaristi22 merged 2 commits intomainfrom
Conversation
f8bf5e5 to
3fe6df0
Compare
modal run --detach streams logs and dies when the runner timeout fires, killing the pipeline. Instead, deploy the app to Modal (making it persistent) and spawn run_pipeline as a fire-and-forget call. The GitHub Actions step finishes in under a minute while the pipeline runs for 10+ hours on Modal untethered. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3fe6df0 to
07a4e81
Compare
- local test took ~22mins to deploy, should be subsequently faster but want to have some headroom
juaristi22
reviewed
Mar 26, 2026
Collaborator
juaristi22
left a comment
There was a problem hiding this comment.
Tested the deploy + spawn approach locally and it works correctly:
modal deploy modal_app/pipeline.py— app registered successfully aspolicyengine-us-data-pipelinerun_pipeline.spawn(...)— returned immediately with a function call ID, pipeline running on Modal independently
Minor note: The deploy step took ~22 minutes locally (first-time image build). The workflow timeout-minutes is currently set to 10, which would kill the deploy before it reaches the spawn call — the same failure mode as the original issue. Should bump to 30 to handle worst-case deploy times (subsequent deploys will be faster due to Modal image caching, but first deploys or cache misses need headroom).
juaristi22
approved these changes
Mar 26, 2026
Collaborator
juaristi22
left a comment
There was a problem hiding this comment.
Fix looks correct — deploy + spawn approach works as expected. Tested locally end-to-end. Just needs the timeout bump to 30 minutes.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
modal run --detachstreams logs to the GitHub Actions runner and dies when the runner timeout fires, killing the Modal pipeline mid-run. The pipeline takes 10+ hours, well past GitHub's 6-hour max.Fix: Deploy the app to Modal (making it persistent), then
.spawn()therun_pipelinefunction as a fire-and-forget call. The GitHub Actions step finishes in under a minute while the pipeline runs on Modal untethered for as long as it needs (up to Modal's 24-hour function timeout).Fixes #636
Before
After
Test plan
🤖 Generated with Claude Code