Skip to content

Fix AWS Batch machine type trace for new instance families#6952

Open
FloWuenne wants to merge 1 commit intonextflow-io:masterfrom
FloWuenne:codex/aws-batch-machine-type-fix
Open

Fix AWS Batch machine type trace for new instance families#6952
FloWuenne wants to merge 1 commit intonextflow-io:masterfrom
FloWuenne:codex/aws-batch-machine-type-fix

Conversation

@FloWuenne
Copy link

Summary

This PR fixes AWS Batch trace machine type propagation for newer EC2 instance families whose names are not yet recognized by the pinned AWS SDK enum list.

Nextflow was resolving the machine type through instance.instanceType().toString(), which depends on the generated SDK enum. For newer families such as r8id.xlarge, m8id.xlarge, and c8id.xlarge, the current SDK maps the typed accessor to UNKNOWN_TO_SDK_VERSION instead of preserving the raw instance type string.

This change switches the AWS Batch helper to prefer instance.instanceTypeAsString() and only fall back to the enum value if needed. That makes the trace path resilient to newly released EC2 instance families and ensures the machine type value can be propagated correctly downstream.

Changes

  • use the raw EC2 instance type string in AwsBatchHelper
  • keep the existing enum-based value only as a fallback
  • add regression coverage for SDK-unknown instance types
  • add explicit tests showing the current pinned SDK maps r8id.xlarge, m8id.xlarge, and c8id.xlarge to UNKNOWN_TO_SDK_VERSION

Testing

  • ./gradlew :plugins:nf-amazon:test --tests 'nextflow.cloud.aws.batch.AwsBatchHelperTest'

Notes

  • No AWS SDK version bump is included in this PR. The code change is intentional so that Nextflow remains robust even when AWS releases instance families before they appear in a future SDK enum update.
  • This change was implemented with Codex GPT-5.4 assistance.

Signed-off-by: FloWuenne <flowuenne@gmail.com>
@netlify
Copy link

netlify bot commented Mar 20, 2026

Deploy Preview for nextflow-docs-staging canceled.

Name Link
🔨 Latest commit e849ccc
🔍 Latest deploy log https://app.netlify.com/projects/nextflow-docs-staging/deploys/69bda69404b890000824eba8

@pditommaso
Copy link
Member

I believe the proper solution is to update the aws sdk

@FloWuenne
Copy link
Author

@pditommaso From codex checking the AWS SDK, these instance types are not yet in the official enum from the newest version (might be wrong but double check).

@pditommaso
Copy link
Member

Screenshot 2026-03-20 at 21 31 42

@pditommaso
Copy link
Member

But I agree this prevent updating to latest sdk to have access to latest types.

}

protected String getInstanceType(Instance instance) {
instance.instanceTypeAsString() ?: instance.instanceType()?.toString()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May not make more sense ?

instance.instanceType()?.toString() ?: instance.instanceTypeAsString()

Copy link
Author

@FloWuenne FloWuenne Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so because instance.instanceType()?.toString() will be UNKNOWN_TO_SDK_VERSION, not null and therefore it's not invalidated and instance.instanceTypeAsString() would never run?

Not 100% sure here though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants