|
1 | 1 | # GitHub Actions Workflows
|
2 | 2 |
|
3 |
| -This directory contains GitHub Actions workflows for MXCP server projects. |
| 3 | +This directory contains GitHub Actions workflows for the UAE MXCP Server project. |
4 | 4 |
|
5 | 5 | ## Available Workflows
|
6 | 6 |
|
7 |
| -### 1. Tests (`test.yml`) |
8 |
| -- **Trigger**: Pull requests to `main` or `develop` branches, or manual dispatch |
9 |
| -- **Purpose**: Run the complete test suite including: |
10 |
| - - MXCP validation tests |
11 |
| - - dbt schema tests |
12 |
| - - Tool functionality tests |
13 |
| - - Data quality tests |
14 |
| -- **Requirements**: |
15 |
| - - `OPENAI_API_KEY` secret for evaluation tests |
16 |
| - - `GH_PAT` secret for submodule access |
| 7 | +### 1. Configuration Validation (`test.yml`) |
| 8 | +- **Trigger**: Pull requests to `main` branch, or manual dispatch |
| 9 | +- **Purpose**: Quick validation of configuration files |
| 10 | +- **What it runs**: `just validate-config` |
| 11 | + - YAML configuration validation |
| 12 | + - Tool definition syntax checks |
| 13 | +- **Duration**: ~10 seconds |
| 14 | +- **Requirements**: None (no secrets needed) |
17 | 15 |
|
18 |
| -### 2. Deploy to AWS (`deploy.yml`) |
| 16 | +### 2. Deploy to AWS App Runner (`deploy.yml`) |
19 | 17 | - **Trigger**: Push to `main` branch, or manual dispatch
|
20 |
| -- **Purpose**: Deploy the MXCP server to AWS App Runner |
21 |
| -- **Process**: |
22 |
| - 1. Runs all tests first |
23 |
| - 2. Builds Docker image and pushes to ECR |
24 |
| - 3. Updates App Runner service |
25 |
| - 4. Monitors deployment until complete |
26 |
| - 5. Tests the deployed service |
27 |
| -- **Requirements**: |
28 |
| - - `AWS_ACCESS_KEY_ID` secret |
29 |
| - - `AWS_SECRET_ACCESS_KEY` secret |
30 |
| - - `GH_PAT` secret for submodule access |
31 |
| - - `OPENAI_API_KEY` secret for tests |
32 |
| - |
33 |
| -### 3. Release (`release.yml`) |
34 |
| -- **Trigger**: Manual dispatch only |
35 |
| -- **Purpose**: Create a new version release |
36 |
| -- **Process**: |
37 |
| - 1. Validates version format (must be vX.Y.Z) |
38 |
| - 2. Generates changelog from commits |
39 |
| - 3. Creates git tag |
40 |
| - 4. Creates GitHub release |
41 |
| - 5. Optionally triggers deployment |
42 |
| -- **Inputs**: |
43 |
| - - `version`: Version to release (e.g., v1.0.0) |
44 |
| - - `release_notes`: Additional release notes |
45 |
| - |
46 |
| -## Required Repository Secrets |
47 |
| - |
48 |
| -Configure these in your repository settings under Secrets and Variables > Actions: |
49 |
| - |
50 |
| -1. **AWS_ACCESS_KEY_ID**: AWS access key for deployment |
51 |
| -2. **AWS_SECRET_ACCESS_KEY**: AWS secret key for deployment |
52 |
| -3. **OPENAI_API_KEY**: OpenAI API key for running evaluation tests |
53 |
| -4. **GH_PAT**: GitHub Personal Access Token with repo scope (for accessing submodules) |
54 |
| - |
55 |
| -## Manual Workflow Dispatch |
56 |
| - |
57 |
| -You can manually trigger workflows from the Actions tab: |
58 |
| - |
59 |
| -1. Go to the Actions tab in your repository |
60 |
| -2. Select the workflow you want to run |
61 |
| -3. Click "Run workflow" |
62 |
| -4. Fill in any required inputs |
63 |
| -5. Click "Run workflow" to start |
64 |
| - |
65 |
| -## Deployment Configuration |
66 |
| - |
67 |
| -The deployment workflow uses these settings (defined in `deploy.yml`): |
68 |
| -- **AWS Region**: Configured in deployment/config.env |
69 |
| -- **AWS Account**: Configured in deployment/config.env |
70 |
| -- **ECR Repository**: Configured in deployment/config.env |
71 |
| -- **App Runner Service**: Configured in deployment/config.env |
72 |
| - |
73 |
| -To modify these, edit your `deployment/config.env` file with your project-specific values. |
| 18 | +- **Purpose**: Complete build, deploy, and test pipeline |
| 19 | +- **Workflow**: |
| 20 | + 1. **validate-config**: Quick configuration validation |
| 21 | + 2. **deploy**: Build Docker image, push to ECR, deploy to App Runner |
| 22 | + 3. **test-deployment**: Post-deployment health and integration testing |
| 23 | +- **Duration**: ~8-12 minutes |
| 24 | +- **Requirements**: |
| 25 | + - `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` secrets |
| 26 | + - `MXCP_DATA_ACCESS_KEY_ID` and `MXCP_DATA_SECRET_ACCESS_KEY` secrets (for data download) |
| 27 | + |
| 28 | +### 3. Release Management (`release.yml`) |
| 29 | +- **Trigger**: Manual dispatch or tag creation |
| 30 | +- **Purpose**: Create releases and manage versioning |
| 31 | +- **Duration**: ~2 minutes |
| 32 | + |
| 33 | +## Workflow Details |
| 34 | + |
| 35 | +### Environment Variables |
| 36 | +The workflows use these environment variables (configured in the workflow files): |
| 37 | +```yaml |
| 38 | +env: |
| 39 | + AWS_REGION: eu-west-1 |
| 40 | + AWS_ACCOUNT_ID: 684130658470 |
| 41 | + ECR_REPOSITORY: uae-mxcp-server |
| 42 | + APP_RUNNER_SERVICE: uae-mxcp-server |
| 43 | +``` |
| 44 | +
|
| 45 | +### Modern Task Runner |
| 46 | +All workflows use the `just` task runner for clean, maintainable task execution: |
| 47 | +- `just validate-config` - Configuration validation |
| 48 | +- `just prepare-build` - Data download and dbt processing |
| 49 | +- Integration testing against deployed service |
| 50 | + |
| 51 | +### Security |
| 52 | +- **Secrets**: Stored in GitHub repository secrets |
| 53 | +- **Data access**: Uses dedicated IAM user with minimal S3 permissions |
| 54 | +- **Credentials**: Cleared from Docker image after data preparation |
| 55 | + |
| 56 | +## Deployment Architecture |
| 57 | + |
| 58 | +**RAW Labs Workflow:** |
| 59 | +``` |
| 60 | +GitHub Actions β ECR β AWS App Runner β Health Check β Integration Test |
| 61 | +``` |
| 62 | +
|
| 63 | +**For Squirro Integration:** |
| 64 | +- Squirro replaces these workflows with their own EKS-based deployment |
| 65 | +- Uses the same build patterns but different deployment target |
| 66 | +- External system handles ECR β Kubernetes deployment |
74 | 67 |
|
75 |
| -## Best Practices |
| 68 | +## Troubleshooting |
76 | 69 |
|
77 |
| -1. **Always test locally first**: Run `./scripts/run_tests.sh` before pushing |
78 |
| -2. **Use pull requests**: Tests run automatically on PRs to catch issues early |
79 |
| -3. **Tag releases**: Use semantic versioning (v1.0.0, v1.1.0, etc.) |
80 |
| -4. **Monitor deployments**: Check the Actions tab for deployment status |
81 |
| -5. **Review logs**: Download test artifacts if tests fail |
| 70 | +### Common Issues |
| 71 | +1. **AWS credentials not configured**: Add secrets to repository |
| 72 | +2. **Data download fails**: Check MXCP_DATA_ACCESS credentials |
| 73 | +3. **App Runner deployment fails**: Check service limits and IAM roles |
| 74 | +4. **Health checks fail**: Service may need more time to start |
82 | 75 |
|
83 |
| -## Troubleshooting |
| 76 | +### Monitoring |
| 77 | +- **GitHub Actions**: Check workflow logs for build/deploy issues |
| 78 | +- **App Runner**: Monitor service status in AWS console |
| 79 | +- **Health endpoint**: `https://service-url/health` |
| 80 | +- **MCP endpoint**: `https://service-url/mcp` |
| 81 | +
|
| 82 | +## Best Practices |
84 | 83 |
|
85 |
| -### Tests Failing |
86 |
| -- Check if `OPENAI_API_KEY` is set correctly in secrets |
87 |
| -- Ensure submodules are properly initialized |
88 |
| -- Review test logs in the uploaded artifacts |
89 |
| - |
90 |
| -### Deployment Failing |
91 |
| -- Verify AWS credentials are correct and have necessary permissions |
92 |
| -- Check if ECR repository exists |
93 |
| -- Ensure App Runner service is properly configured |
94 |
| -- Review deployment logs in the Actions tab |
95 |
| - |
96 |
| -### Release Failing |
97 |
| -- Ensure version format is correct (vX.Y.Z) |
98 |
| -- Check if the tag already exists |
99 |
| -- Verify you have push permissions to create tags |
| 84 | +1. **Always test locally first**: Run `just full-pipeline` before pushing |
| 85 | +2. **Monitor deployments**: Watch GitHub Actions and App Runner status |
| 86 | +3. **Check health after deploy**: Verify service responds correctly |
| 87 | +4. **Use manual dispatch**: For controlled deployments to staging/production |
0 commit comments