Skip to content

Conversation

donoghuc
Copy link
Member

@donoghuc donoghuc commented Aug 15, 2025

Release notes

[rn:skip]

What does this PR do?

Previously when doing platform specific builds (x86_64, arm) BOTH sets of artifacts were produced regarless of host. This increases CI run times and is needless resource consumption. This commit makes the rake tasks compile artifacts for only the host arch it is being run on.

Why is it important/What is the impact to the user?

N/A

Checklist

  • My code follows the style guidelines of this project
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • I have made corresponding change to the default configuration files (and/or docker env variables)
  • I have added tests that prove my fix is effective or that my feature works

Related issues

@github-actions
Copy link
Contributor

🤖 GitHub comments

Expand to view the GitHub comments

Just comment with:

  • run docs-build : Re-trigger the docs validation. (use unformatted text in the comment!)

@mergify
Copy link
Contributor

mergify bot commented Aug 15, 2025

This pull request does not have a backport label. Could you fix it @donoghuc? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-8./d is the label to automatically backport to the 8./d branch. /d is the digit.
  • If no backport is necessary, please add the backport-skip label

@donoghuc donoghuc added the backport-active-all Automated backport with mergify to all the active branches label Aug 15, 2025
@donoghuc
Copy link
Member Author

@donoghuc
Copy link
Member Author

donoghuc commented Aug 21, 2025

Note the difference between preparing container artifacts vs system packages. For system packages we can compile artifacts all on x86, then be careful to package a java runtime that itself has been compiled for the target arch. Therefore for system packages we only need an x86 host to prepare packages for both target architectures.

For container artifacts we need to actually prepare the artifacts on a system that matches the target arch. In these cases we need hosts with both architectures.

So generally we use three hosts

  1. x86 for preparing system packages for both arch types
  2. x86 for preparing x86 containers
  3. arm for preparing arm containers.

The goal of this PR is given that system, compile/prepare the minimum set of artifacts for what each of those 3 runners are building for.

In order to speed things up (and generally for logical organization) it makes sense to make 4 test runners (a new one for compiling system packages for arm).

  1. x86 for preparing system packages for x86
  2. x86 for preparing system packages for arm (note: eventually we could use arm here if we want)
  3. x86 for preparing x86 containers
  4. arm for preparing arm containers.

This extra host allows parallelization of x86 and arm artifacts.

@donoghuc donoghuc force-pushed the stop-duplicating-builds branch from daf9d81 to 6a80cc0 Compare August 21, 2025 18:36
@donoghuc
Copy link
Member Author

Very promising build result, system packaging took 30 mins (usually its around 50) and docker images took ~20 (usually around 30).

https://buildkite.com/elastic/logstash-dra-snapshot-pipeline/builds/3581#_

Copy link
Contributor

@mashhurs mashhurs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Reasonable parallelism changes.

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.
This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.
@donoghuc donoghuc force-pushed the stop-duplicating-builds branch from 6a80cc0 to 8003774 Compare August 28, 2025 19:24
@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

@elastic-sonarqube
Copy link

Quality Gate passed Quality Gate passed

Issues
0 New issues
0 Fixed issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarQube

@donoghuc donoghuc merged commit f2e4948 into elastic:main Aug 28, 2025
13 checks passed
@github-actions
Copy link
Contributor

@Mergifyio backport 8.17 8.18 8.19 9.0 9.1

@mergify
Copy link
Contributor

mergify bot commented Aug 28, 2025

backport 8.17 8.18 8.19 9.0 9.1

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Aug 28, 2025
* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake
mergify bot pushed a commit that referenced this pull request Aug 28, 2025
* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake
mergify bot pushed a commit that referenced this pull request Aug 28, 2025
* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	rakelib/artifacts.rake
mergify bot pushed a commit that referenced this pull request Aug 28, 2025
* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake
mergify bot pushed a commit that referenced this pull request Aug 28, 2025
* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake
donoghuc added a commit to donoghuc/logstash that referenced this pull request Aug 29, 2025
With the improvment in elastic#17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.
donoghuc added a commit to donoghuc/logstash that referenced this pull request Aug 29, 2025
With the improvment in elastic#17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…8079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests
donoghuc added a commit that referenced this pull request Sep 2, 2025
…st arch (#18071)

* Build artifacts only for those that match host arch (#17995)

* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake

* fix merge conflicts

* Ensure acceptance test artifacts are being built for correct arch (#18079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests

---------

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Sep 2, 2025
…st arch (#18073)

* Build artifacts only for those that match host arch (#17995)

* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	rakelib/artifacts.rake

* fix merge conflicts

* Ensure acceptance test artifacts are being built for correct arch (#18079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests

---------

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Sep 2, 2025
…t arch (#18074)

* Build artifacts only for those that match host arch (#17995)

* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake

* fix merge conflicts

* Ensure acceptance test artifacts are being built for correct arch (#18079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests

---------

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Sep 2, 2025
…t arch (#18075)

* Build artifacts only for those that match host arch (#17995)

* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake

* fix merge conflicts

* Ensure acceptance test artifacts are being built for correct arch (#18079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests

---------

Co-authored-by: Cas Donoghue <[email protected]>
donoghuc added a commit that referenced this pull request Sep 2, 2025
…st arch (#18072)

* Build artifacts only for those that match host arch (#17995)

* Build artifacts only for those that match host arch

Previously when doing platform specific builds (x86_64, arm) BOTH sets of
artifacts were produced regarless of host. This increases CI run times and
is needless resource consumption. This commit makes the rake tasks compile
artifacts for only the host arch it is being run on.

* set ARCH for building observabilitysre image

* Parallelize system package steps across different build hosts

This follows the pattern for prepping docker artifacts by preparing artifacts
for a target architecture on a specific build host. This allows us to process
x86 and arm packages in parallel across builders. Note that there is no
requirement today for the system packages to be built on an arch that matches
the target, spearating out to a separate builder opens up that opportunity for
us though.

(cherry picked from commit f2e4948)

# Conflicts:
#	.buildkite/pull_request_pipeline.yml
#	rakelib/artifacts.rake

* fix merge conflicts

* Ensure acceptance test artifacts are being built for correct arch (#18079)

* Ensure acceptance test artifacts are being built for correct arch

With the improvment in #17995 we only
build packages that match the architecture of the host. This is specified with
an enviornment variable. Previously the acceptance tests did not need to
specifcy the architecture when building packages. This commit updates the
builder to build packages with the correct arch.

* Ensure ARCH is set for docker acceptance tests

* fix merge conflict

---------

Co-authored-by: Cas Donoghue <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport-active-all Automated backport with mergify to all the active branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants