A web application for launching and managing Nextflow pipelines on AWS Batch.
The application consists of:
- Frontend: Vue.js application
- Backend: Go API server
- AWS Resources: Batch, S3, IAM roles
- AWS Account with appropriate permissions
- AWS CLI configured
- Docker installed
- Node.js and npm installed
- Go 1.21 or later installed
# Create buckets for different purposes
aws s3 mb s3://your-pipeline-bucket --region your-region
aws s3 mb s3://your-job-bucket --region your-region
aws s3 mb s3://your-log-bucket --region your-region# Create the role
aws iam create-role --role-name batchJobExecutionRole \
--assume-role-policy-document '{
"Version": "2012-10-17",
"Statement": [{
"Effect": "Allow",
"Principal": {
"Service": "ecs-tasks.amazonaws.com"
},
"Action": "sts:AssumeRole"
}]
}'
# Attach required policies
aws iam attach-role-policy --role-name batchJobExecutionRole \
--policy-arn arn:aws:iam::aws:policy/service-role/AmazonECSTaskExecutionRolePolicy
aws iam attach-role-policy --role-name batchJobExecutionRole \
--policy-arn arn:aws:iam::aws:policy/AmazonS3FullAccessUse the AWS Batch Setup component in the application to create:
- Compute Environment
- Job Queue
- Job Definition
Or use AWS CLI:
# Create compute environment
aws batch create-compute-environment \
--compute-environment-name nextflow-compute-env \
--type MANAGED \
--compute-resources type=EC2,minvCpus=0,maxvCpus=256,desiredvCpus=0,instanceTypes=m5.large,subnets=subnet-xxxxx,securityGroupIds=sg-xxxxx,instanceRole=ecsInstanceRole
# Create job queue
aws batch create-job-queue \
--job-queue-name nextflow-job-queue \
--priority 1 \
--compute-environment-order order=1,computeEnvironment=nextflow-compute-env# Build the backend image
cd mv-launcher-api
docker build -t nextflow-launcher-api:latest .# Create ECS cluster and service
aws ecs create-cluster --cluster-name nextflow-launcher
aws ecs create-service \
--cluster nextflow-launcher \
--service-name api-service \
--task-definition nextflow-launcher-api \
--desired-count 1# Launch EC2 instance and run container
aws ec2 run-instances \
--image-id ami-xxxxx \
--instance-type t2.micro \
--user-data '#!/bin/bash
docker run -d \
-p 8080:8080 \
-e AWS_REGION=your-region \
-e PIPELINE_BUCKET=your-pipeline-bucket \
-e JOB_BUCKET=your-job-bucket \
-e LOG_BUCKET=your-log-bucket \
-e JOB_ROLE_ARN=arn:aws:iam::your-account:role/batchJobExecutionRole \
nextflow-launcher-api:latest'# Build the Vue.js application
cd vue
npm install
npm run build# Create S3 bucket for frontend
aws s3 mb s3://your-frontend-bucket --region your-region
# Upload built files
aws s3 sync dist/ s3://your-frontend-bucket
# Enable static website hosting
aws s3 website s3://your-frontend-bucket \
--index-document index.html \
--error-document index.html# Create CloudFront distribution
aws cloudfront create-distribution \
--origin-domain-name your-frontend-bucket.s3.amazonaws.com \
--default-root-object index.htmlAWS_REGION=your-region
PIPELINE_BUCKET=your-pipeline-bucket
JOB_BUCKET=your-job-bucket
LOG_BUCKET=your-log-bucket
JOB_ROLE_ARN=arn:aws:iam::your-account:role/batchJobExecutionRoleCreate a .env file in the vue directory:
VITE_API_URL=http://your-backend-url:8080
- Update environment variables in your deployment
- Update default values in
mv-launcher-api/pkg/api/main.go:
PipelineBucket = getEnvOrDefault("PIPELINE_BUCKET", "your-pipeline-bucket")
JobBucket = getEnvOrDefault("JOB_BUCKET", "your-job-bucket")
LogBucket = getEnvOrDefault("LOG_BUCKET", "your-log-bucket")The job definition is created automatically when the first job is submitted. To update it:
- Go to AWS Batch console
- Find the job definition "nextflow-headnode-launcher"
- Create a new revision with updated parameters
- Backend logs: CloudWatch Logs
- Frontend logs: Browser console
- Job logs: S3 bucket specified in LOG_BUCKET
- AWS Batch logs: CloudWatch Logs
- Use AWS Secrets Manager for sensitive credentials
- Implement proper IAM roles and policies
- Enable HTTPS for all endpoints
- Regular security updates and patches
- Monitor AWS CloudTrail for suspicious activities
-
Job Submission Fails
- Check IAM permissions
- Verify job definition exists
- Check compute environment status
-
Frontend Can't Connect to Backend
- Verify CORS settings
- Check network security groups
- Verify API endpoint configuration
-
S3 Access Issues
- Verify bucket policies
- Check IAM role permissions
- Verify bucket names and regions
For issues and support, please create an issue in the GitHub repository.