Skip to content

[plan] Parallelize setup operations in agent job #12554

@github-actions

Description

@github-actions

Objective

Parallelize independent setup operations to reduce sequential execution time by 8-12 seconds.

Context

Currently, Stage 2 and Stage 3 of the agent job run sequentially, but many operations are independent:

  • Stage 2: Dependencies Installation (8.8s)
    • AWF binary install (0.8s)
    • Claude Code CLI install (3.1s)
  • Stage 3: Container & Network Setup (11.4s)
    • Docker image downloads
    • MCP server config generation
    • Safe outputs config

Impact: Save 8-12s (5-8% of agent job time)

Approach

  1. Identify all independent operations in setup stages
  2. Use bash background jobs to run parallel operations
  3. Use wait to synchronize before dependent steps
  4. Ensure error handling works with parallel execution

Example Implementation

# Run independent operations in parallel
npm install -g `@anthropic-ai/claude-code`@2.1.22 &
docker pull ghcr.io/github/github-mcp-server:v0.30.2 &
docker pull ghcr.io/githubnext/gh-aw-mcpg:v0.0.84 &
curl -L -o awf https://github.com/githubnext/gh-aw/releases/download/v0.11.2/awf &
wait  # Wait for all background jobs to complete

# Continue with dependent operations
chmod +x awf
./awf --version

Files to Modify

  • actions/setup/ scripts that handle dependency installation
  • Workflow template generation in pkg/workflow/
  • Any shell scripts managing container initialization

Acceptance Criteria

AI generated by Plan Command for #12543

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions