This is an automated email from the ASF dual-hosted git repository. orpiske pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit 4376e72bec4307a236cfaeffd91336f62ae2fa33 Author: Otavio Rodolfo Piske <angusyo...@gmail.com> AuthorDate: Thu Apr 4 16:02:00 2024 +0200 CAMEL-20649: stop using a custom Apache Artemis container --- .../infra/artemis/common/ArtemisProperties.java | 1 + .../infra/artemis/services/ArtemisContainer.java | 20 +++++------ .../camel/test/infra/artemis/services/Dockerfile | 39 ---------------------- .../infra/artemis/services/container.properties | 17 ++++++++++ 4 files changed, 28 insertions(+), 49 deletions(-) diff --git a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/common/ArtemisProperties.java b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/common/ArtemisProperties.java index fe0edf833dc..0b1fa7a45a8 100644 --- a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/common/ArtemisProperties.java +++ b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/common/ArtemisProperties.java @@ -22,6 +22,7 @@ public final class ArtemisProperties { public static final String ARTEMIS_EXTERNAL = "artemis.external"; public static final String ARTEMIS_USERNAME = "artemis.username"; public static final String ARTEMIS_PASSWORD = "artemis.password"; + public static final String ARTEMIS_CONTAINER = "artemis.container"; private ArtemisProperties() { diff --git a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisContainer.java b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisContainer.java index ebfa1007457..8cf6a82cec0 100644 --- a/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisContainer.java +++ b/test-infra/camel-test-infra-artemis/src/test/java/org/apache/camel/test/infra/artemis/services/ArtemisContainer.java @@ -16,28 +16,28 @@ */ package org.apache.camel.test.infra.artemis.services; -import org.apache.camel.test.infra.common.TestUtils; +import org.apache.camel.test.infra.artemis.common.ArtemisProperties; +import org.apache.camel.test.infra.common.LocalPropertyResolver; import org.apache.camel.test.infra.messaging.services.MessagingContainer; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; -import org.testcontainers.images.builder.ImageFromDockerfile; +import org.testcontainers.utility.DockerImageName; public class ArtemisContainer extends GenericContainer<ArtemisContainer> implements MessagingContainer { private static final int DEFAULT_MQTT_PORT = 1883; private static final int DEFAULT_AMQP_PORT = 5672; private static final int DEFAULT_ADMIN_PORT = 8161; private static final int DEFAULT_ACCEPTOR_PORT = 61616; - private static final String FROM_IMAGE_NAME = "fedora:38"; - private static final String FROM_IMAGE_ARG = "FROMIMAGE"; public ArtemisContainer() { - super(new ImageFromDockerfile("localhost/apache-artemis:camel", false) - .withFileFromClasspath("Dockerfile", - "org/apache/camel/test/infra/artemis/services/Dockerfile") - .withBuildArg(FROM_IMAGE_ARG, TestUtils.prependHubImageNamePrefixIfNeeded(FROM_IMAGE_NAME))); + super(DockerImageName + .parse(LocalPropertyResolver.getProperty(ArtemisContainer.class, ArtemisProperties.ARTEMIS_CONTAINER))); - withExposedPorts(DEFAULT_MQTT_PORT, DEFAULT_AMQP_PORT, - DEFAULT_ADMIN_PORT, DEFAULT_ACCEPTOR_PORT) + this.withEnv("AMQ_EXTRA_ARGS", "--relax-jolokia") + .withEnv("AMQ_USER", "admin") + .withEnv("AMQ_PASSWORD", "admin") + .withExposedPorts(DEFAULT_MQTT_PORT, DEFAULT_AMQP_PORT, + DEFAULT_ADMIN_PORT, DEFAULT_ACCEPTOR_PORT) .waitingFor(Wait.forListeningPort()); } diff --git a/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/Dockerfile b/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/Dockerfile deleted file mode 100644 index 20086a88e80..00000000000 --- a/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/Dockerfile +++ /dev/null @@ -1,39 +0,0 @@ -# -# 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. -# - -ARG FROMIMAGE -FROM $FROMIMAGE as artemis-base -LABEL maintainer="orpi...@apache.org" -ARG ARTEMIS_VERSION -ENV ARTEMIS_VERSION ${ARTEMIS_VERSION:-2.18.0} -ARG ARTEMIS_JOURNAL -ENV ARTEMIS_JOURNAL ${ARTEMIS_JOURNAL:-aio} -ENV JMS_BROKER_ROOT /opt/camel-kafka-connector/artemis/ -EXPOSE 1883 5672 8161 61616 -RUN dnf install -y java-11-openjdk-headless libaio tar gzip && \ - dnf clean all && \ - mkdir -p ${JMS_BROKER_ROOT} && \ - cd ${JMS_BROKER_ROOT} && \ - curl --retry 3 --retry-connrefused https://archive.apache.org/dist/activemq/activemq-artemis/${ARTEMIS_VERSION}/apache-artemis-${ARTEMIS_VERSION}-bin.tar.gz -o apache-artemis.tar.gz && \ - mkdir -p apache-artemis && tar --strip-components=1 --exclude=examples/* -xvf apache-artemis.tar.gz -C apache-artemis && \ - rm -f apache-artemis.tar.gz -WORKDIR ${JMS_BROKER_ROOT} -ENV JAVA_HOME /etc/alternatives/jre - -FROM artemis-base as artemis -RUN ${JMS_BROKER_ROOT}/apache-artemis/bin/artemis create --${ARTEMIS_JOURNAL} --relax-jolokia --allow-anonymous --http-host 0.0.0.0 --user admin --password "admin" --role amq --data /artemis-storage ${JMS_BROKER_ROOT}/apache-artemis-instance -CMD [ "sh", "-c", "./apache-artemis-instance/bin/artemis run" ] diff --git a/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/container.properties b/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/container.properties new file mode 100644 index 00000000000..2c420d87c26 --- /dev/null +++ b/test-infra/camel-test-infra-artemis/src/test/resources/org/apache/camel/test/infra/artemis/services/container.properties @@ -0,0 +1,17 @@ +## --------------------------------------------------------------------------- +## 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. +## --------------------------------------------------------------------------- +artemis.container=quay.io/artemiscloud/activemq-artemis-broker:artemis.2.32.0 \ No newline at end of file