-
Notifications
You must be signed in to change notification settings - Fork 443
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use placeholder runs to show pipeline runs in the dashboard without delay #2048
Conversation
@fa9r Very early/rough draft of an idea I had to show pipeline runs in the dashboard immediately. Let me know if you see any immediate concerns with this, especially when it comes to concurrency. The |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fundamentally I don't see a reason why this shouldn't work, but let me summarize to check whether I understand it right:
- If we run a pipeline with a schedule, we'll do the same as before: create a schedule in DB, hand over to orchestrator, create run when the orchestrator starts the first step and link it to the schedule, link other steps to same run by searching for runs by orchestrator ID
- If we run a pipeline without schedule, we directly write a run to the DB with empty orchestrator ID, hand over to orchestrator, set orchestrator ID when the orchestrator starts the first step, link other steps to same run by searching for similar orchestrator ID
Logically this makes sense to me and I think it should work 👍
The only possible failure case I can see is if we try to create a placeholder run for a deployment that already has a placeholder run. But I'm not sure whether that scenario can be reached or not, @schustmi you should know this best 😁
a7aed3b
to
b09053a
Compare
dfe971e
to
e4eda80
Compare
E2E template updates in |
Important Auto Review SkippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the To trigger a single review, invoke the Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChat with CodeRabbit Bot (
|
Describe changes
This PR allows us to create a
PipelineRun
in the database before actually executing the pipeline using the orchestrator.With this in place, we can now return a reference to this pipeline run when someone is running a pipeline, and can also show the pipeline run in the dashboard immediately.
Notes regarding the migration
This PR adds a unique constraint for the combination of the
deployment_id
andorchestrator_run_id
of thepipeline_run
table. These columns were introduced (and have been set to non-null values since)0.21.0
for theorchestrator_run_id
0.34.0
for thedeployment_id
For this unique constraint to work, we have to consider these scenarios:
0.21.0
: For these both columns areNULL
. We solve this by writing some unique dummy value in theorchestrator_run_id
column.0.21.0
and0.34.0
: In this case only theorchestrator_run_id
is set. This is only a problem if we assume people run with custom orchestrators that do not generate a globally uniqueorchestrator_run_id
.0.34.0
: For these bothdeployment_id
andorchestrator_run_id
are set and the combination of the two is unique, otherwise it would have failed earlier when trying to run those pipelines.What the migration currently does not account for:
orchestrator_run_id
column.deployments
in their database, which sets thedeployment_id
column toNone
. Similar to above, this is only a problem if we assume people run with custom orchestrators that do not generate a globally uniqueorchestrator_run_id
.TODO
initializing
state of a pipeline run in the dashboard.Make sure the dashboard can handle an emptyorchestrator_environment
in aPipelineRun
response. It is optional on the model but might not be handled correctly in the dashboard.Pre-requisites
Please ensure you have done the following:
develop
and the open PR is targetingdevelop
. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes