Age-Period-Cohort analysis identifies patterns in cancer incidence or mortality rates from population-based Count (numerator) and Population (denominator) data. Often the data come from a Cancer Registry (e.g., SEER) in the form of a table showing the numbers of cancer cases or cancer deaths (counts) and corresponding person-years at risk (population) for particular age groups and calendar time periods. This toolset provides a comprehensive solution to age-period-cohort analysis for cancer endpoints in defined populations and time periods.
This project uses GitHub Actions to automate the deployment of the APC web tools to AWS ECS Fargate. The CI/CD pipeline is manually triggered via workflow dispatch and supports deployments to multiple environments.
The deployment workflow (.github/workflows/apc-fargate-deploy.yml) is triggered manually via the GitHub Actions UI with the following options:
- Tier Selection: Choose the target environment (dev, qa, stage, prod)
The CI/CD pipeline supports four deployment tiers with the following configurations:
| Tier | Environment | Image Tag | AWS Account | Description |
|---|---|---|---|---|
dev |
Development | development-backend-* |
Configured via secrets | Development environment for testing new features |
qa |
QA | development-backend-* |
Configured via secrets | Quality assurance testing environment |
stage |
Staging | release-backend-* |
Configured via secrets | Pre-production staging environment |
prod |
Production | release-backend-* |
Configured via secrets | Production environment |
Image Tier Logic:
devandqatiers usedevelopmenttagged imagesstageandprodtiers usereleasetagged images
The deployment workflow performs the following steps:
-
Authentication
- Assumes AWS IAM role using OIDC
- Session name includes tier, app name, and branch reference
-
Build Configuration
- Sets environment variables including:
- Branch name and Git tag
- Timestamp for versioning
- ECR repository URLs
- Backend image tags (versioned and latest)
- Sets environment variables including:
-
AWS Parameter Retrieval
- Fetches deployment configuration from AWS Systems Manager Parameter Store:
- ECS cluster name
- Task definition name
- ECS service name
- Task execution and task role ARN
- Fetches deployment configuration from AWS Systems Manager Parameter Store:
-
Docker Build
- Uses Docker Buildx for multi-platform builds
- Builds backend image from
./apc/docker/backend.dockerfile - Tags images with both versioned tag and
latesttag - Pushes to Amazon ECR with build cache optimization
-
Task Definition
- Renders ECS task definition from template (
.github/aws/web.yml) - Substitutes environment-specific variables using
envsubst - Registers new task definition revision with AWS ECS
- Renders ECS task definition from template (
-
Service Deployment
- Updates ECS service with new task definition
- Forces new deployment to ensure latest image is used
- Sets desired count to 1
- Propagates tags from task definition
ECS Fargate Configuration:
- CPU Units: 2048 (2 vCPU)
- Memory: 4096 MB (4 GB)
- Network Mode:
awsvpc - Backend Container Port: 80
Containers:
-
Backend Container
- Image: Latest versioned backend image from ECR
- Environment: Production Flask environment
- Logging: AWS FireLens with Datadog integration
-
Logs Container
- Image: AWS public fluent-bit image
- Purpose: Log routing via FireLens
Each tier requires the following AWS resources to be pre-configured:
AWS Systems Manager Parameters:
- ECS cluster configuration
- Task definition settings
- Service configuration
- IAM role ARNs
Logging Integration:
- CloudWatch log groups per tier
- Datadog configuration (endpoint and API key stored as SecureString parameters)
IAM Roles:
- GitHub Actions CICD role with OIDC trust relationship
- ECS task execution role with ECR and CloudWatch permissions
- ECS task role with application-specific permissions
Amazon ECR:
- Container image repository in us-east-1 region
To deploy to a specific environment:
- Navigate to the Actions tab in GitHub
- Select the APC Fargate Deploy workflow
- Click Run workflow
- Select the desired tier (dev/qa/stage/prod)
- Click Run workflow button
- CloudWatch Logs:
/analysistools/{tier}/apc/web - Datadog: Logs tagTier-specific log groups
- Datadog: Logs tagged with project and tier informationloyments