Add hierarchical queue capacities#29
Conversation
Co-authored-by: Amp <amp@ampcode.com> Amp-Thread-ID: https://ampcode.com/threads/T-019dab31-090b-71fa-af7a-5758021a8176
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019dab8d-837a-734b-b664-fff3db0d0026 Co-authored-by: Amp <amp@ampcode.com>
|
@codex review |
|
@builderbot0 review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4000bbdd66
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
Amp-Thread-ID: https://ampcode.com/threads/T-019db067-51a9-77ec-a8cd-6b634c118925 Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019db067-51a9-77ec-a8cd-6b634c118925 Co-authored-by: Amp <amp@ampcode.com>
|
[AI:] Follow-up pushed in This narrows the fix to the blocker we discussed:
I also clarified the intended behavior in the docs:
Validation run locally:
|
Amp-Thread-ID: https://ampcode.com/threads/T-019db067-51a9-77ec-a8cd-6b634c118925 Co-authored-by: Amp <amp@ampcode.com>
|
|
||
| ```python | ||
| run_task("./gradlew connectedDebugAndroidTest", queue_name="gradle/emu-5557", env_vars="ANDROID_SERIAL=127.0.0.1:5557", ...) | ||
| run_task("./gradlew connectedDebugAndroidTest", queue_name="gradle/emu-5559", env_vars="ANDROID_SERIAL=127.0.0.1:5559", ...) |
There was a problem hiding this comment.
I'm not sure if it's just not a particularly illustrative example or an actual flaw, but this Gradle command also runs assemble, which is still undesirable to be run in parallel at the same time, right?
There was a problem hiding this comment.
[AI:] Good catch. The current queue-capacity model applies to the entire command lifetime, not to phases inside a single command, so if each leaf task is ./gradlew connectedDebugAndroidTest, any assemble work inside those invocations can still overlap.
I do not think that needs a code change in this PR; phase-aware scheduling would be a different model. I pushed 1622101, which updates the README to clarify that limitation and show the supported pattern: queue shared Gradle prep/build once, then fan out per-emulator commands that reuse those outputs. If the emulator phase no longer needs Gradle at all, it should be queued outside the shared gradle scope entirely.
There was a problem hiding this comment.
I still feel like it's a lot of words in the README that no one is going to read, which could be replaced by a simple example that doesn't include any gradle assembly and is truly parallelizable between emulators.
There was a problem hiding this comment.
[AI:] Agreed, and I updated the example accordingly in 0324a72. The hierarchical-queues section now leads with the split pattern directly: one shared assemble/prep step, then separate per-emulator run steps that reuse those outputs, instead of showing connectedDebugAndroidTest as the primary leaf example.
Amp-Thread-ID: https://ampcode.com/threads/T-019db0cc-d9b2-76bc-8302-1dc81470607b Co-authored-by: Amp <amp@ampcode.com>
Amp-Thread-ID: https://ampcode.com/threads/T-019db0cc-d9b2-76bc-8302-1dc81470607b Co-authored-by: Amp <amp@ampcode.com>
Summary
/-delimited hierarchical queue names and--queue-capacitysupport across the MCP server andtqCLITesting
uv run --extra dev pytest tests/test_queue.py tests/test_tq_cli.pyamp review \"origin/main...HEAD\"