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

Unable to pull groovy:latest for arm64v8 #45

Closed
ossdev07 opened this issue Jan 25, 2019 · 11 comments
Closed

Unable to pull groovy:latest for arm64v8 #45

ossdev07 opened this issue Jan 25, 2019 · 11 comments

Comments

@ossdev07
Copy link

Hi,

When I tried to pull groovy: latest docker image on my aarch64v8 platform, then received the error.

root@ps-docker-images-do-not-delete:~# docker run groovy
Unable to find image 'groovy:latest' locally
latest: Pulling from library/groovy
docker: no matching manifest for unknown in the manifest list entries.
See 'docker run --help'.

I tried building the docker image by the dockerfile, then I am getting the error

root@ps-docker-images-do-not-delete:~/shreya/jenkins/docker-groovy/jdk11# docker build -t groovy_jdk11 .
Sending build context to Docker daemon   5.12kB
Step 1/9 : FROM openjdk:11-jdk
 ---> 9a7a57e47f09
Step 2/9 : CMD ["groovysh"]
 ---> Using cache
 ---> 7ec59bc9faae
Step 3/9 : ENV GROOVY_HOME /opt/groovy
 ---> Using cache
 ---> 7e5b391636d8
Step 4/9 : ENV GROOVY_VERSION 2.5.5
 ---> Using cache
 ---> 73855e8aa59c
Step 5/9 : RUN set -o errexit -o nounset     && echo "Downloading Groovy"     && wget --no-verbose --output-document=groovy.zip "https://dist.apache.org/repos/dist/release/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip"         && echo "Installing build dependencies"     && apt-get update     && apt-get update && apt-get install --yes --no-install-recommends         dirmngr         gnupg     && rm --recursive --force /var/lib/apt/lists/*         && echo "Importing keys listed in http://www.apache.org/dist/groovy/KEYS from key server"     && export GNUPGHOME="$(mktemp -d)";     for key in         "7FAA0F2206DE228F0DB01AD741321490758AAD6F"         "331224E1D7BE883D16E8A685825C06C827AF6B66"         "34441E504A937F43EB0DAEF96A65176A0FB1CD0B"         "9A810E3B766E089FFB27C70F11B595CEDC4AEBB5"         "81CABC23EECA0790E8989B361FF96E10F0E13706"     ; do         for server in             "ha.pool.sks-keyservers.net"             "hkp://p80.pool.sks-keyservers.net:80"             "pgp.mit.edu"         ; do             echo "  Trying ${server}";             if gpg --batch --no-tty --keyserver "${server}" --recv-keys "${key}"; then                 break;             fi;         done;     done;     if [ $(gpg --batch --no-tty --list-keys | grep -c "pub ") -ne 5 ]; then         echo "ERROR: Failed to fetch GPG keys" >&2;         exit 1;     fi         && echo "Checking download signature"     && wget --no-verbose --output-document=groovy.zip.asc "https://dist.apache.org/repos/dist/release/groovy/${GROOVY_VERSION}/distribution/apache-groovy-binary-${GROOVY_VERSION}.zip.asc"     && gpg --batch --no-tty --verify groovy.zip.asc groovy.zip     && rm --recursive --force "${GNUPGHOME}"     && rm groovy.zip.asc         && echo "Installing Groovy"     && unzip groovy.zip     && rm groovy.zip     && mv "groovy-${GROOVY_VERSION}" "${GROOVY_HOME}/"     && ln --symbolic "${GROOVY_HOME}/bin/grape" /usr/bin/grape     && ln --symbolic "${GROOVY_HOME}/bin/groovy" /usr/bin/groovy     && ln --symbolic "${GROOVY_HOME}/bin/groovyc" /usr/bin/groovyc     && ln --symbolic "${GROOVY_HOME}/bin/groovyConsole" /usr/bin/groovyConsole     && ln --symbolic "${GROOVY_HOME}/bin/groovydoc" /usr/bin/groovydoc     && ln --symbolic "${GROOVY_HOME}/bin/groovysh" /usr/bin/groovysh     && ln --symbolic "${GROOVY_HOME}/bin/java2groovy" /usr/bin/java2groovy         && echo "Editing startGroovy to include java.xml.bind module"     && sed -i 's|startGroovy ( ) {|startGroovy ( ) {\n    JAVA_OPTS="$JAVA_OPTS --add-modules=ALL-SYSTEM"|' "${GROOVY_HOME}/bin/startGroovy"         && echo "Cleaning up build dependencies"     && echo $(apt-mark showauto)     && apt-get remove --yes --purge         dirmngr         gnupg     && apt-get autoremove --yes --purge         && echo "Adding groovy user and group"     && groupadd --system --gid 1000 groovy     && useradd --system --gid groovy --uid 1000 --shell /bin/bash --create-home groovy     && mkdir --parents /home/groovy/.groovy/grapes     && chown --recursive groovy:groovy /home/groovy         && echo "Symlinking root .groovy to groovy .groovy"     && ln -s /home/groovy/.groovy /root/.groovy
 ---> Using cache
 ---> 25f9da16882c
Step 6/9 : USER groovy
 ---> Using cache
 ---> 3d3a50c0b473
Step 7/9 : VOLUME "/home/groovy/.groovy/grapes"
 ---> Using cache
 ---> 9c98d58524de
Step 8/9 : WORKDIR /home/groovy
 ---> Using cache
 ---> c0b626c0574c
Step 9/9 : RUN set -o errexit -o nounset     && echo "Testing Groovy installation"     && groovy --version
 ---> Running in 4a13944239ce
Testing Groovy installation
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by org.codehaus.groovy.vmplugin.v7.Java7$1 (file:/opt/groovy/lib/groovy-2.5.5.jar) to constructor java.lang.invoke.MethodHandles$Lookup(java.lang.Class,int)
WARNING: Please consider reporting this to the maintainers of org.codehaus.groovy.vmplugin.v7.Java7$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
java.lang.reflect.InvocationTargetException
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.base/java.lang.reflect.Method.invoke(Method.java:566)
        at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:110)
        at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:128)
Caused by: java.lang.UnsatisfiedLinkError:
 Could not load library. Reasons: [no jansi in java.library.path: [/usr/java/packages/lib, /usr/lib/aarch64-linux-gnu/jni, /lib/aarch64-linux-gnu, /usr/lib/aarch64-linux-gnu, /usr/lib/jni, /lib, /usr/lib], /tmp/libjansi-64-10071033082919281516.so: 
/tmp/libjansi-64-10071033082919281516.so: cannot open shared object file: 
No such file or directory (Possible cause: can't load AMD 64-bit .so on a AARCH64-bit platform)]
        at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
        at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
        at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:42)
        at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
        at org.fusesource.jansi.AnsiConsole.<clinit>(AnsiConsole.java:38)
        at java.base/java.lang.Class.forName0(Native Method)
        at java.base/java.lang.Class.forName(Class.java:315)
        at groovyjarjarpicocli.CommandLine$Help$Ansi.isJansiConsoleInstalled(CommandLine.java:9362)
        at groovyjarjarpicocli.CommandLine$Help$Ansi.ansiPossible(CommandLine.java:9358)
        at groovyjarjarpicocli.CommandLine$Help$Ansi.enabled(CommandLine.java:9376)
        at groovyjarjarpicocli.CommandLine$Help$Ansi$Text.toString(CommandLine.java:9728)
        at java.base/java.lang.String.valueOf(String.java:2951)
        at java.base/java.io.PrintStream.println(PrintStream.java:897)
        at groovyjarjarpicocli.CommandLine.printVersionHelp(CommandLine.java:1563)
        at groovyjarjarpicocli.CommandLine.printHelpIfRequested(CommandLine.java:1027)
        at groovyjarjarpicocli.CommandLine.printHelpIfRequested(CommandLine.java:995)
        at groovy.ui.GroovyMain.processArgs(GroovyMain.java:130)
        at groovy.ui.GroovyMain.main(GroovyMain.java:116)
        ... 6 more
The command '/bin/sh -c set -o errexit -o nounset     && echo "Testing Groovy installation"     && groovy --version' returned a non-zero code: 1

The groovy new version - 2.5.5 is getting downloaded, from source https://dist.apache.org/repos/dist/release/groovy/2.5.5/distribution/apache-groovy-binary-2.5.5.zip

The issue with it is the installer is downloading and running libjansi-64-9223060414994503252.so which is architecture specific (to AMD64) - so it fails on arm64v8.

If I try to build the docker image with Groovy Version 2.4, the image gets succesfully build on arm64v8 platform.

Please suggest me, what could be done, to provide the docker official image support on arm64v8 platform for Groovy Version 2.5.

@keeganwitt
Copy link
Member

keeganwitt commented Jan 25, 2019

I had the same question, which I asked on the mailing list. I didn't realize 2.4 was working. I do see 2.4 had Jansi 1.11, whereas the latest 2.5 has Jansi 1.17.1. Though I'm not sure why the older version would work. As far as I know, there has never been a Jansi native package for arm64v8.
Maybe I need to reach out to the Jansi guys for some advice.

@keeganwitt
Copy link
Member

I opened an issue with Jansi to produce jars for these architectures, and I opened a bug report for Debian to fix their Jansi Native packages to include so files for the other architectures -- that would allow me to workaround this issue I believe.

@ossdev07
Copy link
Author

Hi @keeganwitt

Thanks, for the reply 😃

Yes, the problem is that there is no binary (jar) present for jansi and jansi-native for the aarch64 architecture.

I have previously opened a PR in the jansi-native with the changes fusesource/jansi-native#14

I have manually tested the jansi-native package on the local system for the aarch64 architecture, it is able to create the binary(jar) for it.
Now, once the maintainers releases the binary(jar) of jansi-native and jansi for the aarch64 architecture, we will able to create the docker image of the groovy.

@grooverdan
Copy link

@keeganwitt
Copy link
Member

keeganwitt commented Oct 7, 2020

I recently added back the architectures I had originally removed (after they became available again in the base image). But I'd forgotten about this issue. So far as I've seen, nothing has changed on the Jansi side. Is this still a problem? I see the Janky builds are green again. Sorry, I don't have a machine on which I can actually test this myself.

@Atamos
Copy link

Atamos commented Dec 21, 2020

I'm not pretty sure that the problem is the same , however :
on my pc

$ uname -m 
arm64

This is the error I've got when I try to pull and run some groovy's images.

$ docker run groovy:4.0.0-alpha-2-jre15 groovysh
WARNING: Using incubator modules: jdk.incubator.foreign, jdk.incubator.jpackage
java.lang.reflect.InvocationTargetException
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.base/java.lang.reflect.Method.invoke(Unknown Source)
	at org.codehaus.groovy.tools.GroovyStarter.rootLoader(GroovyStarter.java:111)
	at org.codehaus.groovy.tools.GroovyStarter.main(GroovyStarter.java:129)
Caused by: java.lang.UnsatisfiedLinkError: Could not load library. Reasons: [no jansi in java.library.path: /usr/java/packages/lib:/lib:/usr/lib, /tmp/libjansi-64-1906236609379568703.so: /tmp/libjansi-64-1906236609379568703.so: cannot open shared object file: No such file or directory (Possible cause: can't load AMD 64 .so on a AARCH64 platform)]
	at org.fusesource.hawtjni.runtime.Library.doLoad(Library.java:182)
	at org.fusesource.hawtjni.runtime.Library.load(Library.java:140)
	at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:42)
	at org.fusesource.jansi.AnsiConsole.wrapOutputStream(AnsiConsole.java:48)
	at org.fusesource.jansi.AnsiConsole.<clinit>(AnsiConsole.java:38)
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.lambda$createCallStaticSite$2(CallSiteArray.java:65)
	at java.base/java.security.AccessController.doPrivileged(Unknown Source)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallStaticSite(CallSiteArray.java:63)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallSite(CallSiteArray.java:156)
	at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCall(CallSiteArray.java:47)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:125)
	at org.codehaus.groovy.runtime.callsite.AbstractCallSite.call(AbstractCallSite.java:130)
	at org.apache.groovy.groovysh.Main.installAnsi(Main.groovy:249)
	at org.apache.groovy.groovysh.Main.setTerminalType(Main.groovy:235)
	at org.apache.groovy.groovysh.Main.main(Main.groovy:120)
	... 6 more

I'm pretty sure that docker works well with the right image architecture

$ docker run groovy:4.0.0-alpha-2-jre15 uname -m
aarch64

There are some other tests that I can do ?

@keeganwitt
Copy link
Member

@Atamos Thanks for this. You are able to still execute scripts though, right?

docker run groovy sh
echo 'println "hi"' > test.groovy
groovy test.groovy

@Atamos
Copy link

Atamos commented Dec 21, 2020

Thanks to you for the response. Yep script seems works

$ groovy test.groovy
WARNING: Using incubator modules: jdk.incubator.jpackage, jdk.incubator.foreign
hi

Seems that only groovysh show the error

@keeganwitt
Copy link
Member

keeganwitt commented Dec 21, 2020

That's what I expected. Groovysh is what has a dependency on Jansi. I'm not sure if Fusesource plans on doing a new release with Arm. I haven't gotten any response on fusesource/jansi-native#16. Jansi 2 looks like it has the Arm native binaries inside it though, so I'll see about upgrading the Jansi version in Groovy (https://issues.apache.org/jira/browse/GROOVY-9869).

@Atamos
Copy link

Atamos commented Dec 21, 2020

Sounds good. Thanks for your efforts.
I'll be waiting for it.

@keeganwitt
Copy link
Member

I believe this issue is resolved now. If you believe otherwise, lemme know and we can reopen it.

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

No branches or pull requests

4 participants