solana/ci
Michael Vines 7a54dbf7d5 Restore clippy, and run clippy sooner 2018-11-17 15:54:21 -08:00
..
docker-rust Add clang dependency to docker images, update validation checks (#1794) 2018-11-12 19:36:36 -08:00
docker-rust-nightly codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
docker-snapcraft codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
docker-solana Move drone into its own crate 2018-11-16 20:42:21 -08:00
semver_bash Vendor https://github.com/cloudflare/semver_bash/tree/c1133faf0e 2018-08-17 23:15:48 -07:00
.gitignore Package solana as a snap 2018-06-18 17:36:03 -07:00
README.md Include hh:mm in image name 2018-07-09 23:07:07 -06:00
audit.sh set -e shuffling 2018-11-11 16:24:36 -08:00
buildkite-secondary.yml Bump release tarball build timeout (ahem rocksdb) 2018-11-17 08:12:03 -08:00
buildkite.yml Add clang dependency to docker images, update validation checks (#1794) 2018-11-12 19:36:36 -08:00
channel-info.sh codemod --extensions sh '#!/bin/bash' '#!/usr/bin/env bash' 2018-11-11 16:24:36 -08:00
crate-version.sh set -e shuffling 2018-11-11 16:24:36 -08:00
docker-run.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
hoover.sh codemod --extensions sh '#!/bin/bash' '#!/usr/bin/env bash' 2018-11-11 16:24:36 -08:00
is-pr.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
localnet-sanity.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
pr-snap.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
publish-book.sh Avoid extra commit when publishing book 2018-11-17 10:17:52 -08:00
publish-bpf-sdk.sh Publish BPF SDK to a channel-specific URL to ease downstream pickup 2018-11-14 09:36:44 -08:00
publish-crate.sh Move drone into its own crate 2018-11-16 20:42:21 -08:00
publish-solana-tar.sh Move drone into its own crate 2018-11-16 20:42:21 -08:00
run-local.sh set -e shuffling 2018-11-11 16:24:36 -08:00
shellcheck.sh set -e shuffling 2018-11-11 16:24:36 -08:00
snap.sh Fix snap PR builds 2018-11-12 22:24:56 -08:00
snapcraft.credentials.enc Add snapcraft login credentials 2018-06-18 17:36:03 -07:00
solana-testnet.yml Change testnet automation to use TAR instead of snap (#1809) 2018-11-13 13:33:15 -08:00
test-bench.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
test-large-network.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
test-nightly.sh Run BPF tests in CI 2018-11-14 17:16:37 -08:00
test-stable-perf.sh Move drone into its own crate 2018-11-16 20:42:21 -08:00
test-stable.sh Restore clippy, and run clippy sooner 2018-11-17 15:54:21 -08:00
testnet-automation-cleanup.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
testnet-automation-json-parser.py Change format of data for TPS/Finality metrics in testnet automation (#1446) 2018-10-09 10:35:01 -07:00
testnet-automation.sh Change testnet automation to use TAR instead of snap (#1809) 2018-11-13 13:33:15 -08:00
testnet-deploy.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
testnet-manager.sh codemod --extensions sh '#!/usr/bin/env bash -e' '#!/usr/bin/env bash\nset -e' 2018-11-11 16:24:36 -08:00
testnet-sanity.sh Add timeouts 2018-11-17 09:09:25 -08:00
upload_ci_artifact.sh Add Snap fullnode daemon 2018-06-26 12:32:33 -07:00
version-check.sh Add clang dependency to docker images, update validation checks (#1794) 2018-11-12 19:36:36 -08:00

README.md

Our CI infrastructure is built around BuildKite with some additional GitHub integration provided by https://github.com/mvines/ci-gate

Agent Queues

We define two Agent Queues: queue=default and queue=cuda. The default queue should be favored and runs on lower-cost CPU instances. The cuda queue is only necessary for running tests that depend on GPU (via CUDA) access -- CUDA builds may still be run on the default queue, and the buildkite artifact system used to transfer build products over to a GPU instance for testing.

Buildkite Agent Management

Buildkite GCP Setup

CI runs on Google Cloud Platform via two Compute Engine Instance groups: ci-default and ci-cuda. Autoscaling is currently disabled and the number of VM Instances in each group is manually adjusted.

Updating a CI Disk Image

Each Instance group has its own disk image, ci-default-vX and ci-cuda-vY, where X and Y are incremented each time the image is changed.

The process to update a disk image is as follows (TODO: make this less manual):

  1. Create a new VM Instance using the disk image to modify.
  2. Once the VM boots, ssh to it and modify the disk as desired.
  3. Stop the VM Instance running the modified disk. Remember the name of the VM disk
  4. From another machine, gcloud auth login, then create a new Disk Image based off the modified VM Instance:
 $ gcloud compute images create ci-default-$(date +%Y%m%d%H%M) --source-disk xxx --source-disk-zone us-east1-b --family ci-default

or

  $ gcloud compute images create ci-cuda-$(date +%Y%m%d%H%M) --source-disk xxx --source-disk-zone us-east1-b --family ci-cuda
  1. Delete the new VM instance.
  2. Go to the Instance templates tab, find the existing template named ci-default-vX or ci-cuda-vY and select it. Use the "Copy" button to create a new Instance template called ci-default-vX+1 or ci-cuda-vY+1 with the newly created Disk image.
  3. Go to the Instance Groups tag and find the applicable group, ci-default or ci-cuda. Edit the Instance Group in two steps: (a) Set the number of instances to 0 and wait for them all to terminate, (b) Update the Instance template and restore the number of instances to the original value.
  4. Clean up the previous version by deleting it from Instance Templates and Images.

Reference

Buildkite AWS CloudFormation Setup

AWS CloudFormation is currently inactive, although it may be restored in the future

AWS CloudFormation can be used to scale machines up and down based on the current CI load. If no machine is currently running it can take up to 60 seconds to spin up a new instance, please remain calm during this time.

AMI

We use a custom AWS AMI built via https://github.com/solana-labs/elastic-ci-stack-for-aws/tree/solana/cuda.

Use the following process to update this AMI as dependencies change:

$ export AWS_ACCESS_KEY_ID=my_access_key
$ export AWS_SECRET_ACCESS_KEY=my_secret_access_key
$ git clone https://github.com/solana-labs/elastic-ci-stack-for-aws.git -b solana/cuda
$ cd elastic-ci-stack-for-aws/
$ make build
$ make build-ami

Watch for the "amazon-ebs: AMI:" log message to extract the name of the new AMI. For example:

amazon-ebs: AMI: ami-07118545e8b4ce6dc

The new AMI should also now be visible in your EC2 Dashboard. Go to the desired AWS CloudFormation stack, update the ImageId field to the new AMI id, and apply the stack changes.