Skip to content

Add Amazon S3Files support for Gen3Workflow - #170

Merged
nss10 merged 32 commits into
masterfrom
feat/s3Files
Jul 30, 2026
Merged

Add Amazon S3Files support for Gen3Workflow#170
nss10 merged 32 commits into
masterfrom
feat/s3Files

Conversation

@nss10

@nss10 nss10 commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Link to JIRA ticket if there is one: MIDRC-1314

New Features

  • Gen3Workflow now supports creation of AWS resources related to Amazon S3Files and shares a file system id as a part of /storage/setup response.

Breaking Changes

Bug Fixes

Improvements

Dependency updates

Deployment changes

@github-actions

Copy link
Copy Markdown

The style in this PR agrees with black. ✔️

This formatting comment was generated automatically by a script in uc-cdis/wool.

@coveralls

coveralls commented Jul 23, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 30515455027

Coverage increased (+1.6%) to 84.375%

Details

  • Coverage increased (+1.6%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 54 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

54 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
routes/s3.py 29 77.34%
routes/storage.py 12 80.0%
routes/ga4gh_tes.py 9 87.5%
config.py 4 80.0%

Coverage Stats

Coverage Status
Relevant Lines: 1152
Covered Lines: 972
Line Coverage: 84.38%
Coverage Strength: 0.84 hits per line

💛 - Coveralls

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath error skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 3 1 29
TOTAL 25 3 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 3 3
TOTAL 3 3

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests

Failed to Prepare CI environment

Please find the Github Action logs here

Comment thread gen3workflow/aws/bucket.py Outdated
Comment thread gen3workflow/aws/bucket.py Outdated
Comment thread gen3workflow/aws/bucket.py Outdated
s3_client.put_bucket_lifecycle_configuration(
clients.s3_client.put_bucket_lifecycle_configuration(
Bucket=user_bucket_name,
LifecycleConfiguration={

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

might be worth looking into NoncurrentVersionTransition/NoncurrentVersionExpiration to remove versions earlier than the default LifecycleConfiguration expiration

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thank you, it was nice to know this param exists. I've arbitrarily set it to 3 days. I don't think we really need to preserve older versions of objects any longer. It can be a simple hardcoded constant value of 3. Let me know if you think it would be better if it is a configured value? Or maybe a fraction of configured expiration days -- like (1/3 * expiration_days)

@paulineribeyre paulineribeyre Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Hardcoded is fine, it's not very important. I might even have set it to 0 or 1 haha

Comment thread gen3workflow/routes/storage.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment on lines +234 to +238
# TODO: Determine if these need to be configurable.
eks_sg_names = [
f"{config["EKS_CLUSTER_NAME"]}_EKS_workers_sg",
f"{config["EKS_CLUSTER_NAME"]}_EKS_nodepool_jupyter_sg",
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

this does seem too hardcoded, specifically the reference to jupyter - where do these come from?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

These SG names are derived from Terraform — see here cloud.tf#L195 and here cloud.tf#L469.
I'm still torn on whether this security group logic should live in gen3-workflow or in gen3-terraform — would appreciate your thoughts.

  1. These security groups only need to be created once per EKS cluster, and today they're created the first time a user in that cluster triggers a create-filesystem call. That one-time, idempotent nature makes moving this to an IaC tool (gen3-terraform) feel like the right home.
  2. That said, this logic is only relevant to gen3-workflow, and it doesn't feel right to bake application-specific logic into a generic tool.

Coming to the SG names, they depend on which SGs get assigned to nodes, that are used for the tasks based on the ENABLE_OPTIMIZED_NODE_SCHEDULING config flag.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry for the maybe naive questions:

Does terraform support conditional setup? Only set this up if gen3-workflow is enabled, or if gen3-workflow.s3files is enabled?

Do we need both config["EKS_CLUSTER_NAME"]}_EKS_workers_sg and {config["EKS_CLUSTER_NAME"]}_EKS_nodepool_jupyter_sg? Why would we need to use the jupyter security group?

If we need both I think leaving it here is ok too but it'd be nice to get these values programmatically if that's possible 🤔

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Not naive at all.

Does terraform support conditional setup? Only set this up if gen3-workflow is enabled, or if gen3-workflow.s3files is enabled?

I'm not very sure. I don't think terraform looks into helm values in any way while building, so I don't think it is feasible to use gen3-workflow.enabled

Do we need both config["EKS_CLUSTER_NAME"]}_EKS_workers_sg and {config["EKS_CLUSTER_NAME"]}_EKS_nodepool_jupyter_sg?

Yes, we needed both of these (for devplanetv2 -- at least).
These values were pulled using the following steps,
1. Manually get the nodes where the pods could be deployed -- we use role=workflow & role=gpu
2. Identify what security groups are assigned to these nodes karpenter-config-resources-workflow.yaml#L38-L44 & karpenter-config-resources-gpu.yaml#L29C2-L36C81
3.Manually narrow down the main security group that has all the inbound and outbound rules and add the names of those groups here.

Why would we need to use the jupyter security group?

Jupyter security group is assigned to the nodes which have role=workflow in devplanetv2 devplanetv2/cluster-values/cluster-values.yaml#L107-L114

it'd be nice to get these values programmatically if that's possible

Getting these values programmatically might be difficult. Contrarily, we could make a convention, saying nodes allocated with role=workflow to be assigned with certain security group naming format.

I think the best idea (for now!) would be to make these configurable, and add instructions in deployment documentation on how to fetch them.

I was a bit skeptical while building these, because I wasn't sure what values do these security groups get when we develop user specific nodes.

TBH, I was not ready to make these hardcoded, just wanted to get another dev's opinion on whether to keep these in gen3-workflow at all, before implementing them.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Gotcha, using those nodes is temporary anyway, since the long-term plan is to create a nodepool per user for cost tracking. At that point the nodepools will likely be created by gen3-workflow and the security groups too, so we may be able to untangle this then. In the meantime configuring it manually sounds OK... Let's document it

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Done.

Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 13 12 4 29
TOTAL 13 12 4 29

Test summary after rerunning failed integration tests

filepath failed SUBTOTAL
tests/test_gen3_workflow.py 12 12
TOTAL 12 12

Comment thread tests/test_s3_files.py Outdated
@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment thread tests/test_s3_files.py Outdated
Comment thread gen3workflow/aws/s3_files.py Outdated
Comment on lines +234 to +238
# TODO: Determine if these need to be configurable.
eks_sg_names = [
f"{config["EKS_CLUSTER_NAME"]}_EKS_workers_sg",
f"{config["EKS_CLUSTER_NAME"]}_EKS_nodepool_jupyter_sg",
]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Sorry for the maybe naive questions:

Does terraform support conditional setup? Only set this up if gen3-workflow is enabled, or if gen3-workflow.s3files is enabled?

Do we need both config["EKS_CLUSTER_NAME"]}_EKS_workers_sg and {config["EKS_CLUSTER_NAME"]}_EKS_nodepool_jupyter_sg? Why would we need to use the jupyter security group?

If we need both I think leaving it here is ok too but it'd be nice to get these values programmatically if that's possible 🤔

@github-actions

Copy link
Copy Markdown

Integration Tests

Failed to Prepare CI environment

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Failed to Prepare CI environment

Please find the Github Action logs here

@nss10
nss10 marked this pull request as ready for review July 30, 2026 03:02
@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

Test summary after running integration tests

filepath passed failed skipped SUBTOTAL
tests/test_gen3_workflow.py 27 1 1 29
TOTAL 27 1 1 29

Test summary after rerunning failed integration tests

filepath passed SUBTOTAL
tests/test_gen3_workflow.py 1 1
TOTAL 1 1

Please find the detailed integration test report here

Please find the detailed integration test report after rerunning failed tests here

Please find the Github Action logs here

Comment on lines +256 to +258
eks_sg_names = config.get("EKS_SECURITY_GROUP_NAMES")
if not eks_sg_names:
eks_sg_names = [f"{config["EKS_CLUSTER_NAME"]}_EKS_workers_sg"]

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

instead of setting a default here, we could add a validation step in the config validation: "if s3files is enabled, len(EKS_SECURITY_GROUP_NAMES) must be >= 1".

not a big deal. i'm just not sure the default will always make sense

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I like this idea. But I would like to get it done in a different PR.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I added that to #174

@nss10 nss10 changed the title Feat/s3Files Add Amazon S3Files support for Gen3Workflow Jul 30, 2026
@github-actions

Copy link
Copy Markdown

Integration Tests on Kind

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 25 4 29
TOTAL 25 4 29

@github-actions

Copy link
Copy Markdown

Integration Tests

filepath passed skipped SUBTOTAL
tests/test_gen3_workflow.py 28 1 29
TOTAL 28 1 29

Please find the detailed integration test report here

Please find the Github Action logs here

@nss10
nss10 merged commit d0eb9db into master Jul 30, 2026
12 of 13 checks passed
@paulineribeyre
paulineribeyre deleted the feat/s3Files branch July 30, 2026 18:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants