Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Publishing] Load ES image for ftest from DRA artifact #2979

Merged
merged 5 commits into from
Nov 19, 2024

Conversation

jedrazb
Copy link
Member

@jedrazb jedrazb commented Nov 19, 2024

Closes https://github.com/elastic/search-team/issues/8273

Changes

This PR updates the functional test pipeline to download and load es docker images from DRA artifacts instead of relying on the snapshot image in the registry. This ensures compatibility during the release process when the ES snapshot image is not yet available in the elastic docker registry.

Changes:

  • Resolves the appropriate ES tarball URL based on the architecture (see available arch) using the Elasticsearch DRA manifest.
  • Removed Kibana and Enterprise Search from docker-compose.yml fixtures as they are not required for our ftests.

Validation:

  • Tested manually different versions
  • How you can validate? Go to buildkite build and check e.g. smoke test steps to confirm that the image is coming from DRA artifact

Error handling

  • Added a lot of logs to make sure that we know why we failed, e.g. when we need to produce an artifact and ES still not produced one we will see message like:
+++ curl -sS -f https://artifacts-snapshot.elastic.co/elasticsearch/latest/9.0.1-SNAPSHOT.json
++ RESPONSE='curl: (22) The requested URL returned error: 404'
++ CURL_EXIT_CODE=22
++ '[' 22 -ne 0 ']'
++ echo 'Error: Failed to fetch DRA manifest for artifact elasticsearch and version 9.0.1-SNAPSHOT.'

@jedrazb jedrazb marked this pull request as ready for review November 19, 2024 11:13
@jedrazb jedrazb requested a review from a team as a code owner November 19, 2024 11:13
load_docker_image "$DOCKER_TARBALL_NAME"

# Export image name following DRA conventions
export ELASTICSEARCH_DRA_DOCKER_IMAGE="elasticsearch:$ARCH"
Copy link
Member

Choose a reason for hiding this comment

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

How well would that work if you run ftests locally on different branches (9.0 and 8.x) for example?

Since there's no version it can have weird conflicts, right? Or is it resolved somewhere else?

Copy link
Member Author

@jedrazb jedrazb Nov 19, 2024

Choose a reason for hiding this comment

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

It works well, I tried it with e.g. 8.16

We are fetching the manifest for the right version that depends on the connector version (in the VERSION file) see this line https://github.com/elastic/connectors/pull/2979/files#diff-2c88fda54d210cfb99f46dd547063eb3b88f8f41296ce60881535313cd7b281cR105 and you can backtrack where the version variable comes from.

Unfortunately the elasticsearch images loaded from tarball do not have the "stack version" tag, instead they are just in format elasticsearch:{aarch64|x86_64}, so this is why we reference image in such a way.

But given that we are fetching it from the right manifest URL it is the correct version.

Copy link
Member Author

@jedrazb jedrazb Nov 19, 2024

Choose a reason for hiding this comment

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

E.g. this is for SPO ftests in 9.0.0, note the ES img created by DRA is only 1 hr old

Screenshot 2024-11-19 at 13 07 35

Copy link
Member Author

@jedrazb jedrazb Nov 19, 2024

Choose a reason for hiding this comment

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

If you run first on main branch, then checkout to 8.16 and run ftest again, the docker load will override the the image for your arch and the logs will show:

[FMWK][12:10:39][INFO] Elasticsearch 8.16.0-SNAPSHOT and Connectors 8.16.0 are compatible

( I tried this sequence of steps locally by tweaking the version in the file) so no weird conflicts

Copy link
Member

@artem-shelkovnikov artem-shelkovnikov left a comment

Choose a reason for hiding this comment

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

🚀 🌕

@jedrazb
Copy link
Member Author

jedrazb commented Nov 19, 2024

@seanstory 👋 you might want to take a look as well as you have been involved with onboarding connectors to DRA

@jedrazb jedrazb enabled auto-merge (squash) November 19, 2024 15:09
@jedrazb jedrazb merged commit fd20eed into main Nov 19, 2024
2 checks passed
@jedrazb jedrazb deleted the jedrazb-fix-chicken-egg-problem-on-release branch November 19, 2024 15:39
Copy link

💔 Failed to create backport PR(s)

Status Branch Result
8.x Commit could not be cherrypicked due to conflicts

To backport manually run:
backport --pr 2979 --autoMerge --autoMergeMethod squash

jedrazb added a commit that referenced this pull request Nov 19, 2024
(cherry picked from commit fd20eed)

# Conflicts:
#	tests/ftest.sh
@jedrazb
Copy link
Member Author

jedrazb commented Nov 19, 2024

💚 All backports created successfully

Status Branch Result
8.x

Note: Successful backport PRs will be merged automatically after passing CI.

Questions ?

Please refer to the Backport tool documentation

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