Understanding Workflows
10 minutesAvailable Workflows
The GitHub Actions lab includes 11 workflows for complete Smart Agent lifecycle management. All workflow files are available in the repository at .github/workflows/.
Repository: https://github.com/chambear2809/github-actions-lab
Workflow Categories
1. Deployment (1 workflow)
Deploy Smart Agent (Batched)
- File:
deploy-agent-batched.yml - Purpose: Installs Smart Agent and starts the service
- Features:
- Automatic batching (default: 256 hosts per batch)
- Configurable batch size
- Parallel deployment within each batch
- Sequential batch processing
- Inputs:
batch_size: Number of hosts per batch (default: 256)
- Trigger: Manual only (
workflow_dispatch)
2. Agent Installation (4 workflows)
All installation workflows use smartagentctl to install specific agent types:
Install Node Agent (Batched)
- File:
install-node-batched.yml - Command:
smartagentctl install node - Batched: Yes (configurable)
Install Machine Agent (Batched)
- File:
install-machine-batched.yml - Command:
smartagentctl install machine - Batched: Yes (configurable)
Install DB Agent (Batched)
- File:
install-db-batched.yml - Command:
smartagentctl install db - Batched: Yes (configurable)
Install Java Agent (Batched)
- File:
install-java-batched.yml - Command:
smartagentctl install java - Batched: Yes (configurable)
3. Agent Uninstallation (4 workflows)
All uninstallation workflows use smartagentctl to remove specific agent types:
Uninstall Node Agent (Batched)
- File:
uninstall-node-batched.yml - Command:
smartagentctl uninstall node - Batched: Yes (configurable)
Uninstall Machine Agent (Batched)
- File:
uninstall-machine-batched.yml - Command:
smartagentctl uninstall machine - Batched: Yes (configurable)
Uninstall DB Agent (Batched)
- File:
uninstall-db-batched.yml - Command:
smartagentctl uninstall db - Batched: Yes (configurable)
Uninstall Java Agent (Batched)
- File:
uninstall-java-batched.yml - Command:
smartagentctl uninstall java - Batched: Yes (configurable)
4. Smart Agent Management (2 workflows)
Stop and Clean Smart Agent (Batched)
- File:
stop-clean-smartagent-batched.yml - Commands:
smartagentctl stopsmartagentctl clean
- Purpose: Stops the Smart Agent service and purges all data
- Batched: Yes (configurable)
Cleanup All Agents (Batched)
- File:
cleanup-appdynamics.yml - Command:
sudo rm -rf /opt/appdynamics - Purpose: Completely removes the /opt/appdynamics directory
- Batched: Yes (configurable)
- Warning: This permanently deletes all AppDynamics components
Details
The “Cleanup All Agents” workflow permanently deletes /opt/appdynamics. This action cannot be undone. Use with caution!
Workflow Structure
All batched workflows follow a consistent two-job structure:
Job 1: Prepare
Purpose: Loads target hosts from GitHub variables and creates batch matrix
Job 2: Deploy/Install/Uninstall
Purpose: Runs in parallel for each batch, executing the specific operation on all hosts within the batch
Batching Behavior
How It Works
- Prepare Job loads
DEPLOYMENT_HOSTSand splits into batches - Deploy Job creates one matrix entry per batch
- Batches process sequentially to avoid overwhelming the runner
- Within each batch, all hosts deploy in parallel using background processes
Configurable Batch Size
All workflows accept a batch_size input (default: 256):
Examples
- 100 hosts, batch_size=256: 1 batch, ~3 minutes
- 500 hosts, batch_size=256: 2 batches, ~6 minutes
- 1,000 hosts, batch_size=128: 8 batches, ~16 minutes
- 5,000 hosts, batch_size=256: 20 batches, ~60 minutes
Workflow Execution Order
Typical Deployment Sequence
- Deploy Smart Agent - Initial deployment
- Install Machine Agent - Install specific agents as needed
- Install DB Agent - Install database monitoring
- (Use other install workflows as needed)
Maintenance/Update Sequence
- Stop and Clean Smart Agent - Stop services and clean data
- Deploy Smart Agent - Redeploy with updated version
- Install agents again - Reinstall required agents
Complete Removal Sequence
- Stop and Clean Smart Agent - Stop services
- Cleanup All Agents - Remove /opt/appdynamics directory
Viewing Workflow Code
You can view the complete workflow YAML files in the repository:
Main deployment workflow: https://github.com/chambear2809/github-actions-lab/blob/main/.github/workflows/deploy-agent-batched.yml
All workflows: https://github.com/chambear2809/github-actions-lab/tree/main/.github/workflows
Workflow Features
Built-in Error Handling
- Per-host error tracking
- Failed host reporting
- Batch-level failure handling
- Always-executed summary
Parallel Execution
- All hosts within a batch deploy simultaneously
- Uses SSH background processes (
&) - Wait command ensures all complete
- Maximum parallelism within resource limits
Security
- SSH keys never exposed in logs
- Credentials bound as environment variables
- Strict host key checking disabled for automation
- Keys removed after workflow completion
Next Steps
Now that you understand the available workflows, let’s execute your first deployment!