Fix spot instance detection for AWS Batch cost estimation#6722
Merged
bentsherman merged 2 commits intomasterfrom Jan 14, 2026
Merged
Fix spot instance detection for AWS Batch cost estimation#6722bentsherman merged 2 commits intomasterfrom
bentsherman merged 2 commits intomasterfrom
Conversation
The getPrice() method compared instanceLifecycle() enum to a string, which always returned false due to type mismatch in @CompileStatic. This caused all spot instances to be incorrectly reported as standard, inflating cost estimates in Seqera Platform. Changed to proper enum comparison: instanceLifecycle() == InstanceLifecycleType.SPOT Added unit test to prevent regression. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com> Signed-off-by: Rob Syme <rob.syme@gmail.com>
✅ Deploy Preview for nextflow-docs-staging ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Member
|
@pditommaso you think this is worth backporting? |
Member
|
Yes, definitively |
bentsherman
pushed a commit
that referenced
this pull request
Jan 14, 2026
Collaborator
Author
|
I did not know that Thanks team. |
Member
|
I'm surprised as well, I would expect Groovy to catch the type mismatch. But the Groovy type checker isn't perfect, it has some small holes |
pditommaso
pushed a commit
that referenced
this pull request
Jan 16, 2026
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
Fix incorrect priceModel detection for AWS Batch tasks where spot instances were always reported as
standard, causing inflated cost estimates in Seqera Platform.Problem
The
getPrice()method inAwsBatchHelpercompared theinstanceLifecycle()enum directly to a string:With
@CompileStatic, this enum-to-string comparison always returns false, so all instances defaulted to PriceModel.standard.Solution
Replace the string comparison with direct enum comparison:
Test
Added AwsBatchHelperTest covering spot, scheduled, and on-demand (null) cases.