Skip to content

feat(emr): support per-action arguments in bootstraps_paths (#3191)#3313

Draft
MukundaKatta wants to merge 1 commit into
aws:mainfrom
MukundaKatta:feat/emr-bootstrap-arguments
Draft

feat(emr): support per-action arguments in bootstraps_paths (#3191)#3313
MukundaKatta wants to merge 1 commit into
aws:mainfrom
MukundaKatta:feat/emr-bootstrap-arguments

Conversation

@MukundaKatta
Copy link
Copy Markdown

Summary

Closes #3191. Extends EMR.create_cluster's bootstraps_paths to support per-action arguments and a custom name, while preserving the existing string-list shape for backwards compatibility.

API

  • Existing: bootstraps_paths=["s3://bucket/init.sh"]
  • New: bootstraps_paths=[{"path": "s3://bucket/init.sh", "args": ["--flag", "x"], "name": "init"}]
  • Both forms can be mixed in the same list.

Files

  • awswrangler/emr.py — added _build_bootstrap_actions() helper; rewrote the BootstrapActions build site to use it; widened the bootstraps_paths annotation; expanded the docstring with both forms.
  • tests/unit/test_emr.py — 7 unit tests for the helper (paths-only, dicts with args, mixed, capitalized boto3 keys, invalid type, missing path, invalid args type) plus 1 end-to-end moto test that creates a cluster and asserts BootstrapActions arrive at run_job_flow with Args populated.

Test plan

  • 12/12 tests pass (pytest tests/unit/test_emr.py -k "bootstrap or run_job_flow or get_emr").
  • ruff check and ruff format clean.
  • Backwards compatible: existing string-list usage unchanged.

Closes aws#3191.

`create_cluster` previously accepted only a list of script paths and dropped
EMR's `Args` field on the floor. Extend `bootstraps_paths` to also accept
dict entries shaped like the boto3 `ScriptBootstrapAction` (path, args, name)
and convert them internally. Plain string paths keep working unchanged.

Adds unit tests covering the helper directly plus an end-to-end moto run
that asserts `BootstrapActions` reach `run_job_flow` with `Args` intact.
@kukushking
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: GitHubDistributedCodeBuild6-jWcl5DLmvupS
  • Commit ID: c8afbb8
  • Result: FAILED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

@kukushking
Copy link
Copy Markdown
Collaborator

AWS CodeBuild CI Report

  • CodeBuild project: GitHubCodeBuild8756EF16-4rfo0GHQ0u9a
  • Commit ID: c8afbb8
  • Result: SUCCEEDED
  • Build Logs (available for 30 days)

Powered by github-codebuild-logs, available on the AWS Serverless Application Repository

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.

EMR create_cluster support pass bootstrap arguments

2 participants