solana/ci
Michael Vines 6ac466c0a4 Move src/logger.rs into logger/ crate to unify logging across the workspace 2018-12-14 13:10:43 -08:00
..
docker-rust Upgrade to Rust 1.31.0 (#2052) 2018-12-07 20:01:28 -07:00
docker-rust-nightly
docker-snapcraft
semver_bash
.gitignore
README.md
audit.sh Only run the audit 2018-12-08 23:19:55 -07:00
buildkite-secondary.yml Disable snap build until #2127 is resolved 2018-12-12 15:13:11 -08:00
buildkite.yml Upgrade to Rust 1.31.0 (#2052) 2018-12-07 20:01:28 -07:00
channel-info.sh
crate-version.sh
docker-run.sh
hoover.sh
is-pr.sh
localnet-sanity.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
pr-snap.sh
publish-book.sh
publish-bpf-sdk.sh Move bpf-sdk to sdk/bpf 2018-12-01 10:47:59 -08:00
publish-crate.sh Move src/logger.rs into logger/ crate to unify logging across the workspace 2018-12-14 13:10:43 -08:00
publish-metrics-dashboard.sh
publish-solana-tar.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
run-local.sh
shellcheck.sh
snap.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
snapcraft.credentials.enc
solana-testnet.yml
test-bench.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
test-checks.sh Run checks over all crates in the workspace 2018-12-13 23:40:26 -08:00
test-large-network.sh
test-nightly.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
test-stable-perf.sh stabilize testing with --test-threads=1 2018-11-29 12:54:42 -08:00
test-stable.sh Remove bench_streamer feature 2018-12-13 22:25:27 -08:00
testnet-automation-cleanup.sh
testnet-automation-json-parser.py
testnet-automation.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
testnet-deploy.sh Leader rotation flag plumbing 2018-12-10 14:07:59 -08:00
testnet-manager.sh Switch testnet-edge from snap to tarball 2018-12-11 23:34:41 -08:00
testnet-sanity.sh
upload-ci-artifact.sh Desnake upload_ci_artifact for consistency 2018-12-13 22:25:27 -08:00
version-check-with-upgrade.sh
version-check.sh Upgrade to Rust 1.31.0 (#2052) 2018-12-07 20:01:28 -07: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.