auto-scaled concourse ci on aws w/o bosh

31
Auto-scaled Concourse CI w/ AWS w/o BOSH Yusuke KUOKA ChatWork (http://www.chatwork.com/) @mumoshu

Upload: -

Post on 10-Feb-2017

1.371 views

Category:

Technology


0 download

TRANSCRIPT

Page 1: Auto-scaled Concourse CI on AWS w/o BOSH

Auto-scaled Concourse CIw/ AWS w/o BOSH

Yusuke KUOKAChatWork (http://www.chatwork.com/)

@mumoshu

Page 2: Auto-scaled Concourse CI on AWS w/o BOSH

First of all:

Page 3: Auto-scaled Concourse CI on AWS w/o BOSH

Concourse CI…

Page 4: Auto-scaled Concourse CI on AWS w/o BOSH

Thanks a lot for sharing us such a GREAT Open-

Source Pipeline-based CI!

Page 5: Auto-scaled Concourse CI on AWS w/o BOSH

Finally we have a CI supporting pipelines as

first-class citizens!!

Page 6: Auto-scaled Concourse CI on AWS w/o BOSH

That’s all. Good-bye!

Page 7: Auto-scaled Concourse CI on AWS w/o BOSH

Page 8: Auto-scaled Concourse CI on AWS w/o BOSH

The issue

Page 9: Auto-scaled Concourse CI on AWS w/o BOSH

Is Concourse a production-ready pipeline-based CI

for a startup/small team?

Page 10: Auto-scaled Concourse CI on AWS w/o BOSH

Production readiness for CI

Something that:

* Just works™

* Costs as low as possible

* Is maintainable

Page 11: Auto-scaled Concourse CI on AWS w/o BOSH

Just works!* `vagrant up concourse/lite` to bootstrap

* `vagrant box update && vagrant destroy -f && vagrant up` to update

* Deployment w/ standalone binaries just works. The deployment will be more manual than using BOSH

(Note: It works as far as you use Ubuntu trusty or later with updated kernel as described in Concourse’s and Docker’s official documentation)

* A lot of builtin/community resources_types

* Concourse CI’s concourse pipeline is a greatest example

Page 12: Auto-scaled Concourse CI on AWS w/o BOSH

Costs as low as possible?

* Wasting money for running idling CI workers when e.g. you and your colleagues drinking beer is unacceptable

* Scale out my CI workers only when someone in your team is working.

* Scalable/Elastic Concourse

* Can be done on my side

Page 13: Auto-scaled Concourse CI on AWS w/o BOSH

Maintainability for a small team?

* I am the only one available to introduce Concourse to my organization

* No one (including me) in my org has experiences in CloudFoundry, BOSH

* BOSH/CloudFoundry/Pivotal all looks GREAT

* Have no time learning it (I wish I got paid to learn it)

* Need Concourse today, but it comes with BOSH

Page 14: Auto-scaled Concourse CI on AWS w/o BOSH

Recap: Issues? > Last one-mile to production-readiness for us = Low cost and BOSH

Page 15: Auto-scaled Concourse CI on AWS w/o BOSH

How?

Page 16: Auto-scaled Concourse CI on AWS w/o BOSH

Production-ready pipeline-based CI for me=

AWS + Auto-scaling + Concourse=

concourse-aws

Page 17: Auto-scaled Concourse CI on AWS w/o BOSH

Usage

Page 18: Auto-scaled Concourse CI on AWS w/o BOSH

1. Build AMI (Based on Ubuntu trusty, Docker/Concourse baked)

2. Provision Concourse cluster providing configuration params interactively

Page 19: Auto-scaled Concourse CI on AWS w/o BOSH

git clone https://github.com/mumoshu/concourse-aws

cd concourse-aws

curl -L https://github.com/mumoshu/concourse-aws/releases/download/latest/concourse-aws -o concourse-aws && chmod +x concourse-aws && ./concourse-aws up

./build-amis.sh

./concourse-aws up

Page 20: Auto-scaled Concourse CI on AWS w/o BOSH

Features

Page 21: Auto-scaled Concourse CI on AWS w/o BOSH

Features

* (Almost) one-command to bootstrap Concourse CI on AWS

* Supports both time-based and utilization-based auto-scaling (e.g. zero workers in after-hours, 80+ CPU usage for several minutes to trigger a scale-out)

* Multi-AZ (Single AZ failure doesn’t bring down the whole cluster. Running jobs will fail though)

Page 22: Auto-scaled Concourse CI on AWS w/o BOSH

Implementation

Page 23: Auto-scaled Concourse CI on AWS w/o BOSH

Implementation

* Terraform for provisioning AWS resources

* Some bash scripts to wrap terraform calls

* Some golang apps to interactively generate configuration files and passes it to terraform

Page 24: Auto-scaled Concourse CI on AWS w/o BOSH

TODO

Page 25: Auto-scaled Concourse CI on AWS w/o BOSH

TODO

* CoreOS support(for faster, easier deployment, customization, maintainability, and for fun)?

* Automatic VPC creation?(Do you need a separate VPC for Concourse?)

* Separate terraform template for DB(Postgres)?

* CloudFormation?

Page 26: Auto-scaled Concourse CI on AWS w/o BOSH

Wishes

Page 27: Auto-scaled Concourse CI on AWS w/o BOSH

I wish Concourse had…

Any official(or documented) way to:

* gracefully stop workers when an EC2 instance is shutting-down or ASG is going to stop it

* Currently we have to utilize AutoScaling Lifecycle Hooks + SQS + `fly pause-pipeline <EVERY PIPELINE>` + `fly builds | grep started | wc -l` to gracefully stop Concourse without killing running jobs

Page 28: Auto-scaled Concourse CI on AWS w/o BOSH

I wish Concourse had…

Any official(or documented) way to:

* cache pulled docker images to reduce build times immediately after scaling out

* Docker’s “local registry as a pull-through cache” is good for DockerHub. Can’t be used with AWS ECR or Quay.io though

Page 29: Auto-scaled Concourse CI on AWS w/o BOSH

Summing up…

Page 30: Auto-scaled Concourse CI on AWS w/o BOSH

Use mumoshu/concourse-aws to bootstrap a production-ready Concourse cluster w/o learning

BOSH

You can try it today!

Page 31: Auto-scaled Concourse CI on AWS w/o BOSH

Thanks!

https://github.com/mumoshu/concourse-aws

Yusuke KUOKA / @mumoshu

An Infrastructure Engineer @ ChatWork

We’re hiring!