Why self host?
- Enhanced security: Get complete control over ingress and egress rules.
- Complete customization: Modify the TestDriver Golden Image to include custom dependencies, software, and configurations at launch time.
- Powerful Infrastructure: Run tests on bare metal infrastructure that support emulators and simulators.
Quick Start (TL;DR)
- Copy the workflow file: Use
.github/workflows/self-hosted.yml
as your template - Run CloudFormation: Deploy our
setup/aws/cloudformation.yaml
to provision infrastructure - Setup instances: Use
setup/aws/spawn-runner.sh
with your launch template ID - Configure GitHub Actions: Add AWS credentials to your repository secrets
Overview
Self-hosting TestDriver gives you complete control over your test execution environment. You’ll provision EC2 instances on AWS using our pre-configured AMI and infrastructure templates.Prerequisites
- AWS account with appropriate permissions
- AWS CLI installed locally
- Access to TestDriver’s shared AMI. Contact us for access.
- GitHub repository for your tests
Step 1: Set Up AWS Infrastructure
Deploy CloudFormation Stack
Oursetup/aws/cloudformation.yaml
template creates:
- Dedicated VPC with public subnet
- Security group with proper port access
- IAM roles and instance profiles
- EC2 launch template for programmatic instance creation
Security: Replace
AllowedIngressCidr=0.0.0.0/0
with your specific IP
ranges to lock down access to your VPC.Get Launch Template ID
After CloudFormation completes, find the launch template ID in the stack outputs:Step 2: Spawn a New TestDriver Runner
Using aws-setup.sh
Oursetup/aws/spawn-runner.sh
spawns and initializes instances:
- Launches instances using your launch template
- Completes TestDriver handshake
- Returns instance details for CLI usage
CLI Usage
Once you have an instance IP, run tests directly:PUBLIC_IP
to target the instance you just spawned via ./setup/aws/spawn-runner.sh
:
Step 3: GitHub Actions Integration
Example Workflow
Our.github/workflows/self-hosted.yml
demonstrates the complete workflow:
Required Secrets
Configure these secrets in your GitHub repository:Secret | Description | Example |
---|---|---|
AWS_ACCESS_KEY_ID | AWS access key | AKIAIOSFODNN7EXAMPLE |
AWS_SECRET_ACCESS_KEY | AWS secret key | wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY |
AWS_LAUNCH_TEMPLATE_ID | Launch template from CloudFormation | lt-07c53ce8349b958d1 |
AMI_ID | TestDriver AMI ID | ami-085f872ca0cd80fed |
TD_API_KEY | TestDriver API key | Your API key from the dashboard |
AMI Customization
Using the Base AMI
Our AMI comes pre-configured with:- Windows Server with desktop environment
- Required TestDriver dependencies
- Optimized settings for test execution
Modifying the AMI
You can customize the AMI for your specific needs:- Launch an instance from our base AMI
- Make your changes (install software, configure settings)
- Create a new AMI from your modified instance
- Update your workflow to use the new AMI ID
Amazon Image Builder
For automated AMI builds, use Amazon EC2 Image Builder:Security Considerations
Network Security
- Restrict CIDR blocks: Only allow access from your known IP ranges
- Use VPC endpoints: For private communication with AWS services
- Enable VPC Flow Logs: For network monitoring and debugging
AWS Authentication
Use OIDC for GitHub Actions instead of long-term credentials:Instance Security
- Terminate instances immediately after use
- Monitor costs with AWS billing alerts
- Use least-privilege IAM roles for instance profiles
- Enable CloudTrail for audit logging
Troubleshooting
Common Issues
Instance not responding:- Check security group rules allow necessary ports
- Verify instance has passed all status checks
- Ensure AMI is compatible with selected instance type
- Verify network connectivity from runner to instance
- Check VPC routing and internet gateway configuration
- Confirm instance is in correct subnet
- Validate AWS credentials and permissions
- Check AWS service quotas and limits
- Verify region consistency across all resources
Getting Help
For enterprise customers:- Contact your account manager for AMI access issues
- Use support channels for infrastructure questions
- Check the TestDriver documentation for CLI usage