Skip to content

Instantly share code, notes, and snippets.

View lox's full-sized avatar

Lachlan Donald lox

View GitHub Profile
@lox
lox / README.md
Created November 1, 2018 22:04
Test disabling http2

Based on golang/go#13598, I should be able to disable the http2 client with:

GODEBUG=h2client=0 go run get.go
@lox
lox / pipeline.yml
Last active October 18, 2018 05:38
Example of docker plugin for windows
steps:
- command: echo hello world
agents:
queue: "${BUILDKITE_AGENT_META_DATA_QUEUE:-default}"
plugins:
- "docker#d2c3221":
image: "microsoft/windowsservercore:ltsc2016"
debug: true
@lox
lox / pipeline.yml
Last active October 8, 2018 06:18
Example pipeline with concurrency of docker plugin
steps:
- command: echo hello world
parallelism: 4
plugins:
- docker#v1.4.0:
image: "alpine:latest"
@lox
lox / bash_parser.sh
Last active September 24, 2018 03:37
Quoted string parsing in bash
#!/bin/bash
set -euo pipefail
input="$(cat <&0)"
if [[ "${COMPARE_EVAL:-}" == "1" ]] ; then
printf 'parsing of args with native bash eval:\n\n'
eval "array=($input)"
for token in "${array[@]}"; do
printf '[%q]\n' "$token"
@lox
lox / pipeline.yml
Created August 28, 2018 04:10
Kitewrk example pipeline
steps:
- command: sleep 60
@lox
lox / README.md
Last active November 12, 2018 15:02
Troubleshooting Performance Issues with M5.large Instances

Overview

We have an autoscaling group of m5.large instances with 250GB EBS root volumes that we use for running our Buildkite test suites. This group scales up from 0 to 40 during the work day and then down again, so each day we see new instances.

We've been seeing every few days that a few of the instances run very, very slowly. Our test suite either takes 100x it's usual time or times out entirely. On the host machine, a basic command like aws s3api head-object --bucket blah --key blah will take 45 seconds.

All instances are m5.large in us-east-1 running the latest Amazon Linux 2 ami-06631de3819cb42f3

Tests

@lox
lox / Dockerfile
Last active August 6, 2018 02:23
Pipeline for testing passing an ssh-agent socket to docker-compose
FROM lgatica/openssh-client:latest
@lox
lox / pipeline.yml
Created June 25, 2018 14:13
Example of running docker-compose plugin
steps:
- command: test.sh
plugins:
docker-compose#v2.4.1:
run: app
@lox
lox / README.md
Created June 14, 2018 09:21
binproxy

Often inside a docker container one wants to run specific commands on the host. binproxy provides a way to allow specific command invocations inside a docker container that proxies to commands on the host:

commands:
  buildkite-agent:
    parameters:
      - regexp: '^meta-data (set|get)'
    env:
      - BUILDKITE_AGENT_ACCESS_TOKEN
@lox
lox / get-artifacts-from-triggered-build.sh
Last active May 22, 2018 02:50
Test passing artifacts between triggered builds
#!/bin/bash
buildkite-agent artifact download test.txt .
cat test.txt