You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by hu...@apache.org on 2022/07/04 10:33:55 UTC

[activemq-artemis-native] branch main created (now d053f9a)

This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a change to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git


      at d053f9a  ARTEMIS-3882: some cleanup for prior commits

This branch includes the following new commits:

     new fa2cdbd  ARTEMIS-3882 Removing Logger references and its dependencies
     new 2b89b0f  Compilation script using podman
     new 7b68475  Fixing issue with mac not support :z on podman & docker
     new b918387  Adding podman note on README
     new d053f9a  ARTEMIS-3882: some cleanup for prior commits

The 5 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[activemq-artemis-native] 01/05: ARTEMIS-3882 Removing Logger references and its dependencies

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git

commit fa2cdbd8e9d1924915feeaae2649d0ce45fe634f
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon May 23 16:15:44 2022 +0100

    ARTEMIS-3882 Removing Logger references and its dependencies
    
    Using simple logging with a possibility of a callback
    Using javac -h instead of javah
    Removing finalize calls, using Java11, Using Cleaner API in some tests that are validating leaks
    Incrementing native version to avoid missuse
    
    authored by Clebert Suconic and Robbie Gemmel
---
 pom.xml                                            | 53 ++----------------
 src/main/c/CMakeLists.txt                          |  2 +-
 ...activemq_artemis_nativo_jlibaio_LibaioContext.h |  2 +-
 .../artemis/nativo/jlibaio/LibaioContext.java      | 17 +++---
 .../artemis/nativo/jlibaio/LibaioFile.java         |  2 +-
 .../artemis/nativo/jlibaio/LoggerCallback.java     | 35 ++++++++++++
 .../artemis/nativo/jlibaio/NativeLogger.java       | 63 ++++++++++++----------
 .../artemis/nativo/jlibaio/SystemCallback.java     | 50 +++++++++++++++++
 .../artemis/nativo/jlibaio/test/LibaioTest.java    | 19 +++++--
 9 files changed, 147 insertions(+), 96 deletions(-)

diff --git a/pom.xml b/pom.xml
index bad069e..4d4a6de 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,8 +33,8 @@
     <url />
 
     <properties>
-        <jboss.logging.version>3.3.1.Final</jboss.logging.version>
-        <jb.logmanager.version>2.0.3.Final</jb.logmanager.version>
+        <slf4j.version>1.7.36</slf4j.version>
+        <log4j.version>2.17.2</log4j.version>
 
         <version.org.jacoco>0.8.6</version.org.jacoco>
         <version.org.jacoco.plugin>0.8.6</version.org.jacoco.plugin>
@@ -50,8 +50,8 @@
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
         <!-- See also maven.compiler.release in the java9on profile -->
-        <maven.compiler.source>1.8</maven.compiler.source>
-        <maven.compiler.target>1.8</maven.compiler.target>
+        <maven.compiler.source>11</maven.compiler.source>
+        <maven.compiler.target>11</maven.compiler.target>
 
         <activemq-surefire-argline>
             -Dtest.stress.time=${test.stress.time} -Djava.library.path="${activemq.basedir}/target/lib/linux-${os.arch}"
@@ -88,7 +88,6 @@
     </issueManagement>
 
     <dependencies>
-        <!-- ## Test Dependencies -->
         <dependency>
             <groupId>junit</groupId>
             <artifactId>junit</artifactId>
@@ -108,37 +107,6 @@
           <version>${version.org.jacoco}</version>
            <scope>test</scope>
        </dependency>
-        <!-- ### Build Time Dependencies ### -->
-        <!-- This is a build dependency of this project, but is not needed at compile or runtime by other
-        projects that depend on this project. This should be in the compiler plugin but can't because of a bug,
-        see https://issues.apache.org/jira/browse/MCOMPILER-203-->
-        <dependency>
-            <groupId>org.jboss.logging</groupId>
-            <artifactId>jboss-logging-processor</artifactId>
-            <version>2.1.0.Final</version>
-            <optional>true</optional>
-            <!-- License: LGPL-->
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.logging</groupId>
-            <artifactId>jboss-logging-annotations</artifactId>
-            <version>2.1.0.Final</version>
-            <scope>provided</scope>
-            <optional>true</optional>
-            <!-- License: Apache 2.0-->
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.logging</groupId>
-            <artifactId>jboss-logging</artifactId>
-            <version>${jboss.logging.version}</version>
-            <!-- License: Apache 2.0 -->
-        </dependency>
-        <dependency>
-            <groupId>org.jboss.logmanager</groupId>
-            <artifactId>jboss-logmanager</artifactId>
-            <version>${jb.logmanager.version}</version>
-            <!-- License: Apache 2.0 -->
-        </dependency>
     </dependencies>
 
     <profiles>
@@ -254,15 +222,6 @@
                 </plugins>
             </build>
         </profile>
-        <profile>
-            <id>java9on</id>
-            <activation>
-                <jdk>[9,)</jdk>
-            </activation>
-            <properties>
-                <maven.compiler.release>8</maven.compiler.release>
-            </properties>
-        </profile>
     </profiles>
 
     <build>
@@ -400,9 +359,6 @@
             </resource>
         </resources>
         <plugins>
-            <plugin>
-                <artifactId>maven-source-plugin</artifactId>
-            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-help-plugin</artifactId>
@@ -548,6 +504,7 @@
                     </execution>
                 </executions>
             </plugin>
+
         </plugins>
     </build>
 
diff --git a/src/main/c/CMakeLists.txt b/src/main/c/CMakeLists.txt
index 67275cf..631156a 100644
--- a/src/main/c/CMakeLists.txt
+++ b/src/main/c/CMakeLists.txt
@@ -72,7 +72,7 @@ INCLUDE_DIRECTORIES(. ${JNI_INCLUDE_DIRS})
 
 ADD_CUSTOM_COMMAND(
     OUTPUT org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.h
-    COMMAND javah -cp ../java/ org.apache.activemq.artemis.nativo.jlibaio.LibaioContext
+    COMMAND javac -h . ../java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java  -cp ../java/ -d ../../../target/classes-javah-compilation
     DEPENDS ../java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java
 )
 
diff --git a/src/main/c/org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.h b/src/main/c/org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.h
index 7adfd43..e42c126 100644
--- a/src/main/c/org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.h
+++ b/src/main/c/org_apache_activemq_artemis_nativo_jlibaio_LibaioContext.h
@@ -8,7 +8,7 @@
 extern "C" {
 #endif
 #undef org_apache_activemq_artemis_nativo_jlibaio_LibaioContext_EXPECTED_NATIVE_VERSION
-#define org_apache_activemq_artemis_nativo_jlibaio_LibaioContext_EXPECTED_NATIVE_VERSION 10L
+#define org_apache_activemq_artemis_nativo_jlibaio_LibaioContext_EXPECTED_NATIVE_VERSION 11L
 /*
  * Class:     org_apache_activemq_artemis_nativo_jlibaio_LibaioContext
  * Method:    shutdownHook
diff --git a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java
index 794e112..d91fdbe 100644
--- a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java
+++ b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioContext.java
@@ -47,7 +47,7 @@ public class LibaioContext<Callback extends SubmitInfo> implements Closeable {
    /**
     * The Native layer will look at this version.
     */
-   private static final int EXPECTED_NATIVE_VERSION = 10;
+   private static final int EXPECTED_NATIVE_VERSION = 11;
 
    private static boolean loaded = false;
 
@@ -63,13 +63,13 @@ public class LibaioContext<Callback extends SubmitInfo> implements Closeable {
       try {
          System.loadLibrary(name);
          if (getNativeVersion() != EXPECTED_NATIVE_VERSION) {
-            NativeLogger.LOGGER.incompatibleNativeLibrary();
+            NativeLogger.incompatibleNativeLibrary();
             return false;
          } else {
             return true;
          }
       } catch (Throwable e) {
-         NativeLogger.LOGGER.debug(name + " -> error loading the native library", e);
+         NativeLogger.debug(name + " -> error loading the native library", e);
          return false;
       }
 
@@ -93,12 +93,12 @@ public class LibaioContext<Callback extends SubmitInfo> implements Closeable {
             });
             break;
          } else {
-            NativeLogger.LOGGER.debug("Library " + library + " not found!");
+            NativeLogger.debug("Library " + library + " not found!");
          }
       }
 
       if (!loaded) {
-         NativeLogger.LOGGER.debug("Couldn't locate LibAIO Wrapper");
+         NativeLogger.debug("Couldn't locate LibAIO Wrapper");
       }
    }
 
@@ -242,7 +242,7 @@ public class LibaioContext<Callback extends SubmitInfo> implements Closeable {
             try {
                ioSpace.tryAcquire(queueSize, 10, TimeUnit.SECONDS);
             } catch (Exception e) {
-               NativeLogger.LOGGER.error(e);
+               NativeLogger.warn(e.getMessage(), e);
             }
          }
          totalMaxIO.addAndGet(-queueSize);
@@ -255,11 +255,6 @@ public class LibaioContext<Callback extends SubmitInfo> implements Closeable {
       }
    }
 
-   @Override
-   protected void finalize() throws Throwable {
-      super.finalize();
-      close();
-   }
 
    /**
     * It will open a file. If you set the direct flag = false then you won't need to use the special buffer.
diff --git a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioFile.java b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioFile.java
index 373e48c..f03ed87 100644
--- a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioFile.java
+++ b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LibaioFile.java
@@ -120,7 +120,7 @@ public final class LibaioFile<Callback extends SubmitInfo> implements AutoClosea
       try {
          LibaioContext.fill(fd, alignment, size);
       } catch (OutOfMemoryError e) {
-         NativeLogger.LOGGER.debug("Didn't have enough memory to allocate " + size + " bytes in memory, using simple fallocate");
+         NativeLogger.warn("Did not have enough memory to allocate " + size + " bytes in memory while filling the file, using simple fallocate");
          LibaioContext.fallocate(fd, size);
       }
    }
diff --git a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LoggerCallback.java b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LoggerCallback.java
new file mode 100644
index 0000000..dc41013
--- /dev/null
+++ b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/LoggerCallback.java
@@ -0,0 +1,35 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.nativo.jlibaio;
+
+
+/** I am keeping Artemis Native Log Free, so it will be simpler to compile it, especially on the include bits.
+ *  If you want the NativeLogger redirected to any framework you can use the method NativeLogger.setCallback(LoggerCallback) on your
+ *  usage implementation*/
+public interface LoggerCallback {
+
+   void info(String message);
+
+   void warn(String message);
+
+   void warn(String message, Throwable e);
+
+   void debug(String message);
+
+   void debug(String message, Throwable e);
+}
diff --git a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/NativeLogger.java b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/NativeLogger.java
index b32a2e6..c5ddd81 100644
--- a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/NativeLogger.java
+++ b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/NativeLogger.java
@@ -16,35 +16,40 @@
  */
 package org.apache.activemq.artemis.nativo.jlibaio;
 
-import org.jboss.logging.BasicLogger;
-import org.jboss.logging.Logger;
-import org.jboss.logging.annotations.LogMessage;
-import org.jboss.logging.annotations.Message;
-import org.jboss.logging.annotations.MessageLogger;
-
-/**
- * Logger Code 16
- *
- * each message id must be 6 digits long starting with 16, the 3rd digit denotes the level so
- *
- * INF0  1
- * WARN  2
- * DEBUG 3
- * ERROR 4
- * TRACE 5
- * FATAL 6
- *
- * so an INFO message would be 161000 to 161999
- */
-@MessageLogger(projectCode = "jlibaio")
-public interface NativeLogger extends BasicLogger {
+public class NativeLogger {
+
+   public static final String PROJECT_PREFIX = "jlibaio";
+
+   private static LoggerCallback loggerCallback = new SystemCallback();
+
+   public static void setLoggerCallback(LoggerCallback callback) {
+      loggerCallback = callback;
+   }
+
+   private static final int DIFFERENT_VERSION_ID = 163001;
+   private static final String DIFFERENT_VERSION = PROJECT_PREFIX + DIFFERENT_VERSION_ID + " You have a native library with a different version than expected";
+
+   public final static void incompatibleNativeLibrary() {
+       warn(DIFFERENT_VERSION);
+   }
+
+   public final static void info(String message) {
+      loggerCallback.info(message);
+   }
+
+   public final static void warn(String message) {
+      loggerCallback.warn(message);
+   }
+
+   public final static void warn(String message, Throwable e) {
+      loggerCallback.warn(message, e);
+   }
 
-   /**
-    * The journal logger.
-    */
-   NativeLogger LOGGER = Logger.getMessageLogger(NativeLogger.class, NativeLogger.class.getPackage().getName());
+   public final static void debug(String message) {
+      loggerCallback.debug(message);
+   }
 
-   @LogMessage(level = Logger.Level.WARN)
-   @Message(id = 163001, value = "You have a native library with a different version than expected", format = Message.Format.MESSAGE_FORMAT)
-   void incompatibleNativeLibrary();
+   public final static void debug(String message, Throwable e) {
+      loggerCallback.debug(message, e);
+   }
 }
diff --git a/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/SystemCallback.java b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/SystemCallback.java
new file mode 100644
index 0000000..b50c209
--- /dev/null
+++ b/src/main/java/org/apache/activemq/artemis/nativo/jlibaio/SystemCallback.java
@@ -0,0 +1,50 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.nativo.jlibaio;
+
+/** This will use System.err for warn and System.out for info */
+public class SystemCallback implements LoggerCallback {
+
+   private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty(SystemCallback.class.getName() + ".DEBUG", "false"));
+
+   public void debug(String message, Throwable e) {
+      if (DEBUG) {
+         System.out.println("Debug from ArtemisNative: " + message);
+         e.printStackTrace(System.out);
+      }
+   }
+
+   public void debug(String message) {
+      if (DEBUG) {
+         System.out.println("Debug from ArtemisNative: " + message);
+      }
+   }
+
+   public void info(String message) {
+      System.out.println("Information from ArtemisNative: " + message);
+   }
+
+   public void warn(String message) {
+      System.err.println("Warning from ArtemisNative: " + message);
+   }
+
+   public void warn(String message, Throwable e) {
+      System.err.println("Warning from ArtemisNative: " + message);
+      e.printStackTrace(System.err);
+   }
+}
diff --git a/src/test/java/org/apache/activemq/artemis/nativo/jlibaio/test/LibaioTest.java b/src/test/java/org/apache/activemq/artemis/nativo/jlibaio/test/LibaioTest.java
index 074597f..ec8b73d 100644
--- a/src/test/java/org/apache/activemq/artemis/nativo/jlibaio/test/LibaioTest.java
+++ b/src/test/java/org/apache/activemq/artemis/nativo/jlibaio/test/LibaioTest.java
@@ -20,6 +20,7 @@ package org.apache.activemq.artemis.nativo.jlibaio.test;
 import java.io.File;
 import java.io.FileOutputStream;
 import java.io.IOException;
+import java.lang.ref.Cleaner;
 import java.lang.ref.WeakReference;
 import java.nio.ByteBuffer;
 import java.util.concurrent.CountDownLatch;
@@ -703,13 +704,19 @@ public class LibaioTest {
 
    static class TestInfo implements SubmitInfo {
 
-      static AtomicInteger count = new AtomicInteger();
+      static final Cleaner cleaner;
 
-      @Override
-      protected void finalize() throws Throwable {
-         super.finalize();
-         count.decrementAndGet();
+      static {
+         Cleaner tempCleaner;
+         try {
+            tempCleaner = Cleaner.create();
+         } catch (Throwable e) {
+            e.printStackTrace();
+            tempCleaner = null;
+         }
+         cleaner = tempCleaner;
       }
+      static AtomicInteger count = new AtomicInteger();
 
       public static void checkLeaks() throws InterruptedException {
          for (int i = 0; count.get() != 0 && i < 50; i++) {
@@ -728,6 +735,8 @@ public class LibaioTest {
 
       TestInfo() {
          count.incrementAndGet();
+         cleaner.register(this, count::decrementAndGet);
+
       }
 
       @Override


[activemq-artemis-native] 02/05: Compilation script using podman

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git

commit 2b89b0fb4c96b9c82e6b775a46edd8ce2fc4554c
Author: clebert <cl...@gmail.com>
AuthorDate: Fri Jul 1 13:22:27 2022 -0400

    Compilation script using podman
---
 pom.xml                                            | 24 +++++++++++
 .../Dockerfile-centos => scripts/bash-podman.sh    | 46 ++++++++-------------
 .../compile-using-podman.sh                        | 47 +++++++++-------------
 src/main/docker/Dockerfile-centos                  |  2 +-
 4 files changed, 60 insertions(+), 59 deletions(-)

diff --git a/pom.xml b/pom.xml
index 4d4a6de..3d43076 100644
--- a/pom.xml
+++ b/pom.xml
@@ -140,6 +140,30 @@
                 </plugins>
             </build>
         </profile>
+        <profile>
+            <id>podman</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <groupId>org.codehaus.mojo</groupId>
+                        <artifactId>exec-maven-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>build</id>
+                                <phase>generate-sources</phase>
+                                <goals>
+                                    <goal>exec</goal>
+                                </goals>
+                                <configuration>
+                                    <executable>bash</executable>
+                                    <commandlineArgs>./scripts/compile-using-podman.sh</commandlineArgs>
+                                </configuration>
+                            </execution>
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
         <profile>
             <id>docker</id>
             <build>
diff --git a/src/main/docker/Dockerfile-centos b/scripts/bash-podman.sh
old mode 100644
new mode 100755
similarity index 52%
copy from src/main/docker/Dockerfile-centos
copy to scripts/bash-podman.sh
index c0dd8e2..45b1aa3
--- a/src/main/docker/Dockerfile-centos
+++ b/scripts/bash-podman.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #   http://www.apache.org/licenses/LICENSE-2.0
-#
+# 
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -15,31 +16,18 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# ActiveMQ Artemis
+if [ -d "./target" ]; then
+  if [ -d "./target/lib" ]; then
+     rm -rf "./target/lib"
+  fi
+  mkdir "target/lib"
+else
+  mkdir -p "target/lib"
+fi
+
+podman build -f src/main/docker/Dockerfile-centos -t artemis-native-builder .
+# to debug the image
+podman run -it --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@" bash
+chown -Rv $USER:$GID ./target/lib
+ls -liat ./target/lib
 
-FROM centos:7 as builder-env
-
-LABEL maintainer="Apache ActiveMQ Team"
-
-RUN yum groupinstall -y "Development Tools" && \
-	yum install -y vim cmake libaio libaio.i686 libaio-devel libaio-devel.i686 glibc-devel.i686 \
-		libgcc.i686 java-1.8.0-openjdk-devel && yum clean all
-
-WORKDIR /opt
-RUN curl https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xz
-RUN echo 'PATH=/opt/apache-maven-3.6.3/bin/:$PATH' >> ~/.bashrc
-
-FROM builder-env as builder
-
-ADD . /work
-
-WORKDIR /work
-
-VOLUME ["/work/target/lib"]
-VOLUME ["/root/.m2/repository"]
-
-WORKDIR /work
-
-ENV PATH /opt/apache-maven-3.6.3/bin/:$PATH
-
-CMD [ "bash", "-c", "/work/scripts/compile-native.sh"]
diff --git a/src/main/docker/Dockerfile-centos b/scripts/compile-using-podman.sh
old mode 100644
new mode 100755
similarity index 52%
copy from src/main/docker/Dockerfile-centos
copy to scripts/compile-using-podman.sh
index c0dd8e2..b6f1013
--- a/src/main/docker/Dockerfile-centos
+++ b/scripts/compile-using-podman.sh
@@ -1,3 +1,4 @@
+#!/usr/bin/env bash
 # Licensed to the Apache Software Foundation (ASF) under one
 # or more contributor license agreements.  See the NOTICE file
 # distributed with this work for additional information
@@ -5,9 +6,9 @@
 # to you under the Apache License, Version 2.0 (the
 # "License"); you may not use this file except in compliance
 # with the License.  You may obtain a copy of the License at
-#
+# 
 #   http://www.apache.org/licenses/LICENSE-2.0
-#
+# 
 # Unless required by applicable law or agreed to in writing,
 # software distributed under the License is distributed on an
 # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -15,31 +16,19 @@
 # specific language governing permissions and limitations
 # under the License.
 
-# ActiveMQ Artemis
+if [ -d "./target" ]; then
+  if [ -d "./target/lib" ]; then
+     rm -rf "./target/lib"
+  fi
+  mkdir "target/lib"
+else
+  mkdir -p "target/lib"
+fi
+
+podman build -f src/main/docker/Dockerfile-centos -t artemis-native-builder .
+podman run --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@"
+# to debug the image
+#podman run -it --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@" bash
+chown -Rv $USER:$GID ./target/lib
+ls -liat ./target/lib
 
-FROM centos:7 as builder-env
-
-LABEL maintainer="Apache ActiveMQ Team"
-
-RUN yum groupinstall -y "Development Tools" && \
-	yum install -y vim cmake libaio libaio.i686 libaio-devel libaio-devel.i686 glibc-devel.i686 \
-		libgcc.i686 java-1.8.0-openjdk-devel && yum clean all
-
-WORKDIR /opt
-RUN curl https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xz
-RUN echo 'PATH=/opt/apache-maven-3.6.3/bin/:$PATH' >> ~/.bashrc
-
-FROM builder-env as builder
-
-ADD . /work
-
-WORKDIR /work
-
-VOLUME ["/work/target/lib"]
-VOLUME ["/root/.m2/repository"]
-
-WORKDIR /work
-
-ENV PATH /opt/apache-maven-3.6.3/bin/:$PATH
-
-CMD [ "bash", "-c", "/work/scripts/compile-native.sh"]
diff --git a/src/main/docker/Dockerfile-centos b/src/main/docker/Dockerfile-centos
index c0dd8e2..9084ebb 100644
--- a/src/main/docker/Dockerfile-centos
+++ b/src/main/docker/Dockerfile-centos
@@ -23,7 +23,7 @@ LABEL maintainer="Apache ActiveMQ Team"
 
 RUN yum groupinstall -y "Development Tools" && \
 	yum install -y vim cmake libaio libaio.i686 libaio-devel libaio-devel.i686 glibc-devel.i686 \
-		libgcc.i686 java-1.8.0-openjdk-devel && yum clean all
+		libgcc.i686 java-11-openjdk-devel && yum clean all
 
 WORKDIR /opt
 RUN curl https://downloads.apache.org/maven/maven-3/3.6.3/binaries/apache-maven-3.6.3-bin.tar.gz | tar -xz


[activemq-artemis-native] 04/05: Adding podman note on README

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git

commit b918387d43aa1288de06ec9a02e8c8ab13aede46
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Jul 1 16:23:30 2022 -0400

    Adding podman note on README
---
 README.md | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

diff --git a/README.md b/README.md
index 26ddba1..9c3262c 100644
--- a/README.md
+++ b/README.md
@@ -13,11 +13,11 @@ There are two ways to build the native libraries:
 - Using a Docker Image created during the build phase
 - Bare Metal
 
-## Docker
+## Docker and Podman
 
-The only requirement needed for this compilation option is Docker.
+You an use either Docker or Podman to compile the native bits.
 
-The required image will be downloaded by Docker when you build it.
+The required image will be downloaded when you build it.
 
 You can use the script ./scripts/compile-using-docker.sh and the correct image and script should be called.
 
@@ -25,6 +25,12 @@ You can use the script ./scripts/compile-using-docker.sh and the correct image a
 $ ./scripts/compile-using-docker.sh
 ```
 
+or
+
+```bash
+$ ./scripts/compile-using-podman.sh
+```
+
 
 Or you could also using the -Pdocker profile on maven:
 
@@ -34,6 +40,14 @@ $ mvn install -Pdocker
 
 ```
 
+Or you could also using the -Ppodman profile on maven:
+
+
+```bash
+$ mvn install -Ppodman
+
+```
+
 
 ## Bare Metal Dependencies
 


[activemq-artemis-native] 05/05: ARTEMIS-3882: some cleanup for prior commits

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git

commit d053f9a357f7c61575a3814c2234aba1d76c4ee7
Author: Robbie Gemmell <ro...@apache.org>
AuthorDate: Mon Jul 4 10:58:10 2022 +0100

    ARTEMIS-3882: some cleanup for prior commits
    
    - Remove now-unused dep version properties
    - Restore the compiler -release flag
    - Update related enforcer check
---
 pom.xml | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3d43076..5a5e994 100644
--- a/pom.xml
+++ b/pom.xml
@@ -33,9 +33,6 @@
     <url />
 
     <properties>
-        <slf4j.version>1.7.36</slf4j.version>
-        <log4j.version>2.17.2</log4j.version>
-
         <version.org.jacoco>0.8.6</version.org.jacoco>
         <version.org.jacoco.plugin>0.8.6</version.org.jacoco.plugin>
         <surefire.version>2.22.2</surefire.version>
@@ -49,9 +46,9 @@
         <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
         <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
 
-        <!-- See also maven.compiler.release in the java9on profile -->
         <maven.compiler.source>11</maven.compiler.source>
         <maven.compiler.target>11</maven.compiler.target>
+        <maven.compiler.release>11</maven.compiler.release>
 
         <activemq-surefire-argline>
             -Dtest.stress.time=${test.stress.time} -Djava.library.path="${activemq.basedir}/target/lib/linux-${os.arch}"
@@ -353,8 +350,8 @@
                             <configuration>
                                 <rules>
                                     <requireJavaVersion>
-                                    <version>[1.8,)</version>
-                                    <message>You must use Java 8+ to build</message>
+                                    <version>[11,)</version>
+                                    <message>You must use Java 11+ to build</message>
                                     </requireJavaVersion>
                                 </rules>
                             </configuration>


[activemq-artemis-native] 03/05: Fixing issue with mac not support :z on podman & docker

Posted by hu...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

humbedooh pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis-native.git

commit 7b6847546aa5419ba4a4fa7ba6982602c771c659
Author: Clebert Suconic <cl...@apache.org>
AuthorDate: Fri Jul 1 16:17:48 2022 -0400

    Fixing issue with mac not support :z on podman & docker
---
 scripts/compile-using-podman.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/scripts/compile-using-podman.sh b/scripts/compile-using-podman.sh
index b6f1013..1d7be87 100755
--- a/scripts/compile-using-podman.sh
+++ b/scripts/compile-using-podman.sh
@@ -26,7 +26,13 @@ else
 fi
 
 podman build -f src/main/docker/Dockerfile-centos -t artemis-native-builder .
-podman run --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@"
+if [[ $OSTYPE == 'darwin'* ]]; then
+  # for some reason the :Z is not working on mac
+  podman run --rm -v $PWD/target/lib:/work/target/lib artemis-native-builder "$@"
+else
+  podman run --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@"
+fi
+
 # to debug the image
 #podman run -it --rm -v $PWD/target/lib:/work/target/lib:Z artemis-native-builder "$@" bash
 chown -Rv $USER:$GID ./target/lib