Running Workflows
15 minutesTriggering Workflows
All workflows are configured with workflow_dispatch, meaning they must be triggered manually. There are two main ways to run workflows:
- GitHub UI - Visual interface, easiest for most users
- GitHub CLI - Command-line interface, great for automation
Method 1: GitHub UI
Step 1: Navigate to Actions Tab
- Go to your forked repository on GitHub
- Click the Actions tab at the top
Step 2: Select Workflow
On the left sidebar, you’ll see all available workflows:
- Deploy Smart Agent
- Install Node Agent (Batched)
- Install Machine Agent (Batched)
- Install DB Agent (Batched)
- Install Java Agent (Batched)
- Uninstall Node Agent (Batched)
- Uninstall Machine Agent (Batched)
- Uninstall DB Agent (Batched)
- Uninstall Java Agent (Batched)
- Stop and Clean Smart Agent (Batched)
- Cleanup All Agents
Click on the workflow you want to run.
Step 3: Run Workflow
- Click “Run workflow” button (top right)
- Select branch: main
- (Optional) Adjust batch_size if desired
- Click “Run workflow” button
Step 4: Monitor Execution
- The workflow will appear in the list below
- Click on the workflow run to view details
- Watch progress in real-time
- Click on job names to see detailed logs
Method 2: GitHub CLI
Install GitHub CLI
Authenticate
Run Workflows
Monitor Workflows
First Deployment Walkthrough
Let’s walk through a complete first-time deployment:
Step 1: Verify Setup
Before running any workflows, ensure:
- ✅ Self-hosted runner shows “Idle” (green)
- ✅
SSH_PRIVATE_KEYsecret is configured - ✅
DEPLOYMENT_HOSTSvariable contains your target IPs - ✅ Network connectivity verified
Step 2: Deploy Smart Agent
Via GitHub UI:
- Go to Actions tab
- Select “Deploy Smart Agent”
- Click “Run workflow”
- Accept default batch_size (256)
- Click “Run workflow”
Via GitHub CLI:
Step 3: Monitor Execution
The workflow will show:
- Prepare job - Creating batch matrix
- Deploy job (one per batch) - Deploying to hosts
Click on each job to view detailed logs.
Step 4: Verify Installation
SSH into a target host and check:
Expected output:
Step 5: Install Additional Agents (Optional)
If needed, install specific agent types:
Understanding Workflow Output
Prepare Job Output
Deploy Job Output (per batch)
Completion Summary
Common Deployment Scenarios
Scenario 1: Initial Deployment
Scenario 2: Update Smart Agent
Scenario 3: Add New Hosts
Scenario 4: Complete Removal
Details
“Cleanup All Agents” permanently deletes /opt/appdynamics. This cannot be undone!
Troubleshooting Workflow Failures
Workflow Stays in “Queued”
Symptom: Workflow doesn’t start
Cause: Runner not available or offline
Solution:
- Check runner status: Settings → Actions → Runners
- Verify runner shows “Idle” (green)
- Restart runner if needed:
sudo ./svc.sh restart
SSH Connection Failures
Symptom: “Permission denied” or “Connection refused” errors
Solutions:
Test SSH manually:
Check security groups:
- Verify SSH (22) allowed from runner
- Confirm runner and targets in same security group
Verify SSH key:
- Ensure
SSH_PRIVATE_KEYsecret matches actual key - Verify public key is on target hosts
Partial Batch Failures
Symptom: Some hosts succeed, others fail
Solution:
- View workflow logs to identify failed hosts
- SSH to failed hosts to investigate
- Re-run workflow (idempotent - skips successful hosts)
Batch Job Errors
Symptom: “Error splitting hosts into batches”
Solution:
- Check
DEPLOYMENT_HOSTSvariable format - Ensure one IP per line
- No trailing spaces or special characters
- Use Unix line endings (LF, not CRLF)
Performance Tuning
Adjusting Batch Size
Smaller batches (fewer resources, slower):
Larger batches (more resources, faster):
Runner Resource Recommendations
| Hosts | CPU | Memory | Batch Size |
|---|---|---|---|
| 1-100 | 2 cores | 4 GB | 256 |
| 100-500 | 4 cores | 8 GB | 256 |
| 500-2000 | 8 cores | 16 GB | 256 |
| 2000+ | 16 cores | 32 GB | 256 |
Best Practices
Test on single host first
- Create a test variable with 1 IP
- Run workflow to verify
- Then deploy to full list
Monitor workflow execution
- Watch logs in real-time
- Check for errors immediately
- Verify on sample hosts
Use appropriate batch sizes
- Default (256) works for most cases
- Reduce if runner struggles
- Monitor runner resource usage
Keep workflows up to date
- Pull latest changes from repository
- Test updates on non-production first
- Document any customizations
Maintain runner health
- Keep runner online and idle
- Update runner software regularly
- Monitor disk space and resources
Next Steps
Congratulations! You’ve successfully learned how to automate AppDynamics Smart Agent deployment using GitHub Actions. For more information, visit the complete repository.