Skip to content

ci: look for arch-specific snapshots when necessary #977

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

Merged
merged 1 commit into from
Nov 10, 2020

Conversation

yaauie
Copy link
Contributor

@yaauie yaauie commented Nov 6, 2020

Since the 8.x docker images for Logstash are arch-specific (relying on the base install with embedded arch-specific JVM), they no longer will have the same file names we relied on for 7.x causing builds to fail when looking up the URL for the most recent snapshot.

This PR refactors the code that finds the URL for docker image snapshots to find appropriate artifacts, whether the listing includes no-arch or x86_64-arch artifacts. It also adds helpful logging when none of the items can be found, and breaks the code into a function for reuse when loading the elasticsearch image.

Prior to this change, failure to load a URL resulted in a blind error:

null
curl: (6) Could not resolve host: null

After this change, an error looking up the URL will be much more informative:

Downloading snapshot docker artifact: logstash-8.0.0-SNAPSHOT-docker-image
Failed to find 'logstash-8.0.0-SNAPSHOT-docker-image.tar.gz'
Failed to find 'logstash-8.0.0-SNAPSHOT-docker-image-BADARCHINTENTIONALFAILURE.tar.gz'
Listing:
[
  "logstash-8.0.0-SNAPSHOT-docker-image-x86_64.tar.gz",
  "logstash-oss-8.0.0-SNAPSHOT-docker-image-x86_64.tar.gz",
  "logstash-ubi8-8.0.0-SNAPSHOT-docker-image-x86_64.tar.gz"
]
[error: 1] 

@yaauie yaauie force-pushed the ci-arch-in-docker-image-name branch from 2e1d875 to 9250261 Compare November 6, 2020 22:34
@yaauie
Copy link
Contributor Author

yaauie commented Nov 6, 2020

Although this plugin defines its own .ci/docker-setup.sh, it is heavily based on the one defined in .ci project. A matching PR for this exists there: logstash-plugins/.ci#19

Copy link
Contributor

@robbavey robbavey left a comment

Choose a reason for hiding this comment

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

Tests are green - LGTM

Thanks @yaauie!

@yaauie yaauie merged commit ce8f8ce into logstash-plugins:master Nov 10, 2020
@yaauie yaauie deleted the ci-arch-in-docker-image-name branch November 10, 2020 01:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants