Skip to content

andrew-mclachlan/grimoirelab-aws-cdk

Repository files navigation

Running GrimoireLab with AWS Fargate

In this folder are configuration files for deploying GrimoireLab using AWS. You will need a functional AWS account and you should be able to deploy that AWS account. This setup uses AWS Fargate with a Network Load Balancer.

Requirements

Limitations

  • This setup relies on all configuration files (e.g., default-grimoirelab-settings/projects.json) being included in the Docker Images. This configuration has not been setup for EFS volume mounts or the use of AWS S3.

Getting Started

Install

cd aws
npm install
npm run build

Setup environmental variables for your account and region

Variable Value
GRIMOIRE_AWS_ACCOUNT Your AWS account
GRIMOIRE_AWS_REGION Your preferred AWS region (e.g., eu-west-2)

Bootstrap CDK

npx cdk bootstrap aws://${GRIMOIRE_AWS_ACCOUNT}/${GRIMOIRE_AWS_REGION}

Docker Images

Setup your AWS registry

npx cdk deploy AwsEcrStack

Login to your AWS registry

aws ecr get-login-password --region ${GRIMOIRE_AWS_REGION} | docker login --username AWS --password-stdin ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/grimoirelab

Push Images to your AWS registry

docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/grimoirelab:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/nginx:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/sortinghat-working:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/sortinghat:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/mariadb:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/redis:latest
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/opensearch:1.3.7
docker push ${GRIMOIRE_AWS_ACCOUNT}.dkr.ecr.${GRIMOIRE_AWS_REGION}.amazonaws.com/opensearch-dashboards:1.3.7

Deploy the AWS stacks

npx cdk deploy AwsVpcStack
npx cdk deploy AwsEcsRedisStack
npx cdk deploy AwsEcsOpenSearchStack
npx cdk deploy AwsEcsSortingHatStack
npx cdk deploy AwsEcsMordredStack
npx cdk deploy AwsNlbStack

Test the AWS stack deployment

Visit the AWS Load balancers website, select grimoire-nlb, and visit the DNS name in your browser (e.g., grimoire-nlb-2ffec2c2fc78664d.elb.eu-west-2.amazonaws.com).

Improvements

  1. Setup RDS in place of mariadb service.
  2. Setup EFS to store configuration files and store indices.
  3. Integrate into CI/CD workflow for GrimoireLab deployment.

About

AWS CDK IaaC for GrimoireLab

Resources

License

Contributing

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published