Skip to content

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Oct 1, 2025

Release notes

[rn:skip]

What does this PR do?

Previously we would build an image (which would not actually be used), build dockerfiles, modify dockerfiles to curl from
https://snapshots.elastic.co/downloads/logstash' then build the image used for testing based on the modified dockerfile. This resulted in testing the last published image to snapshots. This presents two problems 1. The test is running against the last published image (not the tip of the branch being tested) 2. this carries a dependency on both a DRA and unified stack release having been run. Therefor acceptance tests will fail in between the time we bump logstash version and a successful run of unified release.

For docker acceptance tests three steps were performed:

  1. Build container images (based on local artifacts)
  2. Build "public" dockerfiles
  3. Build container based on (a modified) file from step 2.

The ONLY difference between the dockerfile that ultimately is used to define an image between 1 and 2 is WHERE the logstash source is downloaded from. In acceptance testing we WANT to use the source at the current checkout of logstash (not a remote). Using remote causes a dependency issue when changes are not published. Publishing is tied to unified release and gated on tests so naturally this is a bad fit for that dependency.

This commit removes the redundancy by ONLY generating images for testing (step 1 from above). This also firms up our use of LOCAL_ARTIFACTS. Namely, the ONLY time we want that set to false is when we build a "public" dockerfile. We explicitly set that in the corresponding DRA script now. Similarly we explicitly set it to true when testing.

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

How to test this PR locally

You can run the test locally with:

# Set arch appropriately (i've got a mac with arm)
ARCH="aarch64"
ci/docker_acceptance_tests.sh full

Related issues


This is an automatic backport of pull request #18181 done by [Mergify](https://mergify.com).

…ce testing (#18181)

* Use locally build artifact to build container from public dockerfile

Previously we would build an image (which would not actually be used), build
dockerfiles, modify dockerfiles to curl from
`https://snapshots.elastic.co/downloads/logstash'` then build the image used for
testing based on the modified dockerfile. This resulted in testing the last
published image to `snapshots`. This presents two problems 1. The test is
running against the last published image (not the tip of the branch being
tested) 2. this carries a dependency on both a DRA and unified stack release
having been run. Therefor acceptance tests will fail in between the time we bump
logstash version and a successful run of unified release.

This commit modifies the dockerfile to use the artifact prepared in the first
step instead of curling the last published one. This solves both issues as the
tests run against the code from the tip fo the branch being tested and there is
no dependency on an artifact existing as a result of a unified release pipeline.

* Remove redundant docker steps from workflows

Previously for docker acceptance tests three steps were performed: 1. Build
container images (based on local artifacts) 2. Build "public" dockerfiles 3.
Build container based on (a modified) file from step 2. The ONLY difference
between the dockerfile that ultimately is used to define an image between 1 and
2 is WHERE the logstash source is downloaded from. In acceptance testing we WANT
to use the source at the current checkout of logstash (not a remote). Using
remote causes a dependency issue when changes are not published. Publishing is
tied to unified release and gated on tests so naturally this is a bad fit for
that dependency.

This commit removes the redundancy by ONLY generating images for testing (step 1
from above). This also firms up our use of LOCAL_ARTIFACTS. Namely, the ONLY
time we want that set to `false` is when we build a "public" dockerfile. We
explicitly set that in the corresponding DRA script now. Similarly we explicitly
set it to `true` when testing.

* Remove unused function and argument

This commit removes the unused function for building from dockerfiles.
It also removes an unused argument for the make task for build_docker.

(cherry picked from commit a994c7c)

# Conflicts:
#	docker/Makefile
#	rakelib/artifacts.rake
Copy link
Contributor Author

mergify bot commented Oct 1, 2025

Cherry-pick of a994c7c has failed:

On branch mergify/bp/8.18/pr-18181
Your branch is up to date with 'origin/8.18'.

You are currently cherry-picking commit a994c7cb.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .buildkite/scripts/dra/build_docker.sh
	modified:   ci/docker_acceptance_tests.sh

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   docker/Makefile
	both modified:   rakelib/artifacts.rake

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@elasticmachine
Copy link
Collaborator

💚 Build Succeeded

History

cc @donoghuc

Copy link
Contributor Author

mergify bot commented Oct 6, 2025

This pull request has not been merged yet. Could you please review and merge it @donoghuc? 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants