Commit graph

41 commits

Author SHA1 Message Date
Mashhur
4a379be6d5
Fix the git branch check for snyk bk jobs (#16062)
* Replace 'git show-ref' with 'git rev-parse' to fix the issue where show-ref is not working as expected.
* Use git checkout instead 'git rev-parse'.
* Apply prune dependencies recommended for big projects (like we have multi gradle projects) by Snyk.
* Apply prune repeated dependency option directly to snyk monitor.
* Avoid the exit, continue scanning to the end.
* Remove the debugging.
2024-04-08 11:34:26 +01:00
Dimitrios Liappis
c0c213d17e
Split java/ruby unit test steps on Windows (#15888)
As a follow up to #15861 this commit splits the current unit tests step
for the Windows JDK matrix pipeline to two that run
Java and Ruby unit tests separately.

Closes https://github.com/elastic/logstash/issues/15566
2024-03-11 09:27:11 +02:00
Dimitrios Liappis
2fc3f4c21f
Add retries to acceptance/docker steps in BK (#15901)
Similarly to #15874, this commit adds retries
to another group, the acceptance/docker to reduce
build noise from transient issues.
2024-02-06 15:10:13 +02:00
Dimitrios Liappis
fedcf58c48
Add Debian 12 to CI (#15895)
This commit adds Debian 12 (Bookworm) to the
Linux JDK matrix pipeline and Compat Phase of the
exhaustive pipeline respectively.

Relates https://github.com/elastic/ingest-dev/issues/2871
2024-02-05 18:49:30 +02:00
Dimitrios Liappis
8ac55184b8
Allow running Java+Ruby tests on Windows separately (#15861)
This commit allows separate running of Java and Ruby tests on Windows i.e. the same way as we currently do on unix (unit_tests.sh) via a cli argument.
If no argument has been supplied, both tests are run (as it does now).

The wrapper script is also rewritten from old batch style script to Powershell.

This work allows us to split the existing Windows CI job in a subsequent PR to separate steps, as we currently do on Linux.

Relates: https://github.com/elastic/logstash/issues/15566
2024-02-01 10:04:25 +02:00
Dimitrios Liappis
3b747d86b8
Add retries to JDK matrix pipeline steps (#15877)
This commit adds retries to the steps of the Linux + Windows JDK matrix
pipeline steps to avoid notification noise due to transient network
errors.
2024-01-30 18:02:57 +02:00
Dimitrios Liappis
88a32cca81
Add BK retries to exhaustive/compat steps (#15874)
As a follow up to #15787 we also add Buildkite retries for the
exhaustive pipeline / compatibility group steps to prevent
failures due to flakiness.
2024-01-30 14:33:33 +02:00
Dimitrios Liappis
5ee75803f8
Scheduled runs of exhaustive and aarch64 pipelines (#15850)
This commit adds a schedule to run the exhaustive pipeline
(biweekly, every other Wednesday @2AM UTC) and the aarch64
(weekly, every Monday@2AM UTC).

Closes https://github.com/elastic/ingest-dev/issues/2852
2024-01-28 19:30:02 +02:00
Dimitrios Liappis
3f5b44a1ad
Remove Ubuntu 18.04 from CI jobs (#15855)
Relates https://github.com/elastic/ingest-dev/issues/2849
2024-01-26 17:14:41 +02:00
Dimitrios Liappis
c5cb1fe2ed
Annotate successful DRA builds with summary URL (#15820)
This commit makes the generated DRA URL easily accessible via
a Buildkite annotation.

Closes https://github.com/elastic/ingest-dev/issues/2608
2024-01-22 16:37:18 +02:00
Pavel Zorin
2c83a52380
[CI] Send Java and ruby tests to sonarqube simultaneously (#15810)
* Ruby code coverage with SimpleCov json formatter

* [CI] Send Java and ruby tests to sonarqube simultaneously

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Enabled COVERAGE for ruby tests

* Added compiled classes to artifacts

* Test change

* Removed test changes

* Returned back ENABLE_SONARQUBE condition

* Removed debug line

* Diable Ruby coverage if ENABLE_SONARQUBE is not true

* Run sonar scan on pull requests and onn push to main

* Run sonar can on release branches
2024-01-17 19:04:37 +00:00
Dimitrios Liappis
16c4d8827e
Enable packaging tests in exhaustive pipeline (#15781)
This commit adds the packaging tests (that were refactored in #15696
to not rely on Vagrant) in a new "acceptance" group.

Relates: https://github.com/elastic/ingest-dev/issues/1722
2024-01-12 17:52:06 +02:00
Dimitrios Liappis
fca1fccb66
Add Docker acceptance to exhaustive BK pipeline (#15748)
This commit adds the Docker acceptance tests in the acceptance phase
of the exhaustive tests pipeline.

- Relates: https://github.com/elastic/ingest-dev/issues/1722
2024-01-12 09:02:45 +02:00
Dimitrios Liappis
c8726b79f3
Run BK exhaustive pipeline when code is pushed (#15738)
This commit enables running the exhaustive tests Buildkite pipeline
(i.e. the equivalent to the `main` Jenkins tests) ; the trigger is
code events, i.e. direct pushes, merge commits and creation of new branches.

CI is skipped if changes are only related to files under `docs/`.
2024-01-10 10:18:19 +02:00
Dimitrios Liappis
9538338abb
[ci] Add testing phase to exhaustive tests suite (#15711)
This is the second part of the migration of the exhaustive/main
Jenkins Job to Buildkite. So far we've migrated the "compatibility
phase" and this commit adds the "testing phase"[^1], which is essentially
the same amount of tests that we ran on PR jobs.

Relates https://github.com/elastic/ingest-dev/issues/1722
Depends https://github.com/elastic/logstash/pull/15708

[^1]: For more details, refer to the sequence diagram in https://github.com/elastic/ingest-dev/issues/1722#issuecomment-1824378635
2023-12-21 09:42:14 +02:00
Mashhur
0049717394
So far we are practicing Snyk scan of docker images. Now we can comment docker scan logic to address collected issues later with more experiements. (#15702) 2023-12-20 10:51:20 -08:00
Dimitrios Liappis
06ceef8e13
[ci] Allow schedule to trigger several pipelines (#15703)
This commit enhances the functionality introduced in #15668 and #15700
by allowing a single Buildkite scheduling job to trigger several
pipelines, in addition to multiple branches which it already does.

We rename the env var PIPELINE_TO_TRIGGER to PIPELINES_TO_TRIGGER
which now supports comma separate values.

This enhancement can be useful for pipelines like JDK matrix which
have variants (Linux and Windows) that we want to trigger with a single
scheduling job, thus reducing unnecessary entries in catalog-info.
2023-12-20 10:22:46 +02:00
Dimitrios Liappis
42497edebb
Bug fix for trigger pipeline Buildkite pipeline (#15700)
This commit fixes a few bugs introduced in #15668 related to paths for
the calling script. We also stop limiting the execution only from the
main branch (to facilitate e.g. tests from PRs) and, finally, remove
the async clause, which is not needed, since by default BK steps are
run in parallel.
2023-12-19 13:33:46 +02:00
Dimitrios Liappis
c2eaecce8e
[ci] Remove hardcoded branches from DRA schedule (#15668)
This commit is the first making use of #15627 to remove hard coded
branches for the DRA Snapshot build schedule.

With this pattern, we will only need to keep `ci/branches.json` up to date,
as versions evolve, and not need to update/maintain hard coded branches
in `catalog-info.yaml` anymore.

Once this is verified working, we'll add a corresponding schedule
pipeline (in `catalog.info`) for the JDK matrix job.

Relates: https://github.com/elastic/ingest-dev/issues/2664
2023-12-19 11:42:28 +02:00
Dimitrios Liappis
d42b938f81
[ci] Compatibility tests for Exhaustive suite (#15641)
This commit adds the compatibility tier for the Exhaustive tests suite.
Specifically, we introduce two new groups (running in parallel) for Linux and Windows compat tests.
Linux picks one OS per family from [^] and likewise Windows one of the three available choices from the same file.

We also support manual override, if user chooses to, by setting `LINUX_OS` or `WINDOWS_OS` as env vars in the Buildkite build prompt (in this case there is no randomization, and only one OS can be defined for Linux and Windows respectively).

For example:
```
LINUX_OS=rhel-9
WINDOWS_OS=windows=216
```

Relates:

- https://github.com/elastic/ingest-dev/issues/1722

[^1]: 4d6bd955e6/.buildkite/scripts/common/vm-images.json
2023-11-30 20:28:19 +02:00
Mashhur
1e65f53d68
Use proper BK agent and simplify some operations in Snyk report pipeline. (#15610)
* Use Java installed BK agent and remove unnecessary git clone operation since repo is already cloned.

* Switch back to normal VM since Logstash BK agent doesn't support docker operations.
2023-11-27 09:31:25 -08:00
Dimitrios Liappis
e259e04e53
[ci] Use GCP prod image for Linux JDK matrix job (#15600)
So far we've been using images from the -qa GCP image project throughput
the development of the Logstash Linux JDK matrix pipeline for quicker
iteration.

As we have scheduled weekly builds of those images that promote to
prod[^1] we can now switch to the prod version of the GCP images.

[^1]: https://buildkite.com/elastic/ci-vm-images/builds/2888

Relates https://github.com/elastic/ingest-dev/issues/1725
2023-11-20 17:27:04 +02:00
Dimitrios Liappis
8fa3bd0d7f
[ci] Support amazonlinux for JDK matrix pipeline (#15595)
The last part of the Logstash JDK matrix CI migration from Jenkins to
Buildkite is AmazonLinux 2023.

While we have a working image[^1], this is the only step that requires
a agent that runs on AWS.

This commit refactors the builder to support GCP or AWS agents depending
on the OS.

[^1]: https://github.com/elastic/ci-agent-images/pull/441
2023-11-20 11:32:47 +02:00
Dimitrios Liappis
cd01abb1c7
[ci] Add yaml language server to pipelines (#15590)
Add missing yaml-language-server definition to Buildkite pipeline files
(static and dynamic generated) for consistency and to ease spotting
errors with editors.
2023-11-15 17:47:15 +02:00
Dimitrios Liappis
0ede19a0e1
[ci] JDK matrix Buildkite pipelines (pt 2/Windows) (#15563)
This commit adds JDK matrix Buildkite pipelines for
Windows 2022, 2019 and 2016.

It also makes the groups easier to read (on both Linux and Windows
pipelines) by removing the os-jdk prefix from the job labels.

`testDLQWriterFlusherRemovesExpiredSegmentWhenCurrentHeadSegmentIsEmpty`
fails on Windows Buildkite agents and it's a test issue tracked in
https://github.com/elastic/logstash/issues/15562.

Relates:

- https://github.com/elastic/logstash/pull/15539
- https://github.com/elastic/ingest-dev/issues/1725
2023-11-10 17:25:13 +02:00
Dimitrios Liappis
956bf483f2
[ci] JDK matrix Buildkite pipelines (part 1) (#15539)
This commit is the first part of the migration of JDK matrix tests
from Jenkins to Buildkite. There will be two separate pipelines, for
Linux and Windows.

Linux is currently limited to Ubuntu 22.04 and 20.04, but
additional operating systems will be added outside of the Logstash
repository seamlessly through additional VM images.

Steps are created dynamically and the underlying script is meant to be
common for Linux and Windows. Windows is currently a stub and
will be added in a follow up PR.

Relates:

- https://github.com/elastic/ingest-dev/issues/1725
- https://github.com/elastic/ci-agent-images/pull/424
2023-11-09 09:53:27 +02:00
Dimitrios Liappis
c384190718
[ci] aarch64 Buildkite pipeline part 2 (#15473)
This commit is the follow up PR after #15466, which migrates away
the remaining aarch64 acceptance test Jenkins jobs to Buildkite.

Relates:

- #15466
- https://github.com/elastic/ingest-dev/issues/1724
2023-10-25 18:08:56 +03:00
Dimitrios Liappis
36656de4f0
[ci] aarch64 Buildkite pipeline part 1 (#15466)
This commit is the first part of migrating away the aarch64 Jenkins
jobs to Buildkite. It adds a group of exhaustive test steps in the
aarch64 pipeline.

The java unit tests are temporarily disabled as they run SonarQube
scans which need to be associated with pull requests.

Relates:

https://github.com/elastic/ingest-dev/issues/1724
2023-10-23 15:01:14 +03:00
Dimitrios Liappis
816d7e6b2b
[ci] Add PR it-tests (part 1+2) to Buildkite (#15438)
This commit adds integration tests to the
Buildkite PR pipeline.

Relates:

- https://github.com/elastic/logstash/pull/15437
- https://github.com/elastic/ingest-dev/issues/1721
- https://github.com/elastic/logstash/pull/15279
2023-10-13 17:01:01 +03:00
Dimitrios Liappis
e285425d54
[ci] Commit PR based Java unit tests for Buildkite (#15437)
This commit adds Java unit tests (including sonar scans) to the
Buildkite pull request pipeline.

Relates: https://github.com/elastic/ingest-dev/issues/1721
2023-10-13 10:48:10 +03:00
Dimitrios Liappis
3bfd824f7c
[ci] Initial pull request jobs for buildkite (#15402)
This commit adds a Buildkite resource for pull requests and
the two simple jobs, license checking and ruby unit tests that are
already part of the Jenkins PR multi job setup.

As this is WiP, slack notifications aren't enabled.
2023-10-10 16:39:41 +03:00
Dimitrios Liappis
94dfd4773b
[DRA] Remove wait step in buildkite (#15366)
DRA artifact builds support two optional parameters
`VERSION_QUALIFIER_OPT` and `DRA_DRY_RUN`.  The most important is
`VERSION_QUALIFIER_OPT` which should be provided when `alpha1` or
similar versions need to be built.

Currently, after clicking new build, the pipeline takes ~20s to
assemble the steps and then pauses the job waiting for these options to be
filled (or just accept the empty defaults) and press continue.

I feel that this could be trappy behavior because the majority of the
use cases don't need it, and it's likely that a user manually clicks
build and forgets that they'd need to confirm these parameters later
on, left with a hanging build.

This commit makes the parameters optional. If needed, they should be
defined explicitly as Environment Variables in the New Build prompt,
after expanding the Options section.

The downside of this approach is that when needed, users need to
consult the documentation about the environment variable names.
2023-10-05 10:06:07 +03:00
Dimitrios Liappis
da51a6ac53
[buildkite] DRA staging + snapshot pipelines (#15344)
This commit is the step after #15337 and switches away from the generically named [logstash-dra-pipeline-ci](https://buildkite.com/elastic/logstash-dra-pipeline-ci)
pipeline to two separate pipelines for `snapshot` and `staging`, reflecting the current structure in [Jenkins](https://logstash-ci.elastic.co/view/DRA/).

We define a daily schedule for `snapshot`, but it's commented out for now, until we ramp down the Jenkins job.

Finally, as we've created a dedicated Buildkite team for `logstash`, we place both pipelines under this team.

Relates:

- https://github.com/elastic/ingest-dev/issues/1720
- https://github.com/elastic/logstash/pull/15337
2023-10-02 12:10:59 +03:00
Dimitrios Liappis
05c2627123
[DRA, buildkite] Use GCP vms for package build step (#15356)
We seem to be hitting a weird issue with the psych gem when running in a container:

```
> Task :bootstrap
2023-09-27T15:13:23.844Z [Execution worker Thread 5] WARN FilenoUtil : Native subprocess control requires open access to the JDK IO subsystem
Pass '--add-opens java.base/sun.nio.ch=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED' to enable.
Error Errno::ENOENT, retrying 1/10
No such file or directory - /buildkite/builds/bk-agent-prod-k8s-1695827479442731913/elastic/logstash-dra-pipeline-ci/vendor/bundle/jruby/3.1.0/gems/psych-5.1.0-java/deps.lst
```

This commit works around this problem by running inside a VM. The underlying root cause (and that gradle should be erroring in this case) will be investigated separately.
2023-09-28 11:16:51 +03:00
Dimitrios Liappis
12a98250cb
[DRA,buildkite] Use AWS aarch64 instance type (#15352)
We've spotted network flakiness downloading artifacts with gradle (connection resets) when using GCP/t2a on us-central1.
This commit switches to AWS Graviton instance types for building the aarch64 artifacts.
2023-09-27 16:41:51 +03:00
Dimitrios Liappis
dd77c9f927
[ci] Commit DRA -SNAPSHOT buildkite pipeline (#15337)
This commit adds support for building + publishing DRA (-SNAPSHOT for now) artifacts for Logstash. It builds on top of #15312 and therefore only targets the `main` branch and is intended to be run manually during a trial period before we retire the corresponding Jenkins job.

The structure is similar to Jenkins:

1. Three steps runs in parallel to build packages, x86_64 docker and aarch64 docker artifacts.

2. Once 1. is successfully done, use release manager to publish the artifacts.

We generate the pipeline steps for 1. and 2. dynamically (with a simple Python script) to avoid repetition for future PRs: we will add a new pipeline in a follow up PR for -STAGING.

The actual shell scripts are simplified copies from the existing `dra*` scripts under https://github.com/elastic/logstash/tree/main/ci; the simplification comes from native support for copying artifacts between steps in Buildkite and
not having to use an intermediate bucket.

Relates: https://github.com/elastic/ingest-dev/issues/1720
Blocked by: https://github.com/elastic/ci/pull/2312/files
2023-09-26 16:00:56 +03:00
kaisecheng
0f8695593e
buildkite serverless test (#15150)
This commit adds a Buildkite pipeline to test against serverless endpoint daily

Tests cover 
- es-output
- es-input
- es-filter
- central pipeline management
- legacy monitoring
- dlq
- integration-filter
- kibana API
- metricbeat stack monitoring

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
Co-authored-by: João Duarte <jsvduarte@gmail.com>
2023-07-19 17:21:53 +01:00
Mashhur
07b663561c
Snyk scans Logstash container vulnerabilities. (#15117)
* Snyk scans Logstash container vulnerabilities.

* Exclude integ test and tools when Snyk scanning.

* Remote repo url fix for main branch.

* Update .buildkite/scripts/snyk/report.sh

Simplify the logic to retrieve the version from `versions.yml`

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>

* Add backstage definition for Snyk Report pipeline.

---------

Co-authored-by: kaisecheng <69120390+kaisecheng@users.noreply.github.com>
2023-07-12 14:54:03 -07:00
Mashhur
6f6a446f3c
Install Java on Buildkite Agent. (#15097) 2023-06-22 09:10:33 -07:00
Mashhur
e3b9324602
Read Snyk token from logstash repo scoped vault. (#15096) 2023-06-20 13:29:47 -07:00
Mashhur
9c080eac53
Snyk Integration (#15083)
* This commit includes number of changes:
- adds initial pipeline steps, each step proceeds one branch report job
- a script to resolve current and previous release latest branches from the release URL. Noting that it considers the branches from snapshots where upcoming releases will be our interest.
- pseudo logic to download logstash, build and report to Snyk. In order to script fully work we need a logstash machine to access Buildkite vault, which I am working.

* Source optimization and use Buildkite Vault to access to Snyk token.

* Add git branch and head to Snyk project tag.

* Dynamically resolve latest branches instead of manually defining.

* Update .buildkite/scripts/snyk/report.sh

Improve comment readability.

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>

---------

Co-authored-by: João Duarte <jsvd@users.noreply.github.com>
2023-06-20 08:25:21 -07:00