gemmellr commented on code in PR #4297: URL: https://github.com/apache/activemq-artemis/pull/4297#discussion_r1086751779
########## artemis-image/README.md: ########## @@ -0,0 +1,93 @@ +###What is in the image + +An _empty_, _open_ broker with a default acceptor on port 61616 + + - by empty: has no addresses or queues but will auto create on demand + - by open: has no security; authentication or authorization, users or roles + +###How will the image behave + + 1) the image will use or create `/app/data` for persistence of data + + 2) the image will use any [.properties files](https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html#broker_properties) from `/app/etc` to augment configuration + + 3) the image will use `/app/etc/broker.xml` if present, to bootstrap configuration, the 'bring your own config' use case + +###Build and Use + +First build an OCI image tar file from this artemis project using mvn: + + `$> mvn install` + +An OCI image is created as a tar file, that tar can be loaded into a registry, eg: + + `$> podman image load --input target/jib-image.tar` + +To run the image with host network access, localhost:61616 will be visible, use: + + `$> podman run --net=host localhost/target/activemq-artemis-image:<...>` Review Comment: Is there a "so" missing in ", localhost:61616 will be visible,"? Or why not just show mapping port(s) specifically, as most examples typically tend to? I see some issues suggesting --net=host doesnt work on all OS. Expanding/hinting on whats expected to be in the "\<...\>" might be useful to some folks... ########## artemis-image/README.md: ########## @@ -0,0 +1,93 @@ +###What is in the image + +An _empty_, _open_ broker with a default acceptor on port 61616 + + - by empty: has no addresses or queues but will auto create on demand + - by open: has no security; authentication or authorization, users or roles + +###How will the image behave + + 1) the image will use or create `/app/data` for persistence of data + + 2) the image will use any [.properties files](https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html#broker_properties) from `/app/etc` to augment configuration Review Comment: Should it be more specific? E.g what if you want to tweak the logging configuration .properties, where does that file go? Etc seems obvious.. ########## artemis-image/README.md: ########## @@ -0,0 +1,97 @@ +###What is in the image + +An _empty_, _open_ broker with a default acceptor on port 61616 Review Comment: Why not the usual default set, with other e.g IANA registered ports? ########## artemis-image/pom.xml: ########## @@ -0,0 +1,127 @@ +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-pom</artifactId> + <version>2.28.0-SNAPSHOT</version> + </parent> + + <artifactId>artemis-image</artifactId> + <name>Apache ActiveMQ Artemis Image</name> + + <properties> + <!-- for checkstyle plugin --> + <activemq.basedir>${project.basedir}/..</activemq.basedir> + <!-- none of the surefire project defaults are relevant to the tests here --> + <activemq-surefire-argline></activemq-surefire-argline> + + + <!-- for the locked down examples/amqp_sasl_scram_test__etc --> + <!-- user A is referenced in the role file, so don't just change it here --> + <example.user>A</example.user> + <!-- a password must be provided to generate the user credential data. + use: mvn exec:exec -Dexample.pwd=xyz on the command line to register your value in the example.user.file --> + <example.pwd></example.pwd> + <example.user.file>examples/amqp_sasl_scram_test__etc/user</example.user.file> + </properties> + + + <dependencies> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>apache-artemis</artifactId> + <version>${project.version}</version> + <type>pom</type> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + <scope>test</scope> + </dependency> + <!-- The johnzon-core and json-api contents are repackaged in -commons, + However maven can still need them during tests that don't see the shaded bits during build --> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.google.cloud.tools</groupId> + <artifactId>jib-maven-plugin</artifactId> + <version>3.3.0</version> + <configuration> + <from> + <!-- reproducible build and single pull with @sha reference --> + <image>eclipse-temurin:19-jre@sha256:619e1c33be065f75eb00b0999627b7b1e070f55c427e63dfd256f06d00935111</image> + </from> + <to> + <image>target/activemq-artemis-image:${project.version}</image> + </to> + <container> + <mainClass>org.apache.activemq.artemis.ActiveMQImageMain</mainClass> + <ports> + <port>61616</port> + </ports> + <format>OCI</format> + </container> + </configuration> + <executions> + <execution> + <phase>package</phase> + <goals> + <goal>buildTar</goal> + </goals> + </execution> + </executions> + </plugin> + + <!-- to easily create a single salted credential for our ${example.user.file}--> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>exec-maven-plugin</artifactId> + <version>${exec-maven-plugin.version}</version> + <configuration> + <executable>java</executable> + <arguments> + <argument>-classpath</argument> + <classpath/> + <argument>org.apache.activemq.artemis.spi.core.security.jaas.SCRAMPropertiesLoginModule</argument> + <argument>${example.user}</argument> + <argument>${example.pwd}</argument> + </arguments> + <outputFile>${example.user.file}</outputFile> + </configuration> + </plugin> Review Comment: similarly seems example-specific, feels off having it in the main pom of a deployed module. ########## artemis-image/pom.xml: ########## @@ -0,0 +1,127 @@ +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-pom</artifactId> + <version>2.28.0-SNAPSHOT</version> + </parent> + + <artifactId>artemis-image</artifactId> + <name>Apache ActiveMQ Artemis Image</name> + + <properties> + <!-- for checkstyle plugin --> + <activemq.basedir>${project.basedir}/..</activemq.basedir> + <!-- none of the surefire project defaults are relevant to the tests here --> + <activemq-surefire-argline></activemq-surefire-argline> + + + <!-- for the locked down examples/amqp_sasl_scram_test__etc --> + <!-- user A is referenced in the role file, so don't just change it here --> Review Comment: Could probably refer to the full file, rather than 'the role file'. This seems like one comment rather than 2. ########## artemis-image/README.md: ########## @@ -0,0 +1,93 @@ +###What is in the image + +An _empty_, _open_ broker with a default acceptor on port 61616 + + - by empty: has no addresses or queues but will auto create on demand + - by open: has no security; authentication or authorization, users or roles + +###How will the image behave + + 1) the image will use or create `/app/data` for persistence of data + + 2) the image will use any [.properties files](https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html#broker_properties) from `/app/etc` to augment configuration + + 3) the image will use `/app/etc/broker.xml` if present, to bootstrap configuration, the 'bring your own config' use case + +###Build and Use + +First build an OCI image tar file from this artemis project using mvn: + + `$> mvn install` + +An OCI image is created as a tar file, that tar can be loaded into a registry, eg: + + `$> podman image load --input target/jib-image.tar` + +To run the image with host network access, localhost:61616 will be visible, use: + + `$> podman run --net=host localhost/target/activemq-artemis-image:<...>` + +Execute the artemis producer/consumer command line tools from a `local distribution` to validate: +Note: there is a `local distribution` in ../artemis-distribution/target/apache-artemis-<version>-bin/apache-artemis-<version>/ + + `$> ./bin/artemis producer --url tcp://127.0.0.1:61616` + + `$> ./bin/artemis consumer --url tcp://127.0.0.1:61616` + +###Intent + +The intent is that this image is useful as is. If one can trust users, having no access control or limits can work fine. + +If not, then this image can be configured by mounting an `/app/etc` directory with property files that augment default configuration. +This image could also be the base for a derived jib image, by simply adding more property files to the `src/main/resources` directory. + +###Examples Review Comment: The bulk of these instructions below seem like they would be better alongside the examples themselves. E.g leaving only the 'An example of doing <foo> can be found at <location>' seems like it might be better. The examples themselves appear to have no documentation if you just go into the examples dir which feels weird. ########## artemis-image/pom.xml: ########## @@ -0,0 +1,127 @@ +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-pom</artifactId> + <version>2.28.0-SNAPSHOT</version> + </parent> + + <artifactId>artemis-image</artifactId> + <name>Apache ActiveMQ Artemis Image</name> + + <properties> + <!-- for checkstyle plugin --> + <activemq.basedir>${project.basedir}/..</activemq.basedir> + <!-- none of the surefire project defaults are relevant to the tests here --> + <activemq-surefire-argline></activemq-surefire-argline> + + + <!-- for the locked down examples/amqp_sasl_scram_test__etc --> + <!-- user A is referenced in the role file, so don't just change it here --> + <example.user>A</example.user> + <!-- a password must be provided to generate the user credential data. + use: mvn exec:exec -Dexample.pwd=xyz on the command line to register your value in the example.user.file --> + <example.pwd></example.pwd> + <example.user.file>examples/amqp_sasl_scram_test__etc/user</example.user.file> + </properties> + + + <dependencies> + <dependency> + <groupId>org.apache.activemq</groupId> + <artifactId>apache-artemis</artifactId> + <version>${project.version}</version> + <type>pom</type> + </dependency> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${junit.version}</version> + <scope>test</scope> + </dependency> + <!-- The johnzon-core and json-api contents are repackaged in -commons, + However maven can still need them during tests that don't see the shaded bits during build --> + <dependency> + <groupId>org.apache.johnzon</groupId> + <artifactId>johnzon-core</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>jakarta.json</groupId> + <artifactId>jakarta.json-api</artifactId> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>com.google.cloud.tools</groupId> + <artifactId>jib-maven-plugin</artifactId> + <version>3.3.0</version> Review Comment: Should be made a managed version like [most] other plugins, allow consistency. ########## artemis-image/pom.xml: ########## @@ -0,0 +1,127 @@ +<!-- + ~ 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. + --> + +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <modelVersion>4.0.0</modelVersion> + + <parent> + <groupId>org.apache.activemq</groupId> + <artifactId>artemis-pom</artifactId> + <version>2.28.0-SNAPSHOT</version> + </parent> + + <artifactId>artemis-image</artifactId> + <name>Apache ActiveMQ Artemis Image</name> + + <properties> + <!-- for checkstyle plugin --> + <activemq.basedir>${project.basedir}/..</activemq.basedir> + <!-- none of the surefire project defaults are relevant to the tests here --> + <activemq-surefire-argline></activemq-surefire-argline> + + + <!-- for the locked down examples/amqp_sasl_scram_test__etc --> + <!-- user A is referenced in the role file, so don't just change it here --> + <example.user>A</example.user> + <!-- a password must be provided to generate the user credential data. + use: mvn exec:exec -Dexample.pwd=xyz on the command line to register your value in the example.user.file --> + <example.pwd></example.pwd> + <example.user.file>examples/amqp_sasl_scram_test__etc/user</example.user.file> Review Comment: if everything in this grouping is all specific to one example as it looks, and not the default state or other example(s), seems more like it should be in a pom for that example than set everywhere. ########## artemis-image/README.md: ########## @@ -0,0 +1,97 @@ +###What is in the image + +An _empty_, _open_ broker with a default acceptor on port 61616 + + - by empty: has no addresses or queues but will auto create on demand + - by open: has no security; authentication or authorization, users or roles + +###How will the image behave + + 1) the image will use or create `/app/data` for persistence of data + + 2) the image will use any [.properties files](https://activemq.apache.org/components/artemis/documentation/latest/configuration-index.html#broker_properties) from `/app/etc` to augment configuration + + 3) the image will use `/app/etc/broker.xml` if present, to bootstrap configuration, the 'bring your own config' use case + +###Build and Use + +First build an OCI image tar file from this artemis project using mvn: + + `$> mvn install` + +An OCI image is created as a tar file. + +> *Note that any OCI compatible container runtime and registry can be used for the next steps, eg: docker, podman... I have used podman.* + +To load the image tar into a registry, use: + + `$> podman image load --input target/jib-image.tar` + +To run the image with host network access, localhost:61616 will be visible, use: + + `$> podman run --net=host localhost/target/activemq-artemis-image:<...>` + +Execute the artemis producer/consumer command line tools from a `local distribution` to validate: +Note: there is a `local distribution` in ../artemis-distribution/target/apache-artemis-<version>-bin/apache-artemis-<version>/ Review Comment: If you previously built the entire tree from source there will be, but not if you didnt and are just looking at this bit. We probably shouldnt be encouraging folks to re-run the source build on a release version, but instead get the latest released bits (that they potentially already have if reading this). -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
