From 6ea3e00388039aebe955db45b3748179968c3e4f Mon Sep 17 00:00:00 2001 From: alewir Date: Wed, 20 Jan 2021 17:36:38 +0100 Subject: [PATCH] SPARK-30160 Split tcp-msg-maven-plugin from appstore-metadata-service --- LICENSE-THIRD-PARTY.txt | 14 +- .../metadata/test/framework/TestSession.java | 2 + appstore-metadata-service/README.md | 6 - .../0.0.1-SNAPSHOT/maven-metadata-local.xml | 24 ++++ .../tcp-msg-maven-plugin-0.0.1-SNAPSHOT.jar | Bin 0 -> 14076 bytes .../tcp-msg-maven-plugin-0.0.1-SNAPSHOT.pom | 0 .../maven-metadata-local.xml | 11 ++ pom.xml | 14 +- tcp-msg-maven-plugin/README.md | 123 ------------------ .../lgi/commons/maven/TcpMessagingMojo.java | 120 ----------------- 10 files changed, 51 insertions(+), 263 deletions(-) create mode 100644 appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/maven-metadata-local.xml create mode 100644 appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.jar rename tcp-msg-maven-plugin/pom.xml => appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.pom (100%) create mode 100644 appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/maven-metadata-local.xml delete mode 100644 tcp-msg-maven-plugin/README.md delete mode 100644 tcp-msg-maven-plugin/src/main/java/com/lgi/commons/maven/TcpMessagingMojo.java diff --git a/LICENSE-THIRD-PARTY.txt b/LICENSE-THIRD-PARTY.txt index 0e787667..00e2ee26 100644 --- a/LICENSE-THIRD-PARTY.txt +++ b/LICENSE-THIRD-PARTY.txt @@ -1,5 +1,5 @@ -Lists of 168 third-party dependencies. +Lists of 156 third-party dependencies. (Eclipse Public License - v 1.0) (GNU Lesser General Public License) Logback Classic Module (ch.qos.logback:logback-classic:1.2.3 - http://logback.qos.ch/logback-classic) (Eclipse Public License - v 1.0) (GNU Lesser General Public License) Logback Core Module (ch.qos.logback:logback-core:1.2.3 - http://logback.qos.ch/logback-core) (The Apache License, Version 2.0) spock-reports (com.athaydes:spock-reports:1.7.1 - https://github.com/renatoathaydes/spock-reports) @@ -51,9 +51,6 @@ Lists of 168 third-party dependencies. (Eclipse Distribution License - v 1.0) Jakarta XML Binding API (jakarta.xml.bind:jakarta.xml.bind-api:2.3.3 - https://github.com/eclipse-ee4j/jaxb-api/jakarta.xml.bind-api) (COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0) JavaBeans(TM) Activation Framework (javax.activation:activation:1.1.1 - http://java.sun.com/javase/technologies/desktop/javabeans/jaf/index.jsp) (CDDL/GPLv2+CE) JavaBeans Activation Framework API jar (javax.activation:javax.activation-api:1.2.0 - http://java.net/all/javax.activation-api/) - (COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0) JSR-250 Common Annotations for the JavaTM Platform (javax.annotation:jsr250-api:1.0 - http://jcp.org/aboutJava/communityprocess/final/jsr250/index.html) - (Apache License, Version 2.0) CDI APIs (javax.enterprise:cdi-api:1.0 - http://www.seamframework.org/Weld/cdi-api) - (The Apache Software License, Version 2.0) javax.inject (javax.inject:javax.inject:1 - http://code.google.com/p/atinject/) (CDDL 1.1) (GPL2 w/ CPE) jaxb-api (javax.xml.bind:jaxb-api:2.3.1 - https://github.com/javaee/jaxb-spec/jaxb-api) (Eclipse Public License 1.0) JUnit (junit:junit:4.13 - http://junit.org) (Apache License, Version 2.0) Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.10.14 - https://bytebuddy.net/byte-buddy) @@ -69,10 +66,6 @@ Lists of 168 third-party dependencies. (Apache License, Version 2.0) Apache HttpClient Mime (org.apache.httpcomponents:httpmime:4.5.12 - http://hc.apache.org/httpcomponents-client) (Apache License, Version 2.0) Apache Log4j API (org.apache.logging.log4j:log4j-api:2.13.3 - https://logging.apache.org/log4j/2.x/log4j-api/) (Apache License, Version 2.0) Apache Log4j to SLF4J Adapter (org.apache.logging.log4j:log4j-to-slf4j:2.13.3 - https://logging.apache.org/log4j/2.x/log4j-to-slf4j/) - (Apache License, Version 2.0) Maven Artifact (org.apache.maven:maven-artifact:3.6.3 - https://maven.apache.org/ref/3.6.3/maven-artifact/) - (Apache License, Version 2.0) Maven Model (org.apache.maven:maven-model:3.6.3 - https://maven.apache.org/ref/3.6.3/maven-model/) - (Apache License, Version 2.0) Maven Plugin API (org.apache.maven:maven-plugin-api:3.6.3 - https://maven.apache.org/ref/3.6.3/maven-plugin-api/) - (Apache License, Version 2.0) Maven Plugin Tools Java Annotations (org.apache.maven.plugin-tools:maven-plugin-annotations:3.6.0 - https://maven.apache.org/plugin-tools/maven-plugin-annotations) (The Apache Software License, Version 2.0) Apache Sling javax.activation bundle (org.apache.sling:org.apache.sling.javax.activation:0.1.0 - http://sling.apache.org/org.apache.sling.javax.activation) (Apache License, Version 2.0) Apache Tika core (org.apache.tika:tika-core:1.24.1 - http://tika.apache.org/) (Apache License, Version 2.0) tomcat-embed-core (org.apache.tomcat.embed:tomcat-embed-core:9.0.38 - https://tomcat.apache.org/) @@ -90,11 +83,6 @@ Lists of 168 third-party dependencies. (The Apache Software License, Version 2.0) Apache Groovy (org.codehaus.groovy:groovy-templates:2.5.13 - https://groovy-lang.org) (The Apache Software License, Version 2.0) Apache Groovy (org.codehaus.groovy:groovy-test:2.5.13 - https://groovy-lang.org) (The Apache Software License, Version 2.0) Apache Groovy (org.codehaus.groovy:groovy-xml:2.5.13 - https://groovy-lang.org) - (Apache License, Version 2.0) Plexus Classworlds (org.codehaus.plexus:plexus-classworlds:2.6.0 - http://codehaus-plexus.github.io/plexus-classworlds/) - (The Apache Software License, Version 2.0) Plexus :: Component Annotations (org.codehaus.plexus:plexus-component-annotations:1.5.5 - http://plexus.codehaus.org/plexus-containers/plexus-component-annotations/) - (Apache License, Version 2.0) Plexus Common Utilities (org.codehaus.plexus:plexus-utils:3.2.1 - http://codehaus-plexus.github.io/plexus-utils/) - (Eclipse Public License, Version 1.0) org.eclipse.sisu.inject (org.eclipse.sisu:org.eclipse.sisu.inject:0.3.4 - http://www.eclipse.org/sisu/org.eclipse.sisu.inject/) - (Eclipse Public License, Version 1.0) org.eclipse.sisu.plexus (org.eclipse.sisu:org.eclipse.sisu.plexus:0.3.4 - http://www.eclipse.org/sisu/org.eclipse.sisu.plexus/) (Apache License, Version 2.0) flyway-core (org.flywaydb:flyway-core:6.4.4 - https://flywaydb.org/flyway-core) (Apache License, Version 2.0) Apache FreeMarker (org.freemarker:freemarker:2.3.30 - https://freemarker.apache.org/) (EPL 2.0) (GPL2 w/ CPE) Jakarta Expression Language 3.0 (org.glassfish:jakarta.el:3.0.3 - https://projects.eclipse.org/projects/ee4j.el) diff --git a/appstore-metadata-service-tests/src/test/java/com/lgi/appstore/metadata/test/framework/TestSession.java b/appstore-metadata-service-tests/src/test/java/com/lgi/appstore/metadata/test/framework/TestSession.java index e7458989..df545ff7 100644 --- a/appstore-metadata-service-tests/src/test/java/com/lgi/appstore/metadata/test/framework/TestSession.java +++ b/appstore-metadata-service-tests/src/test/java/com/lgi/appstore/metadata/test/framework/TestSession.java @@ -96,8 +96,10 @@ public String getTestedServiceLocation() { String urlForSanity = environment.getProperty(ENV_VAR_URL_FOR_SANITY_TESTS); if (currentTestType == TestType.INTEGRATION_SANITY) { + LOG.info("Service location for local/mocked smoke tests (usually on master branch): {}", urlForSmoke); return Optional.ofNullable(urlForSanity).orElseThrow(() -> new AssumptionViolatedException(String.format("There was no var %s specified to locate the service for sanity testing.", ENV_VAR_URL_FOR_SANITY_TESTS))); } else if (currentTestType == TestType.INTEGRATION_SMOKE) { + LOG.info("Service location for local/mocked sanity tests (usually on PR branch): {}", urlForSmoke); return Optional.ofNullable(urlForSmoke).orElseThrow(() -> new AssumptionViolatedException(String.format("There was no var %s specified to locate the service for smoke testing.", ENV_VAR_URL_FOR_SMOKE_TESTS))); } else { throw new NotImplementedException(String.format("Base URL not specified for test type=%s", currentTestType)); diff --git a/appstore-metadata-service/README.md b/appstore-metadata-service/README.md index 9b114c49..ab314ada 100644 --- a/appstore-metadata-service/README.md +++ b/appstore-metadata-service/README.md @@ -3,12 +3,6 @@ AppStore Metadata Service In order to build the service you need to run: -``` -mvn -pl tcp-msg-maven-plugin clean install plugin:descriptor -``` - -Then execute to package it: - ``` mvn package ``` diff --git a/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/maven-metadata-local.xml b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/maven-metadata-local.xml new file mode 100644 index 00000000..2cf6f597 --- /dev/null +++ b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/maven-metadata-local.xml @@ -0,0 +1,24 @@ + + + com.lgi.common.maven + tcp-msg-maven-plugin + 0.0.1-SNAPSHOT + + + true + + 20210120152602 + + + jar + 0.0.1-SNAPSHOT + 20210120152602 + + + pom + 0.0.1-SNAPSHOT + 20210120152602 + + + + diff --git a/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.jar b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.jar new file mode 100644 index 0000000000000000000000000000000000000000..1155b4e799d8c68ceffef90a90c256bd4f1245af GIT binary patch literal 14076 zcmbum18`v5wk{lW%#Ll_wmP<{b9Kh6&Nxlf#k01yD0HEOG{`ds!oQ?4Xg;1+Hr6zMBK#?i{r?id z(ZH74%E5&CUwG8EmQE&S|C3^$K43pI_#agN=%Ig6eCYZ=P{IF=>aP|#{Ehn0#-RKI z_3sY&Yc~DjflyR-l?MR;sKEjNK>y(R_ptm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>mz@ zJnrSeiMeftX@?WD@AKZ+JbN98M=Y4Jqt>lcZ^HGl3)#M%1V2xlfoiQhKm){^I8(Sz zoJJg#Lg6S#R>{_KHcP)AEis{4S4p+Am`Q~cg@~3oXX7u%AolIoAU}y~gLE@8Kl!XD zuD%!EXk@BEVnkigHqRHdq5p$>8ngEO?$Pdjf7@eJovYNSVtv7o^j!->Dqu-2p_7)B zikzO59#LbyWmb^Zie-oO-o%Z?(Ajk_Nkrgkmx?J8-w60rQ^p^JnjZ>exz5|~-Epfs zGfRhal-xog?*xiuz4S;9CVq1^#*q_}D|iF-0k`%@Et;{g+vhI3!ET$nJ4ibog4Qpv zS9SR1d7TV`!RX3u@B$nnA!4ga9r+a|TEK3eDp$}}Oxyub3&zYmX;V`>UJkDpLI@kd z$AgVXG7Bs^J~hxp8#P*#PmcV=2U5O}B+)4qn=Kd+f{!S7D|G87^s*l5E;_kD9Zps? z9#gxW@G6M`am*JHGWo~AgIy=jq>7=6xOT%5Cl)O(rj1U7Zrkz!@ty07$C$DY;P08G z@-ef*vB{ZaKW3ET$NlAhJF{%;j0di;BN{H>tmFNFVG&G8pMJir-$)87&P&h}@8 z!msL%zb<%ySN@HU*MAHCuR?`iTK^^UpQ=56GednW?mw9SaZ&$I>inwy_>Cy_e~I{y z8MuEJ^QYp!szH8>$^Q`ZD=POtar~+d`OPu-|8x9REApQ^=vTGKZ?4n7as5~H@9#4I z9Gj1z;orD1fc{hL@Gp$t5ywBPN&X9^-cR}iAP0sox#_$Tt8f!N>36lnhm`Tq>d{vGk3wzS`f47C579{Ov8 o`@6J%GIPJBMbiH-rTsQ~vJxO4`}41=FF1gLk7dHo@ayaU16C$QEC2ui literal 0 HcmV?d00001 diff --git a/tcp-msg-maven-plugin/pom.xml b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.pom similarity index 100% rename from tcp-msg-maven-plugin/pom.xml rename to appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/0.0.1-SNAPSHOT/tcp-msg-maven-plugin-0.0.1-SNAPSHOT.pom diff --git a/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/maven-metadata-local.xml b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/maven-metadata-local.xml new file mode 100644 index 00000000..50d9c64e --- /dev/null +++ b/appstore-metadata-service/lib/com/lgi/common/maven/tcp-msg-maven-plugin/maven-metadata-local.xml @@ -0,0 +1,11 @@ + + + com.lgi.common.maven + tcp-msg-maven-plugin + + + 0.0.1-SNAPSHOT + + 20210120152602 + + diff --git a/pom.xml b/pom.xml index 296899be..1d287b69 100644 --- a/pom.xml +++ b/pom.xml @@ -17,7 +17,6 @@ appstore-metadata-service appstore-metadata-service-tests - tcp-msg-maven-plugin @@ -81,6 +80,13 @@ + + + local-plugins-repo + file://${project.basedir}/lib + + + org.springframework.boot @@ -134,6 +140,12 @@ + + + com.lgi.common.maven + tcp-msg-maven-plugin + 0.0.1-SNAPSHOT + diff --git a/tcp-msg-maven-plugin/README.md b/tcp-msg-maven-plugin/README.md deleted file mode 100644 index 1ad7e0dc..00000000 --- a/tcp-msg-maven-plugin/README.md +++ /dev/null @@ -1,123 +0,0 @@ -# Description - -Use case ---- - -Our build script was starting `Postgres` container with `maven-docker-plugin` and then use the DB instance to generate some `JOOQ` artifacts in later steps. - -``` - - ... - docker-maven-plugin - ... - - - - ... - postgres:11 - ... - - - - - - - start-postgres-container - generate-sources - - start - - - - stop-postgres-container - process-sources - - stop - - - - - -``` - -But in case there is some error with any operations between `start` and `stop` above, then maven leaves the running container and consecutive build attempts will fail so one has to put down the leftover container manually first. - -So the question arisen if there any way/plugin in maven to specify some finally action/phase? So that in case of failure in build scripts one would still be able to release some resources which might've been already reserved? - -After some initial research it did not seem to be possible in maven to do such a cleanup - neither with built-in nor with community plugins. - -Proposal ---- - -The goal could be achieved applying similar solution to what `testcontainers` are doing using **Ryuk**: https://github.com/testcontainers/moby-ryuk - -``` - - ryuk-summoned - testcontainers/ryuk:0.3.0 - - - ryuk.port:8080 - - - - /var/run/docker.sock:/var/run/docker.sock - - - true - - -``` - -The first issue is that mapping volume is OS specific - works perfectly on Linux and Mac but not on Windows. -But most probably MVN profiles might be used to provide OS specific host path for mapping. - -**NOTE:** Mind that Docker on Windows runs in linux virtual box anyway - so the path should be similar - the question is if it needs any prefix like `/c/...` for bash running on windows to resolve the path correctly. - -The second challenge is that there must be feed with a hart beat towards Ryuk container at least 1 per 10s through a TCP socket containing deathnote, eg. like this: `printf "label=something_to_kill" | nc localhost 8080`. See: https://github.com/testcontainers/moby-ryuk/issues/17 - -This is easy to achieve with below maven exec plugin and a simple `setup-ryuk.sh` script calling the command mentioned above. But this would not be so straight forward on Window OS again. - -Solution ---- - -To make this platform independent the best way seemed to be to come up with own maven plugin sending messages to TCP socket. -This plugin was created specifically for that goal in the context of above use case. It starts a daemon which makes multiple attempts to send the message to the network socket with command specified in - -Usage example ---- - -``` - - com.lgi.common.maven - tcp-msg-maven-plugin - ... - - - write-death-note-for-postgres - generate-sources - - tcpmsg - - - ${ryuk.port} - label=killme - 2 - - - - -``` - -Configuration parameters ---- - -- `host, defaultValue = "localhost" / String` - Hostname where to send the command message. - -- `repeatAmount, defaultValue = 1 / Integer` - How many attempts the plugin should do to send the message. - -- `intervalSec, defaultValue = 5 / Integer` - How often to attempt sending the message. First interval takes place just after start befor first attempt. - -- `port / Integer` - TCP port where to send the command message. - -- `msg / String` - Message to be sent on above port. diff --git a/tcp-msg-maven-plugin/src/main/java/com/lgi/commons/maven/TcpMessagingMojo.java b/tcp-msg-maven-plugin/src/main/java/com/lgi/commons/maven/TcpMessagingMojo.java deleted file mode 100644 index 6a41e050..00000000 --- a/tcp-msg-maven-plugin/src/main/java/com/lgi/commons/maven/TcpMessagingMojo.java +++ /dev/null @@ -1,120 +0,0 @@ -/* - * If not stated otherwise in this file or this component's LICENSE file the - * following copyright and licenses apply: - * - * Copyright 2020 Liberty Global B.V. - * - * Licensed 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 com.lgi.commons.maven; - -import org.apache.maven.plugin.AbstractMojo; -import org.apache.maven.plugin.MojoExecutionException; -import org.apache.maven.plugins.annotations.Mojo; -import org.apache.maven.plugins.annotations.Parameter; - -import java.io.BufferedReader; -import java.io.IOException; -import java.io.InputStreamReader; -import java.io.PrintWriter; -import java.net.Socket; -import java.util.stream.IntStream; - - -@Mojo(name = "tcpmsg") -public class TcpMessagingMojo extends AbstractMojo { - private static final String LOG_PREFIX = "maven-tcpmsg"; - - @Parameter(property = "tcpmsg.host", defaultValue = "localhost") - private String host; - - @Parameter(property = "tcpmsg.repeatAmount", defaultValue = "1") - private Integer repeatAmount; - - @Parameter(property = "tcpmsg.intervalSec", defaultValue = "5") - private Integer intervalSec; - - @Parameter(property = "tcpmsg.port") - private Integer port; - - @Parameter(property = "tcpmsg.msg") - private String msg; - - @Override - public void execute() throws MojoExecutionException { - if (port == null) { - getLog().error("Please specify 'port' param. of TCP socket."); - throw new MojoExecutionException(getPluginContext().keySet().toString()); - } else if (msg == null) { - getLog().warn("Please specify 'msg' param. with message to send."); - } else { - doCommunicate(); - } - } - - private void doCommunicate() { - Thread communicationChannel = new Thread( - new ThreadGroup(LOG_PREFIX), - this::sendMessages, - String.format("%s-send", LOG_PREFIX) - ); - communicationChannel.setDaemon(true); - communicationChannel.start(); - } - - private void sendMessages() { - IntStream.range(0, repeatAmount).forEach(attempt -> { - sleepForConfiguredInterval(); - getLog().info(String.format("%s: Attempting [%d] to send message '%s' to TCP socket on %s:%d", LOG_PREFIX, attempt, msg, host, port)); - handleSendAttempt(); - }); - } - - private void sleepForConfiguredInterval() { - try { - Thread.sleep(intervalSec * 1000); - } catch (InterruptedException e) { - e.printStackTrace(); - } - } - - private void handleSendAttempt() { - try (Socket clientSocket = new Socket(host, port)) { - try (PrintWriter out = new PrintWriter(clientSocket.getOutputStream(), true)) { - try (BufferedReader in = new BufferedReader(new InputStreamReader(clientSocket.getInputStream()))) { - String response = communicate(in, out); - getLog().info(String.format("%s: Received: %s", LOG_PREFIX, response)); - } - } - } catch (IOException e) { - logSocketIssue(e); - } - } - - private String communicate(BufferedReader in, PrintWriter out) { - try { - out.println(msg); - return in.readLine(); - } catch (IOException e) { - String errorMsg = String.format("%s: Issue with sending message '%s' to TCP socket on %s:%d: %s - %s", LOG_PREFIX, msg, host, port, e.getClass().getSimpleName(), e.getMessage()); - getLog().error(errorMsg); - return null; - } - } - - private void logSocketIssue(Exception e) { - String warnMsg = String.format("%s: Issue with connection to TCP socket on %s:%d - %s: %s", LOG_PREFIX, host, port, e.getClass().getSimpleName(), e.getMessage()); - getLog().warn(warnMsg); - } -} \ No newline at end of file