Skip to content

Commit c6f419d

Browse files
committed
WIP fast agents
1 parent 4b7a9bd commit c6f419d

File tree

4 files changed

+53
-0
lines changed

4 files changed

+53
-0
lines changed

.buildkite/scripts/run-agents.sh

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#!/bin/bash
2+
3+
set -euo pipefail
4+
5+
AGENT_WORKSPACE="$(cd .. && pwd)/agent-workspace"
6+
mkdir -p "$AGENT_WORKSPACE"
7+
8+
cp -R .buildkite/scripts/run-agents/hooks "$AGENT_WORKSPACE/"
9+
10+
cd "$AGENT_WORKSPACE"
11+
12+
cp "$BUILDKITE_CONFIG_PATH" .
13+
CONFIG_FILE="$(basename "$BUILDKITE_CONFIG_PATH")"
14+
15+
cat <<EOF >> "$CONFIG_FILE"
16+
build-path=$AGENT_WORKSPACE/builds
17+
disconnect-after-idle-timeout=600
18+
hooks-path=$AGENT_WORKSPACE/hooks
19+
disconnect-after-job=false
20+
cancel-grace-period=300
21+
EOF
22+
23+
buildkite-agent start --queue elasticsearch-quick-agent --spawn-per-cpu 1

.buildkite/scripts/run-agents/git

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/bash
2+
3+
if [[ "${1:-}" == "submodule" ]]; then exit 0; fi
4+
5+
"$ES_ORIGINAL_GIT_BINARY" "${@}"
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
3+
git sparse-checkout init --cone
4+
git sparse-checkout set .buildkite
5+
6+
if [[ -n "${ES_PARTIAL_CHECKOUT_PATHS:-}" ]]; then
7+
git sparse-checkout add "$ES_PARTIAL_CHECKOUT_PATHS"
8+
fi
9+
10+
git checkout HEAD
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
DIR="$(cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd)"
4+
5+
ES_ORIGINAL_GIT_BINARY=$(which git)
6+
export ES_ORIGINAL_GIT_BINARY
7+
8+
mkdir -p "$HOME/git-wrapper"
9+
cp "$DIR/../git" "$HOME/git-wrapper/"
10+
chmod +x "$HOME/git-wrapper/git"
11+
12+
export PATH="$HOME/git-wrapper:$PATH"
13+
14+
export BUILDKITE_GIT_CLONE_FLAGS="-v --filter=blob:none --no-checkout --depth=1 --sparse"
15+
export BUILDKITE_GIT_FETCH_FLAGS="-v --update-shallow"

0 commit comments

Comments
 (0)