Skip to content

Commit

Permalink
Merge pull request #233 from wellcomecollection/buildkite-evictions
Browse files Browse the repository at this point in the history
Report evictions in buildkite
  • Loading branch information
paul-butcher authored Oct 12, 2023
2 parents 412abbf + 136ed43 commit b427294
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 39 deletions.
117 changes: 78 additions & 39 deletions .buildkite/pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,65 @@ steps:
agents:
queue: "scala"

- label: "test {{ matrix }}"
command: "./builds/run_sbt_tests.sh {{ matrix }}"
matrix:
- "fixtures"
- "http"
- "json"
- "typesafe_app"
- "monitoring"
- "monitoring_typesafe"
- "messaging"
- "messaging_typesafe"
- "storage"
- "storage_typesafe"
- "elasticsearch"
- "elasticsearch_typesafe"
- "sierra"
- group: "Test"
steps:
- label: "test {{ matrix }}"
command: "./builds/run_sbt_tests.sh {{ matrix }}"
matrix:
- "fixtures"
- "http"
- "json"
- "typesafe_app"
- "monitoring"
- "monitoring_typesafe"
- "messaging"
- "messaging_typesafe"
- "storage"
- "storage_typesafe"
- "elasticsearch"
- "elasticsearch_typesafe"
- "sierra"

agents:
queue: "scala"
agents:
queue: "scala"

- group: "Report evictions"
steps:
- label: "evictions {{ matrix }}"
command: "./builds/report_sbt_evictions.sh {{ matrix }}"
soft_fail:
- exit_status: 2
matrix:
- "fixtures"
- "http"
- "json"
- "typesafe_app"
- "monitoring"
- "monitoring_typesafe"
- "messaging"
- "messaging_typesafe"
- "storage"
- "storage_typesafe"
- "elasticsearch"
- "elasticsearch_typesafe"
- "sierra"
agents:
queue: "scala"
artifact_paths:
".reports/evicted*"

- wait

- label: "Collate evictions"
commands:
- "mkdir -p .reports"
- "buildkite-agent artifact download '.reports/evicted_*' .reports/"
- "builds/report_unique_evictions.sh | buildkite-agent annotate --context=evictions"
agents:
queue: nano
- wait


- label: "cut release"
if: build.branch == "main"
commands:
Expand All @@ -35,28 +72,30 @@ steps:

- wait

- label: "publish {{ matrix }}"
if: build.branch == "main"
command: ".buildkite/scripts/publish.py {{ matrix }}"
matrix:
- "fixtures"
- "http"
- "http_typesafe"
- "json"
- "typesafe_app"
- "monitoring"
- "monitoring_typesafe"
- "messaging"
- "messaging_typesafe"
- "storage"
- "storage_typesafe"
- "elasticsearch"
- "elasticsearch_typesafe"
- "sierra"
- "sierra_typesafe"
- group: "Publish"
steps:
- label: "publish {{ matrix }}"
if: build.branch == "main"
command: ".buildkite/scripts/publish.py {{ matrix }}"
matrix:
- "fixtures"
- "http"
- "http_typesafe"
- "json"
- "typesafe_app"
- "monitoring"
- "monitoring_typesafe"
- "messaging"
- "messaging_typesafe"
- "storage"
- "storage_typesafe"
- "elasticsearch"
- "elasticsearch_typesafe"
- "sierra"
- "sierra_typesafe"

agents:
queue: "scala"
agents:
queue: "scala"

- wait

Expand Down
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,6 @@ metals.sbt

.terraform
terraform.plan

# output from code checkers, tests etc.
.reports
2 changes: 2 additions & 0 deletions RELEASE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
RELEASE_TYPE: patch
internal-only build improvements
2 changes: 2 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
val projectVersion = "32.40.0"

Global / excludeLintKeys += composeNoBuild

lazy val fixtures = Common.setupProject(
project,
"fixtures",
Expand Down
9 changes: 9 additions & 0 deletions builds/report_sbt_evictions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
mkdir -p .reports
REPORT_FILE=".reports/evicted_${1}"
./builds/run_sbt_task_in_docker.sh "project $1" "evicted" | grep '^\[warn\]' | tee $REPORT_FILE
WARNING_COUNT=$(cat $REPORT_FILE | grep -E '^\[warn\]\s+\*' | wc -l )
if [ "$WARNING_COUNT" != "0" ]
then
echo "found $WARNING_COUNT suspected binary incompatible eviction(s)"
exit 2
fi
5 changes: 5 additions & 0 deletions builds/report_unique_evictions.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Intended to be run after producing eviction reports with report_sbt_evictions.sh
echo "# Suspected binary incompatible evictions across all projects (summary)"
cat .reports/evicted_* | grep -E '^\[warn\]\s+\*' | sed 's/.*\*/*/' | sort | uniq
echo ""
echo "See individual _evictions_ stages for more detail"

0 comments on commit b427294

Please sign in to comment.