feat(use-cases): add GPU music production agent sample - #1982
Conversation
Three collaborating agents produce and vet a music track inside one AgentCore Runtime Instances session on a single GPU instance. - composition (container, GPU): a Bedrock model writes the brief, then ACE-Step v1 3.5B renders real audio on the instance's NVIDIA L4 - mastering (container, CPU): measures the mix, a model picks an EQ/compressor/limiter chain from those numbers, DSP applies it, the output is measured again - compliance (zip on S3, CPU): re-measures independently, screens against a generated back-catalogue with chroma features and subsequence DTW over all 12 transpositions, and computes the verdict rather than asking a model for it Demonstrates capacity providers with a GPU instance type, local model inference on a persistent EBS volume, collocation of three runtimes via a shared runtimeSessionId, mixed container and zip artifacts on one capacity provider, and an agent invoking another agent's runtime for remediation. Verified end to end on a live g6.xlarge in us-east-2.
|
Latest scan for commit: Security Scan ResultsScan Metadata
SummaryScanner ResultsThe table below shows findings by scanner, with status based on severity thresholds and dependencies: Column Explanations: Severity Levels (S/C/H/M/L/I):
Other Columns:
Scanner Results:
Severity Thresholds (Thresh Column):
Threshold Source: Values in parentheses indicate where the threshold is configured:
Statistics calculation:
Detailed FindingsShow 8 actionable findingsFinding 1: B104
Description: Code Snippet: Finding 2: B104
Description: Code Snippet: Finding 3: B104
Description: Code Snippet: Finding 4: B310
Description: Code Snippet: Finding 5: B202
Description: Code Snippet: Finding 6: B310
Description: Code Snippet: Finding 7: CKV_DOCKER_3
Description: Code Snippet: Finding 8: CKV_DOCKER_3
Description: Code Snippet: Report generated by Automated Security Helper (ASH) at 2026-08-22T22:41:46+00:00 |
CI runs `ruff check` and `ruff format --check` on changed files. Fixes: - PLW1510: pass check=False explicitly to the five subprocess.run calls that inspect returncode themselves or deliberately tolerate failure - RUF046: drop redundant int() around round(); round() returns a Python int even for numpy floats, verified - EXE001: mark the four scripts/ entry points executable, they have shebangs - RUF100, I001, ISC004, F541: unused noqa, import order, implicit string concatenation in collections, f-string without placeholders - ruff format at the repo's line-length of 120 DSP output is byte-identical before and after: the same two rendered WAVs re-measure to the same loudness, true peak, LRA and chroma-DTW distance.
The README said deleting the session was "the only thing that stops EC2 and EBS billing". The AgentCore documentation says otherwise: deleting a capacity provider also "stops and deletes all of its associated sessions and their persistent storage". Session deletion is still the right first step, but because it is the fastest path -- the capacity provider route requires disassociating every runtime and runtime version first, and that detachment is asynchronous -- not because it is the only one. Reworded to "the fastest way".
Concise description of the PR
Three agents, one
runtimeSessionId, oneg6.xlarge:composition_agent.pymastering_agent.pycompliance_agent.pyWhat it demonstrates that no existing sample does:
03-mcp-,08-http-,09-a2a-ec2-capacity-provider) all default tom6g.large. This is the first GPU sample in the repo.mode=preparestep and invoked as a subprocess. That volume survives stop/resume.runtimeSessionId, so they land on one instance and pass real audio files through/mnt/tracks— no queue, no database, no orchestrator.passedis arithmetic on the measurements; the model only writes the explanation and is not shown the distances or thresholds at all.User experience
Before. Nothing in the repo runs a model on a GPU, and nothing shows more than one runtime sharing an instance. A builder asking "can I host my own model on AgentCore, and how do several agents hand large artifacts to each other?" has no worked example — the capacity-provider samples are single-agent and CPU-only.
After. Four commands produce audio you can play:
The run prints the evidence rather than asserting it:
You end with
composition.wav,master.wavand three markdown reports inruns/<track>/. The mastering report records what the model decided and what itdeliberately left alone — on the verified run it placed a highpass at 30 Hz to
remove a DC offset it had measured at 0.001171, and bypassed the compressor
entirely because the loudness range was only 0.8 LU.
Cost is explicit.
deploy.pycreates no instances; billing starts at the firstinvoke and stops when the session is deleted, not when a runtime is stopped.
cleanup.pydeletes the session first for exactly that reason.Testing
Deployed and run end to end on a live
g6.xlargeinus-east-2, then torn down andverified clean (0 instances, 0 orphaned volumes, no roles or buckets left). Confirmed
by measurement, not by the agents' own reports: the audio was re-measured locally and
matched (
-7.5 → -14.0 LUFS,+0.42 → -3.2 dBTP), and the raw render's 9 clippedruns at full scale became 0 in the master. The compliance zip came in at 82.0 MB
compressed / 235.0 MB uncompressed against the 250 MB / 750 MB limits.