• Stars
    star
    411
  • Rank 105,237 (Top 3 %)
  • Language
    Shell
  • License
    MIT License
  • Created over 9 years ago
  • Updated 7 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An auto-scaling cluster of build agents running in your own AWS VPC

Elastic CI Stack for AWS

Build status

Buildkite Elastic CI Stack for AWS

Buildkite is a platform for running fast, secure, and scalable continuous integration pipelines on your own infrastructure.

The Buildkite Elastic CI Stack for AWS gives you a private, autoscaling Buildkite Agent cluster. Use it to parallelize large test suites across thousands of nodes, run tests and deployments for Linux or Windows based services and apps, or run AWS ops tasks.

Getting started

See the Elastic CI Stack for AWS tutorial for a step-by-step guide, the Elastic CI Stack for AWS documentation, or the full list of recommended resources for detailed information.

Or jump straight in:

Launch AWS Stack

The current release is . See Releases for older releases.

Although the stack creates its own VPC by default, we highly recommend following best practice by setting up a separate development AWS account and using role switching and consolidated billing β€” see the Delegate Access Across AWS Accounts tutorial for more information.

If you want to use the AWS CLI, download config.json.example, rename it to config.json, and then run the below command:

aws cloudformation create-stack \
  --output text \
  --stack-name buildkite \
  --template-url "https://s3.amazonaws.com/buildkite-aws-stack/latest/aws-stack.yml" \
  --capabilities CAPABILITY_IAM CAPABILITY_NAMED_IAM CAPABILITY_AUTO_EXPAND \
  --parameters "$(cat config.json)"

Supported Features

Most features are supported across both Linux and Windows. See below for details of per-operating system support:

Feature Linux Windows
Docker βœ… βœ…
Docker Compose βœ… βœ…
AWS CLI βœ… βœ…
S3 Secrets Bucket βœ… βœ…
ECR Login βœ… βœ…
Docker Login βœ… βœ…
CloudWatch Logs Agent βœ… βœ…
Per-Instance Bootstrap Script βœ… βœ…
SSM Access βœ… βœ…
Instance Storage (NVMe) βœ…
SSH Access βœ…
Periodic authorized_keys Refresh βœ…
Periodic Instance Health Check βœ…
git lfs βœ…
Additional sudo Permissions βœ…
RDP Access βœ…

Security

This repository hasn't been reviewed by security researchers so exercise caution and careful thought with what credentials you make available to your builds.

Anyone with commit access to your codebase (including third-party pull-requests if you've enabled them in Buildkite) will have access to your secrets bucket files.

Also keep in mind the EC2 HTTP metadata server is available from within builds, which means builds act with the same IAM permissions as the instance.

Limiting CloudFormation Permissions

By default, CloudFormation will operate using the permissions granted to the identity of the credentials used to initiate a stack deployment or update.

If you want to explicitly specify which actions CloudFormation can perform on your behalf, you can either create your stack using credentials for an IAM identity with limited permissions, or provide an AWS CloudFormation service role.

πŸ§‘β€πŸ”¬ templates/service-role.yml template contains an experimental service role and set of IAM Policies that list the IAM Actions necessary to create, update, and delete a CloudFormation Stack created with the Buildkite Elastic CI Stack template. The role created by this template is currently being tested, but it has not been tested enough to be depended on. There are likely to be missing permissions for some stack parameter permutations.

aws cloudformation deploy --template-file templates/service-role.yml --stack-name buildkite-elastic-ci-stack-service-role --region us-east-1 --capabilities CAPABILITY_IAM

Development

To get started with customizing your own stack, or contributing fixes and features:

# Checkout all submodules
git submodule update --init --recursive

# Build all AMIs and render a cloud formation template - this requires AWS credentials (in the ENV)
# to build an AMI with packer
make build

# To create a new stack on AWS using the local template
make create-stack

# You can use any of the AWS* environment variables that the aws-cli supports
AWS_PROFILE="some-profile" make create-stack

# You can also use aws-vault or similar
aws-vault exec some-profile -- make create-stack

If you need to build your own AMI (because you've changed something in the packer directory), run packer with AWS credentials in your shell environment:

make packer

This will boot and image three AWS EC2 instances in your account’s us-east-1 default VPC:

  • Linux (64-bit x86)
  • Linux (64-bit Arm)
  • Windows (64-bit x86)

Support Policy

We provide support for security and bug fixes on the current major release only.

If there are any changes in the main branch since the last tagged release, we aim to publish a new tagged release of this template at the end of each month.

AWS Regions

We support all AWS Regions, except China and US GovCloud.

We aim to support new regions within one month of general availability.

Operating Systems

We build and deploy the following AMIs to all our supported regions:

  • Amazon Linux 2 (64-bit x86)
  • Amazon Linux 2 (64-bit Arm)
  • Windows Server 2019 (64-bit x86)

Buildkite Agent

The Elastic CI Stack template published from the main branch tracks the latest Buildkite Agent release.

You may wish to preview any updates to your stack from this template using a CloudFormation Stack Change Set to decide whether to apply it.

Recommended reading

To gain a better understanding of how Elastic CI Stack works and how to use it most effectively and securely, see the following resources:

Questions and support

Feel free to drop an email to [email protected] with questions. It helps us if you can provide the following details:

# List your stack parameters
aws cloudformation describe-stacks --stack-name MY_STACK_NAME \
  --query 'Stacks[].Parameters[].[ParameterKey,ParameterValue]' --output table

Collect logs from CloudWatch

Provide us with logs from CloudWatch Logs:

/buildkite/elastic-stack/{instance-id}
/buildkite/system/{instance-id}

Collect logs via script

An alternative method to collect the logs is to use the log-collector script in the utils folder. The script will collect CloudWatch logs for the Instance, Lambda function, and AutoScaling activity and package them in a zip archive which you can send via email to [email protected].

You can also drop by #aws-stack and #aws channels in Buildkite Community Slack and ask your question!

Licence

See Licence.md (MIT)

More Repositories

1

docker-puppeteer

A minimal Docker image for Puppeteer
Dockerfile
807
star
2

agent

The Buildkite Agent is an open-source toolkit written in Go for securely running build jobs on any device or network
Go
774
star
3

terminal-to-html

Converts arbitrary shell output (with ANSI) into beautifully rendered HTML
Go
603
star
4

emojis

:shipit: Custom emoji supported by Buildkite which you can use in your build pipelines and terminal output.
Ruby
376
star
5

cli

A command line interface for Buildkite.
Go
167
star
6

lifecycled

A daemon for responding to AWS AutoScaling Lifecycle Hooks
Go
146
star
7

sockguard

A proxy for docker.sock that enforces access control and isolated privileges
Go
143
star
8

frontend

🌏 The front-end application code for https://buildkite.com
JavaScript
137
star
9

ecs-run-task

Run a once-off task on Amazon ECS and stream the output
Go
125
star
10

agent-stack-k8s

Spin up an autoscaling stack of Buildkite Agents on Kubernetes
Go
79
star
11

example-pipelines

A list of all the example Buildkite pipelines for various tools, languages and frameworks
77
star
12

go-buildkite

A Go library for the Buildkite API
Go
67
star
13

buildkite-agent-metrics

A command-line tool (and Lambda) for collecting Buildkite agent metrics
Go
66
star
14

buildkite-agent-scaler

πŸ“ˆA lambda for scaling an AutoScalingGroup based on Buildkite metrics
Go
61
star
15

github-release

A command line utility to create GitHub releases and upload packages
Go
60
star
16

charts

Buildkite Helm Charts repository
Shell
59
star
17

trigger-pipeline-action

A GitHub Action for triggering a build on a Buildkite pipeline.
Shell
58
star
18

terraform-provider-buildkite

Terraform provider for Buildkite
Go
56
star
19

docs

The source files for the Buildkite documentation
Ruby
45
star
20

nodejs-docker-example

An example of how to run a Node.js project in Docker in a Buildkite pipeline
Dockerfile
41
star
21

cloudformation-launch-stack-button-svg

A nice, resolution independent, SVG version of the AWS CloudFormation "Launch Stack" button πŸŽ‰
39
star
22

interpolate

Interpolate $STRINGS in ${OTHER_STRINGS:-true}
Go
32
star
23

python-docker-example

An example of how to run a Python project w/ Docker in a Buildkite pipeline
Dockerfile
32
star
24

pipeline-schema

A JSON schema for Buildkite’s pipeline file format
JavaScript
30
star
25

docker-ssh-env-config

Sets up SSH config files within a container based on environment variables
Shell
30
star
26

buildkite-signed-pipeline

[Deprecated] This is a tool that adds some extra security guarantees around Buildkite's jobs
Go
27
star
27

docker-buildkite-agent

Previous home of buildkite/agent docker image scripts
26
star
28

feedback

Got feedback? Please let us know!
25
star
29

capybara-inline-screenshot

Extends capybara-screenshot with inline image output
Ruby
24
star
30

elastic-ci-stack-s3-secrets-hooks

πŸ•΅οΈβ€β™€οΈ Expose secrets to your buildkite build steps via Amazon S3
Go
24
star
31

on-demand

CloudFormation resources for scheduling On-Demand Buildkite Agents with AWS ECS and AWS Fargate
JavaScript
23
star
32

bash-example

An example repository you can use as a test project with Buildkite
Shell
23
star
33

rails-docker-parallel-example

An example of how to run Rails CI and test steps in parallel with Docker and Buildkite
Ruby
21
star
34

iam-ssh-agent

Keyless SSH Agent for IAM Entities
Rust
20
star
35

golang-docker-example

An example of how to run a Golang project in Docker in a Buildkite pipeline
Go
19
star
36

dynamic-pipeline-example

An example of how to generate dynamic build pipelines in Buildkite
Shell
18
star
37

rspec-buildkite

RSpec failures as Buildkite annotations so you can fix them fast
Ruby
17
star
38

image-builder

Uses EC2 Image Builder to customise AMIs for elastic-ci-stack-for-aws Buildkite agents
JavaScript
16
star
39

test-collector-ruby

Buildkite Test Analytics collector for Ruby test frameworks
Ruby
16
star
40

buildkite-cloudwatch-metrics-publisher

Publish your Buildkite job queue statistics to AWS Cloud Watch for easy EC2 auto-scaling of your build agents
Makefile
16
star
41

elastic-ci-stack-for-aws-ecs

An experiment with AWS SpotFleets and ECS
Go
16
star
42

slack-webhook

An example Slack Outgoing Webhook for Buildkite
JavaScript
16
star
43

homebrew-buildkite

Homebrew formulae for Buildkite software
Ruby
16
star
44

dynamic-build-badges

Dynamic readme badges from your Buildkite build meta-data
JavaScript
16
star
45

anka-packer-images

Packer scripts for building MacOS images for Anka
Shell
15
star
46

python-pipenv-example

An example of how to run a Python project w/ pipenv in a Buildkite pipeline
Python
15
star
47

buildbox-agent-ruby

Buildbox agent written in Ruby
Ruby
14
star
48

build-trace

Generate trace data for a build in Jaeger
Go
13
star
49

heroku-buildkite-agent

A sample Heroku app for running the Buildkite agent on Heroku dynos
13
star
50

test-collector-javascript

Buildkite Test Analytics collectors for JavaScript test frameworks
JavaScript
13
star
51

golang-example

An example on how to test a Golang program using Buildkite
Go
13
star
52

yaml2json

An easy to use command line tool to convert YAML to JSON
Shell
12
star
53

block-step-example

An example of how to include block steps with form fields in your pipeline
Shell
12
star
54

nodejs-example

An example of how to run a Node.js project in a Buildkite pipeline
JavaScript
11
star
55

shellwords

Splits command strings according to POSIX/Batch semantics
Go
11
star
56

bintest

Golang tools for generating mock binaries for that can be orchestrated in realtime for testing
Go
11
star
57

rspec-junit-example

An example pipeline that collects JUnit test failures and annotates a Buildkite build
Ruby
11
star
58

buildkite-fastlane-demo

An example of running Xcode 7 unit, performance and UI tests using Fastlane and Buildkite
Ruby
9
star
59

roko

An easy to use, configurable retry library for Go
Go
9
star
60

statusbot

[ARCHIVED] πŸ€– A status slackbot for interacting with statuspage.io
Go
9
star
61

buildkite-secret-santa-2016

Buildkite’s 2016 Secret Santa Draw, using dynamic build pipelines and Lambda webhook receivers
HTML
9
star
62

elastic-ci-stack-for-ec2-mac

CloudFormation template for Auto Scaling AWS EC2 Mac based Buildkite Agents
Makefile
9
star
63

test-collector-swift

Buildkite Test Analytics collector for Swift XCTest
Swift
9
star
64

migration

[Alpha Version] πŸ› οΈ Based on Compat, a tool to transform pipelines from other CI providers to Buildkite
Ruby
8
star
65

go-pipeline

A way to define and manipulate buildkite pipelines using golang. Used internally by the buildkite-agent, so you know it's good
Go
8
star
66

figma-css-paste

Plugin to paste and apply CSS styles to your objects and frames in Figma
JavaScript
8
star
67

docker-signal-test

A test for whether `docker run` handles signals correctly
Shell
8
star
68

elastic-ci-stack-ssm-secrets-hooks

πŸ•΅οΈβ€β™€οΈ Agent hooks for fetching git credentials from Amazon SSM Parameter Store
Shell
8
star
69

ruby-docker-example

An example of how to run a Ruby project in Docker in a Buildkite pipeline
Ruby
8
star
70

test-engine-client

Buildkite Test Engine Client (bktec) is an open source tool to orchestrate your test suites. It uses your Buildkite Test Engine suite data to intelligently partition and parallelise your tests.
Go
8
star
71

lifx-buildkite-build-light-ruby

An example Ruby Buildkite webhook endpoint for creating a LIFX-powered build light
Ruby
8
star
72

dependent-pipeline-example

An example of how to trigger Buildkite pipelines from other pipelines
7
star
73

annotation-tester

πŸ“ Test writing Buildkite annotation bodies directly
7
star
74

buildkite-anka-example

An example of running builds in an Anka VM
Shell
7
star
75

conditional

A small language for conditionals
Go
7
star
76

rails-parallel-example

An example of how to run Rails CI and test steps in parallel with Buildkite
Ruby
7
star
77

starter

An example pipeline to get started with Buildkite Pipelines.
7
star
78

demokite

A starter Buildkite repository showcasing some of Buildkite’s features using Dynamic Pipelines
Shell
6
star
79

compat

A tool to transform pipelines from other CI providers to Buildkite
Ruby
6
star
80

bazel-example

An example of how to run a Bazel project in a Buildkite pipeline https://github.com/buildkite/example-…
C++
6
star
81

test-collector-python

Python adapter for Buildkite Test Analytics
Python
6
star
82

graphql-explorer

Buildkite's GraphQL Explorer
JavaScript
6
star
83

simplecov-buildkite

Generate Buildkite annotations from your SimpleCov coverage reports when running your build on Buildkite
Ruby
6
star
84

test-collector-rust

Rust adapter for Buildkite Test Analytics which implements a parser and sender for Rust's JSON test output
Rust
6
star
85

codebuild-run-build

Runs Codebuild Build and streams the output via Cloudwatch Logs.
Go
6
star
86

docker-bootstrap-example

🐳Run your buildkite builds inside an ephemeral per-job container
Shell
5
star
87

deploy-confirm-block-step-example

An example Buildkite pipeline that uses dynamic steps to confirm deployments on Fridays
Shell
5
star
88

slack-slash-command

An example Slack Slash Command for Buildkite
JavaScript
5
star
89

kitesocial

A super basic not-Twitter, for interviews. DO NOT FORK: clone to your machine only.
Ruby
5
star
90

agent-tests

Various scripts to test Buildkite Agent
Shell
5
star
91

lifx-buildkite-build-light-webtask

An example Webtask webhook endpoint for creating a LIFX-powered build light with Buildkite
JavaScript
5
star
92

maven-example

This example uses Maven to run tests, build a package, and then uploads the package as a Buildkite artifact using the current stable Buildkite Agent
Java
5
star
93

ruby-rbenv-example

An example of how to run a Ruby project w/ rbenv in a Buildkite pipeline
Ruby
5
star
94

test-collector-android

Buildkite Test Analytics collector for Android test frameworks
Kotlin
4
star
95

lifx-buildkite-build-light-node

An example Node.js Buildkite webhook endpoint for creating a LIFX-powered build light
JavaScript
4
star
96

polyglot-co-demo-lambda

Lambda services for https://github.com/buildkite/polyglot-co-demo-lambda
JavaScript
4
star
97

build-status-badge-themes

The library of themes you can use to spruce up your Buildkite build status badges
4
star
98

github-webhook-rotate

A utility for rotating the pipeline webhooks used by github triggering builds
Go
4
star
99

screencast-examples

Example pipelines from the Buildkite screencast series
JavaScript
4
star
100

bash-parallel-example

An example of how to a bash script in parallel on Buildkite
Shell
4
star