Skip to content

Commit

Permalink
[CI] use kibana_install_dir from built artifacts (#191909)
Browse files Browse the repository at this point in the history
## Summary
I noticed recently, that the step "Copying ES Snapshot cache" got
cancelled due to a lost agent. On closer inspection, it leads to the
changed file (`.buildkite/scripts/steps/functional/osquery_cypress.sh`)
where with a note, there's a kibana rebuild. Unless there's something
special in that rebuild, we should be using the artifacts built in the
build step.

So let's follow the TODO notes, and use the downloaded artifacts - this
should save ~6m per step where the osquery tests were warmed up.

## Before
From
[on-merge#49584](https://buildkite.com/elastic/kibana-on-merge/builds/49584),
running the pre-PR version:
- You can see, after the copying of es snapshot cache, the command to
build kibana's plugins is ran, taking 6+ minutes
<img width="1626" alt="Screenshot 2024-09-02 at 16 25 43"
src="https://github.com/user-attachments/assets/f3da1966-c036-483d-b984-31f3432a5814">

## After
This is on the [PR
build](https://buildkite.com/elastic/kibana-pull-request/builds/231455#0191b2cc-f8be-410d-860d-59ab9f984477):
- You can see, the es snapshot cache update is only 6 sec, after that,
we can get going with the testing
<img width="1605" alt="Screenshot 2024-09-02 at 16 28 10"
src="https://github.com/user-attachments/assets/30fb66ed-f319-44e1-ae77-978de230e2f9">

## Results
On a primitive comparison between the PR build
(https://buildkite.com/elastic/kibana-pull-request/builds/231505) and an
on-merge run
(https://buildkite.com/elastic/kibana-on-merge/builds/49598) we've
**saved on average 9 minutes per runs** of `Osquery Cypress Tests`. We
can only say more adequate savings once we compare on-merge with
on-merge, but it can be estimated this would be **16 x 9 minutes = 144
minutes** (16 = 8 osquery cypress + 8 osquery serverless cypress) per
on-merges.
  • Loading branch information
delanni authored Sep 4, 2024
1 parent 4a59b49 commit 00230cf
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 13 deletions.
6 changes: 1 addition & 5 deletions .buildkite/scripts/steps/functional/osquery_cypress.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

# TODO: remove the line below to use build artifacts for tests.
# in addition to remove the line, we will have to expose the kibana install dir into the downloaded build location
# by exporting a var like:
# export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}
node scripts/build_kibana_platform_plugins.js
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

export JOB=kibana-osquery-cypress

Expand Down
5 changes: 2 additions & 3 deletions .buildkite/scripts/steps/functional/osquery_cypress_burn.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

set -euo pipefail

source .buildkite/scripts/common/util.sh
source .buildkite/scripts/steps/functional/common.sh

.buildkite/scripts/bootstrap.sh
node scripts/build_kibana_platform_plugins.js
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

export JOB=kibana-osquery-cypress

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@ set -euo pipefail

source .buildkite/scripts/steps/functional/common.sh

# TODO: remove the line below to use build artifacts for tests.
# in addition to remove the line, we will have to expose the kibana install dir into the downloaded build location
# by exporting a var like:
# export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}
node scripts/build_kibana_platform_plugins.js
export KIBANA_INSTALL_DIR=${KIBANA_BUILD_LOCATION}

export JOB=kibana-osquery-cypress-serverless

Expand Down

0 comments on commit 00230cf

Please sign in to comment.