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

GraalVM native-image builds based on the Kafka 2.6.0 release #31

Merged
merged 25 commits into from
Nov 12, 2020
Merged
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
f0aebc8
Removes unused java distributions
solsson Aug 15, 2020
9f0a6de
Fixes a step arg so the command runs properly
solsson Aug 15, 2020
cfdd618
Adds the jopts exception class to reflect config
solsson Aug 15, 2020
7e4ea0c
Regenerate native configs with Kafka 2.6.0
solsson Aug 15, 2020
2f21a61
Current Quarkus
solsson Aug 15, 2020
576ecd5
Fixes a warning emitted at build time
solsson Aug 15, 2020
4e46018
Scala issues about the native-image + java.lang.invoke.MemberName
solsson Aug 15, 2020
bdd2195
Dammit scala
solsson Aug 16, 2020
fc8a77f
Fixes the zookeeper native-image JMX NPE, see #31
solsson Aug 16, 2020
7da9b9b
We've gotten rid of log4j and JMX; fix native-image warnings
solsson Aug 16, 2020
b9901ef
Can we do scala substitutions without scala libs?
solsson Aug 16, 2020
90fe465
Various experiments that failed to fix "unresolved" X509Util stuff
solsson Aug 16, 2020
94704b3
Scope out TLS support, again, until represented in native-usecases
solsson Aug 16, 2020
abaf382
Consistent builds. Admincmd fails to substitute the scala signature.
solsson Aug 16, 2020
1e33b4e
Betting that CLIs don't actually need metrics. We'd see runtime errors.
solsson Aug 16, 2020
695f84f
Fixes native-image build error \"unresolved type during parsing\"
solsson Aug 16, 2020
f4dfdf9
Explicit initialization config could be quite interesting for
solsson Aug 16, 2020
6b7d99c
Fixes all warnings about incomplete classpath with initialize-at-buil…
solsson Aug 16, 2020
9826bff
Despite the addition of these classpath entries,
solsson Aug 16, 2020
e8da8a7
Maybe --initialize-at-build-time should be removed after we've tracked
solsson Aug 16, 2020
510f8ba
Actually with the more ambitious classpath we're stuck with
solsson Aug 16, 2020
b43a8da
Has been solved with substitution
solsson Aug 16, 2020
6cb1202
Maybe down this rabbit hole we should use the entire libs folder again
solsson Aug 16, 2020
37ca8d6
Fixes a warning about incomplete classpath
solsson Aug 16, 2020
4187935
Zero warnings about incomplete classpath
solsson Aug 16, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixes the zookeeper native-image JMX NPE, see #31
  • Loading branch information
solsson committed Aug 16, 2020
commit fc8a77fe5a290775882c9dd34c5f4434866b4014
4 changes: 4 additions & 0 deletions native/substitutions/zookeeper-server-start/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.classpath
.project
.settings
target
25 changes: 25 additions & 0 deletions native/substitutions/zookeeper-server-start/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
<project>
<modelVersion>4.0.0</modelVersion>
<groupId>se.repos.substitutions.kafka</groupId>
<artifactId>zookeeper-substitutions</artifactId>
<version>1.0.0</version>
<properties>
<compiler-plugin.version>3.8.1</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
</properties>
<dependencies>
<dependency>
<groupId>org.graalvm.nativeimage</groupId>
<artifactId>svm</artifactId>
<version>20.1.0</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.apache.zookeeper</groupId>
<artifactId>zookeeper</artifactId>
<version>3.5.8</version>
</dependency>
</dependencies>
</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
package se.repos.substitutions.kafka.zookeeper;

import com.oracle.svm.core.annotate.Substitute;
import com.oracle.svm.core.annotate.TargetClass;

import org.apache.zookeeper.jmx.ZKMBeanInfo;

import java.util.HashSet;
import java.util.Set;

import javax.management.JMException;

/*
zoo-2_1 | [QuorumPeer[myid=3](plain=0.0.0.0:2181)(secure=disabled)] WARN org.apache.zookeeper.server.ZooKeeperServer - Failed to register with JMX
zoo-2_1 | java.lang.NullPointerException
zoo-2_1 | at org.apache.zookeeper.jmx.MBeanRegistry.register(MBeanRegistry.java:108)
zoo-2_1 | at org.apache.zookeeper.server.quorum.LearnerZooKeeperServer.registerJMX(LearnerZooKeeperServer.java:105)
zoo-2_1 | at org.apache.zookeeper.server.ZooKeeperServer.startup(ZooKeeperServer.java:461)
zoo-2_1 | at org.apache.zookeeper.server.quorum.Learner.syncWithLeader(Learner.java:572)
zoo-2_1 | at org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:89)
zoo-2_1 | at org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:1253)
zoo-2_1 | at com.oracle.svm.core.thread.JavaThreads.threadStartRoutine(JavaThreads.java:517)
zoo-2_1 | at com.oracle.svm.core.posix.thread.PosixJavaThreads.pthreadStartRoutine(PosixJavaThreads.java:193)
*/

@TargetClass(org.apache.zookeeper.jmx.MBeanRegistry.class)
final class NoJMX {

@Substitute
public void register(ZKMBeanInfo bean, ZKMBeanInfo parent)
throws JMException {
}

@Substitute
private void unregister(String path,ZKMBeanInfo bean) throws JMException {
}

@Substitute
public Set<ZKMBeanInfo> getRegisteredBeans() {
return new HashSet<>();
}

@Substitute
public void unregister(ZKMBeanInfo bean) {
}



}
9 changes: 8 additions & 1 deletion native/zookeeper-server-start.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
FROM solsson/kafka:graalvm as substitutions

WORKDIR /workspace
COPY substitutions/zookeeper-server-start .
RUN mvn package

FROM curlimages/curl@sha256:aa45e9d93122a3cfdf8d7de272e2798ea63733eeee6d06bd2ee4f2f8c4027d7c \
as extralibs

@@ -8,8 +14,9 @@ RUN curl -sLS -o /log4j-over-slf4j-1.7.30.jar https://repo1.maven.org/maven2/org
FROM solsson/kafka:nativebase as native

#ARG classpath=/opt/kafka/libs/slf4j-log4j12-1.7.30.jar:/opt/kafka/libs/log4j-1.2.17.jar:/opt/kafka/libs/slf4j-api-1.7.30.jar:/opt/kafka/libs/zookeeper-3.5.8.jar:/opt/kafka/libs/zookeeper-jute-3.5.8.jar
COPY --from=substitutions /workspace/target/*.jar /opt/kafka/libs/substitutions.jar
COPY --from=extralibs /*.jar /opt/kafka/libs/extensions/
ARG classpath=/opt/kafka/libs/slf4j-api-1.7.30.jar:/opt/kafka/libs/extensions/slf4j-simple-1.7.30.jar:/opt/kafka/libs/extensions/log4j-over-slf4j-1.7.30.jar:/opt/kafka/libs/zookeeper-3.5.8.jar:/opt/kafka/libs/zookeeper-jute-3.5.8.jar
ARG classpath=/opt/kafka/libs/substitutions.jar:/opt/kafka/libs/slf4j-api-1.7.30.jar:/opt/kafka/libs/extensions/slf4j-simple-1.7.30.jar:/opt/kafka/libs/extensions/log4j-over-slf4j-1.7.30.jar:/opt/kafka/libs/zookeeper-3.5.8.jar:/opt/kafka/libs/zookeeper-jute-3.5.8.jar

COPY configs/zookeeper-server-start /home/nonroot/native-config