-
Notifications
You must be signed in to change notification settings - Fork 0
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
Bacpop 201 stream microreact #83
Conversation
This commit refactors the code in the MicroReactColumn.vue component and the projectStatus.ts utility file. It updates the condition for checking the microreact cluster status in the hasMicroreactClusterFailed function. Instead of using the microreactClusterStatuses object, it now uses the status object and the microreactClusters property. This change ensures that the correct status is checked when determining if the microreact cluster has failed.
…tils - Updated the microreact cluster status check in ProjectPostRun.vue to include the isAnyMicroreactFinished function from projectStatus.ts. - Added the isAnyMicroreactFinished function to projectStatus.ts to check if any microreact clusters have finished.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #83 +/- ##
==========================================
+ Coverage 98.78% 98.83% +0.05%
==========================================
Files 34 34
Lines 1971 2060 +89
Branches 247 270 +23
==========================================
+ Hits 1947 2036 +89
Misses 24 24 ☔ View full report in Codecov by Sentry. 🚨 Try these New Features:
|
… cluster status management
…lity for improved cluster status management
…mproved readability
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.
Looks great!
I can run this with the newer sample strep samples you sent over a while ago, but failing with the old fasta examples. Is that expected?
@@ -13,7 +13,7 @@ test("can run project and view results", async ({ page }) => { | |||
await page.getByLabel("Run Analysis").click(); | |||
|
|||
await expect(page.getByText("Running Analysis...33%")).toBeVisible(); | |||
await expect(page.getByText("Running Analysis...67%")).toBeVisible(); | |||
await expect(page.getByText("Running Analysis...75%")).toBeVisible(); |
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.
This seems a bit fishy, why does it go from 33% to 75%. This suggests it goes from thinking it's done 1 out of 3 jobs to thinking it's done 3 out of 4... Does it think there are 4 jobs rather than 3 once the initial cluster allocation has happened, because the microreactClusters key is added to the results?
(Yes, when I run it manually, and it's done the cluster assignment and network but no microreact results yet, it goes from 33% to 50%.)
I think the progress bar should include the progress of the individual microreact jobs but ignoring the top level task as separate entity e.g. if it's done assign clusters (33%) plus 1 out of 3 microreactClusters (0.33 * 33%) then it could show 44%...
numOfStatus(): number { | ||
return ( | ||
analysisStatusValues.length > 0 && analysisStatusValues.every((value) => COMPLETE_STATUS_TYPES.includes(value)) | ||
Object.keys(this.separatedStatuses.fullStatuses).length + | ||
Object.keys(this.separatedStatuses.microreactClusters).length | ||
); | ||
}, |
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.
Would this be a little cleaner?
return statusValues.length;
analysisProgressPercentage(): number { | ||
return this.statusValues.length > 0 | ||
? Math.round( | ||
(this.statusValues.filter((value) => COMPLETE_STATUS_TYPES.includes(value)).length / this.numOfStatus) * 100 | ||
) | ||
: 0; | ||
}, |
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.
Yeah, I think the reason the progress values look a little weird is because microreact is being counted twice, once with its value in "fullStatuses" but also via all the individual cluster values. I think it's confusing to include the former when it's not really a separate task from completing microreact for each cluster.
status: AnalysisStatus | undefined, | ||
cluster: string | undefined | ||
): boolean => { | ||
// occurs when another sample has passed but this one fails |
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.
Do you mean when it's failed to assign a cluster, hence it being falsy?
// occurs when another sample has passed but this one fails | |
// occurs when this sample could not be assigned to a cluster but at least one other sample was assigned |
Should we show the microreact job as "failed" in that case? It's more like we couldn't run it because a prerequisite failed. How about "cancelled"?
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.
yup cancelled does make sense here.. ive made ticket as this will need a bit more changes https://mrc-ide.myjetbrains.com/youtrack/issue/bacpop-204/When-assign-fails-change-network-microreact-to-cancelled-not-failed
return status?.microreact || "waiting"; | ||
}; | ||
|
||
export const isAnyMicroreactQueued = (microreactClusterStatuses: Record<string, StatusTypes> | undefined): boolean => { |
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.
Slightly misleading method name, since these could all be completed jobs, not currently queued.
export const isAnyMicroreactQueued = (microreactClusterStatuses: Record<string, StatusTypes> | undefined): boolean => { | |
export const haveAnyMicroreactBeenQueued = (microreactClusterStatuses: Record<string, StatusTypes> | undefined): boolean => { |
Something like that?
OK, this now seems to be running fine for me with the original fasta files. Maybe I just made a project with the wrong species before! |
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.
Nice!
This PR allows streaming of microreact jobs per cluster as they come in... The main changes are as below:
Testing:
Best to test by running app with samples and seeing that microreact become available as they are finished...