Skip to content

Conversation

@reakaleek
Copy link
Member

@reakaleek reakaleek commented Feb 20, 2023

Details

jruby docker image building is failing silently for an unknown time already.

This PR fixes building the docker images and exits with the correct exit codes.

Context

To run CI checks you need to do a docker login because the tests are utilising docker images hosted in docker.elastic.co/observability-ci.

However, in GH workflows created from forked PRs, we cannot access secrets.

While trying to publish the images in docker hub, I noticed that the images are failing.

How to test

Run following script. Modify Dockerfile or tests to get an error exit code.

cd .ci/docker/jruby export EXCLUDE=7-jdk ./run.sh --action build --registry 'elasticobservability123' echo $? ./run.sh --action test --registry 'elasticobservability123' echo $?

⚠️ This only works on amd64 machines.

Related Issues

@ghost
Copy link

ghost commented Feb 20, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview previewSnapshots

Expand to view the summary

Build stats

  • Start Time: 2023-03-08T09:38:52.986+0000

  • Duration: 19 min 29 sec

Test stats 🧪

Test Results
Failed 0
Passed 43609
Skipped 77
Total 43686

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

  • run benchmark tests : Run the benchmark test.

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

@reakaleek reakaleek force-pushed the feature/fix-docker-images branch from daf6cef to 68ebe05 Compare February 20, 2023 15:41
@reakaleek
Copy link
Member Author

reakaleek commented Feb 20, 2023

Hi @estolfo,

I was able to make the docker building work for most images, but not for 7-jdk.
Since I saw some commits from you here and there, I was hoping that you can help me here.

This is the actual error message I get when running:

$ docker build -t test -f .ci/docker/jruby/7-jdk/Dockerfile . ... => ERROR [5/8] RUN gem install bundler rake net-telnet xmlrpc tzinfo-data 0.5s ------ > [5/8] RUN gem install bundler rake net-telnet xmlrpc tzinfo-data: #0 0.429 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/jruby/Main : Unsupported major.minor version 52.0 #0 0.432	at java.lang.ClassLoader.findBootstrapClass(Native Method) #0 0.433	at java.lang.ClassLoader.findBootstrapClassOrNull(ClassLoader.java:1078) #0 0.433	at java.lang.ClassLoader.loadClass(ClassLoader.java:419) #0 0.434	at java.lang.ClassLoader.loadClass(ClassLoader.java:417) #0 0.435	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:323) #0 0.436	at java.lang.ClassLoader.loadClass(ClassLoader.java:363) #0 0.436	at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482) 

cc @elastic/apm-agent-ruby, @elastic/observablt-ci

@ghost
Copy link

ghost commented Feb 20, 2023

🌐 Coverage report

Name Metrics % (covered/total) Diff
Packages 100.0% (1/1) 💚
Files 99.237% (130/131) 👍
Classes 99.237% (130/131) 👍
Lines 57.1% (2469/4324) 👍
Conditionals 100.0% (0/0) 💚
@reakaleek reakaleek self-assigned this Feb 20, 2023
@v1v
Copy link
Member

v1v commented Feb 20, 2023

#0 0.429 Exception in thread "main" java.lang.UnsupportedClassVersionError: org/jruby/Main : Unsupported major.minor version 52.0

That's likely related to the unmatch version in the current JDK and the version required by JRuby, in other words, jruby might require a higher JDK version.

I'd say to remove the support for jdk7 since it reached EOL summer last year as per https://blogs.oracle.com/java/post/java-se-7-end-of-extended-support-in-july-2022

Though, I don't know if that's something feasible from the support matrix, otherwise, we can remove the docker build generation for jruby-jdk7, but still be used for running the tests in the support matrix

@reakaleek reakaleek requested review from a team March 7, 2023 16:06
@reakaleek reakaleek marked this pull request as ready for review March 7, 2023 16:06
Copy link
Member

@v1v v1v left a comment

Choose a reason for hiding this comment

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

LGTM, but a comment regarding the assertion

@reakaleek reakaleek force-pushed the feature/fix-docker-images branch from f0e7c35 to cc59359 Compare March 8, 2023 08:09
reakaleek and others added 3 commits March 8, 2023 10:36
Co-authored-by: Victor Martinez <victormartinezrubio@gmail.com>
@estolfo
Copy link
Contributor

estolfo commented Mar 9, 2023

hi @reakaleek I'm sorry I missed responding to your messages 2 weeks ago.
I don't follow these changes so well but did you do what @v1v suggested: remove docker build generation for jdk7?

set -o pipefail

# 7-jdk is excluded by default. See https://github.com/elastic/apm-agent-ruby/pull/1367#issuecomment-1437228929
EXCLUDE=("7-jdk")
Copy link
Member Author

@reakaleek reakaleek Mar 9, 2023

Choose a reason for hiding this comment

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

@estolfo regarding your question in #1367 (comment)

I did not remove it, but I excluded it by default.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok, so does that mean the test matrix will continue to use the last created jdk7 docker image?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, the docker image is kept in the docker registry and can still be used for tests.

Copy link
Contributor

Choose a reason for hiding this comment

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

perfect, thanks for the explanation. LGTM then

@reakaleek reakaleek merged commit 7886850 into elastic:main Mar 9, 2023
@reakaleek reakaleek deleted the feature/fix-docker-images branch March 9, 2023 09:09
jclusso added a commit to jclusso/apm-agent-ruby that referenced this pull request Apr 13, 2023
* elastic/main: (30 commits) docs: remove kibana endpoint (elastic#1381) Update status badge (elastic#1379) Create single status check that can be set as required (elastic#1378) Remove jenkins related precommit hooks (elastic#1380) Migrate Jenkinsfile 2 GH Actions Workflow (elastic#1366) Migrate update specs to updatecli (elastic#1375) v4.6.2 Fixing Faraday::RackBuilder::StackLocked (elastic#1371) Fix jruby docker images (elastic#1367) Update reference to sinatra main (elastic#1373) Update release:update_branch task to reference branch 4.x Add missing docs reference v4.6.1 Add security options to docker containers (elastic#1356) Make sure http status code is set when Faraday Middleware is used (elastic#1368) Use composite action for updatecli workflow (elastic#1365) Fix sha source in updatecli update-specs.yml (elastic#1363) Add update-specs updatecli workflow (elastic#1359) use jruby user to run docker containers (elastic#1355) Close the read pipe at the right moment (elastic#1351) ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

3 participants