You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@skywalking.apache.org by GitBox <gi...@apache.org> on 2018/02/28 15:43:04 UTC

[GitHub] peng-yongsheng closed pull request #852: Module/apm backend dist

peng-yongsheng closed pull request #852: Module/apm backend dist
URL: https://github.com/apache/incubator-skywalking/pull/852
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/apm-collector/apm-collector-boot/bin/collectorService.bat b/apm-backend-dist/bin/collectorService.bat
similarity index 89%
rename from apm-collector/apm-collector-boot/bin/collectorService.bat
rename to apm-backend-dist/bin/collectorService.bat
index f9d2826d0..3bbbd38f5 100644
--- a/apm-collector/apm-collector-boot/bin/collectorService.bat
+++ b/apm-backend-dist/bin/collectorService.bat
@@ -6,7 +6,7 @@ set COLLECTOR_HOME=%~dp0%..
 set COLLECTOR_OPTS="-Xms256M -Xmx512M -Dcollector.logDir=%COLLECTOR_HOME%\logs"
 
 set CLASSPATH=%COLLECTOR_HOME%\config;.;
-set CLASSPATH=%COLLECTOR_HOME%\libs\*;%CLASSPATH%
+set CLASSPATH=%COLLECTOR_HOME%\collector-libs\*;%CLASSPATH%
 
 if defined JAVA_HOME (
  set _EXECJAVA="%JAVA_HOME:"=%"\bin\java
diff --git a/apm-collector/apm-collector-boot/bin/collectorService.sh b/apm-backend-dist/bin/collectorService.sh
similarity index 94%
rename from apm-collector/apm-collector-boot/bin/collectorService.sh
rename to apm-backend-dist/bin/collectorService.sh
index dbb7774b2..069a681ab 100644
--- a/apm-collector/apm-collector-boot/bin/collectorService.sh
+++ b/apm-backend-dist/bin/collectorService.sh
@@ -15,7 +15,7 @@ _RUNJAVA=${JAVA_HOME}/bin/java
 [ -z "$JAVA_HOME" ] && _RUNJAVA=java
 
 CLASSPATH="$COLLECTOR_HOME/config:$CLASSPATH"
-for i in "$COLLECTOR_HOME"/libs/*.jar
+for i in "$COLLECTOR_HOME"/collector-libs/*.jar
 do
     CLASSPATH="$i:$CLASSPATH"
 done
diff --git a/apm-collector/apm-collector-boot/bin/startup.bat b/apm-backend-dist/bin/startup.bat
similarity index 65%
rename from apm-collector/apm-collector-boot/bin/startup.bat
rename to apm-backend-dist/bin/startup.bat
index d1f9f401d..7c00ffbc1 100644
--- a/apm-collector/apm-collector-boot/bin/startup.bat
+++ b/apm-backend-dist/bin/startup.bat
@@ -2,4 +2,5 @@
 
 setlocal
 call "%~dp0"\collectorService.bat start
+call "%~dp0"\webappService.bat start
 endlocal
diff --git a/apm-backend-dist/bin/startup.sh b/apm-backend-dist/bin/startup.sh
new file mode 100644
index 000000000..20f3b3b7c
--- /dev/null
+++ b/apm-backend-dist/bin/startup.sh
@@ -0,0 +1,10 @@
+#!/usr/bin/env sh
+
+PRG="$0"
+PRGDIR=`dirname "$PRG"`
+COLLECTOR_EXE=collectorService.sh
+WEBAPP_EXE=webappService.sh
+
+"$PRGDIR"/"$COLLECTOR_EXE"
+
+"$PRGDIR"/"$WEBAPP_EXE"
diff --git a/apm-backend-dist/bin/webappService.bat b/apm-backend-dist/bin/webappService.bat
new file mode 100644
index 000000000..e8d0c943c
--- /dev/null
+++ b/apm-backend-dist/bin/webappService.bat
@@ -0,0 +1,18 @@
+@echo off
+
+setlocal
+set WEBAPP_PROCESS_TITLE=Skywalking-Webapp
+set WEBAPP_HOME=%~dp0%..
+set JARPATH=%WEBAPP_HOME%\webapp
+
+if defined JAVA_HOME (
+ set _EXECJAVA="%JAVA_HOME:"=%"\bin\java
+)
+
+if not defined JAVA_HOME (
+ echo "JAVA_HOME not set."
+ set _EXECJAVA=java
+)
+
+start "%WEBAPP_PROCESS_TITLE%" %_EXECJAVA%  -jar %JARPATH%/skywalking-webapp.jar
+endlocal
diff --git a/apm-backend-dist/bin/webappService.sh b/apm-backend-dist/bin/webappService.sh
new file mode 100644
index 000000000..07b951b83
--- /dev/null
+++ b/apm-backend-dist/bin/webappService.sh
@@ -0,0 +1,27 @@
+#!/usr/bin/env sh
+
+PRG="$0"
+PRGDIR=`dirname "$PRG"`
+[ -z "$WEBAPP_HOME" ] && WEBAPP_HOME=`cd "$PRGDIR/.." >/dev/null; pwd`
+
+WEBAPP_LOG_DIR="${WEBAPP_HOME}/logs"
+JAVA_OPTS=" -Xms256M -Xmx512M"
+JAR_PATH="${WEBAPP_HOME}/webapp"
+
+if [ ! -d "${WEBAPP_HOME}/logs" ]; then
+    mkdir -p "${WEBAPP_LOG_DIR}"
+fi
+
+_RUNJAVA=${JAVA_HOME}/bin/java
+[ -z "$JAVA_HOME" ] && _RUNJAVA=java
+
+eval exec "\"$_RUNJAVA\" ${JAVA_OPTS} -jar ${JAR_PATH}/skywalking-webapp.jar \
+        2>${WEBAPP_LOG_DIR}/webapp.log 1> /dev/null &"
+
+if [ $? -eq 0 ]; then
+    sleep 1
+	echo "Skywalking Web Application started successfully!"
+else
+	echo "Skywalking Web Application started failure!"
+	exit 1
+fi
diff --git a/apm-backend-dist/pom.xml b/apm-backend-dist/pom.xml
new file mode 100644
index 000000000..88a90bdd7
--- /dev/null
+++ b/apm-backend-dist/pom.xml
@@ -0,0 +1,77 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<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/xsd/maven-4.0.0.xsd">
+    <parent>
+        <artifactId>apm</artifactId>
+        <groupId>org.apache.skywalking</groupId>
+        <version>5.0.0-alpha-SNAPSHOT</version>
+    </parent>
+    <modelVersion>4.0.0</modelVersion>
+
+    <artifactId>apm-backend-dist</artifactId>
+    <packaging>pom</packaging>
+
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-collector-boot</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.skywalking</groupId>
+            <artifactId>apm-collector-boot</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>skywalking-backend</finalName>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>dist</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <attach>true</attach>
+                    <tarLongFileMode>posix</tarLongFileMode>
+                    <runOnlyAtExecutionRoot>false</runOnlyAtExecutionRoot>
+                    <descriptors>
+                        <descriptor>${project.basedir}/src/main/assembly/binary.xml</descriptor>
+                    </descriptors>
+                    <appendAssemblyId>false</appendAssemblyId>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                        <configuration>
+                            <tasks>
+                                <copy file="${project.build.directory}/skywalking-backend.tar.gz"
+                                      tofile="${project.basedir}/../packages/skywalking-backend.tar.gz" overwrite="true"/>
+                                <copy file="${project.build.directory}/skywalking-backend.zip"
+                                      tofile="${project.basedir}/../packages/skywalking-backend.zip" overwrite="true"/>
+                            </tasks>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+</project>
\ No newline at end of file
diff --git a/apm-backend-dist/src/main/assembly/binary.xml b/apm-backend-dist/src/main/assembly/binary.xml
new file mode 100644
index 000000000..c491faf8e
--- /dev/null
+++ b/apm-backend-dist/src/main/assembly/binary.xml
@@ -0,0 +1,58 @@
+<!--
+  ~ 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.
+  ~
+  -->
+
+<assembly
+    xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
+    <id>dist</id>
+    <formats>
+        <format>zip</format>
+        <format>tar.gz</format>
+    </formats>
+    <fileSets>
+        <fileSet>
+            <directory>${project.basedir}/bin</directory>
+            <outputDirectory>/bin</outputDirectory>
+            <includes>
+                <include>*.sh</include>
+                <include>*.bat</include>
+            </includes>
+            <fileMode>0755</fileMode>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/../apm-collector/apm-collector-boot/target/skywalking-collector-assembly/skywalking-collector/config</directory>
+            <outputDirectory>/config</outputDirectory>
+            <includes>
+                <include>*.yml</include>
+                <include>*.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>${project.basedir}/../apm-collector/apm-collector-boot/target/skywalking-collector-assembly/skywalking-collector/libs</directory>
+            <outputDirectory>/collector-libs</outputDirectory>
+        </fileSet>
+    </fileSets>
+    <files>
+        <file>
+            <source>${project.basedir}/../apm-webapp/target/skywalking-webapp.jar</source>
+            <outputDirectory>/webapp</outputDirectory>
+            <fileMode>0644</fileMode>
+        </file>
+    </files>
+</assembly>
diff --git a/apm-collector/apm-collector-boot/bin/startup.sh b/apm-collector/apm-collector-boot/bin/startup.sh
deleted file mode 100644
index d8f441aa7..000000000
--- a/apm-collector/apm-collector-boot/bin/startup.sh
+++ /dev/null
@@ -1,7 +0,0 @@
-#!/usr/bin/env sh
-
-PRG="$0"
-PRGDIR=`dirname "$PRG"`
-EXECUTABLE=collectorService.sh
-
-exec "$PRGDIR"/"$EXECUTABLE" start
diff --git a/apm-collector/apm-collector-boot/pom.xml b/apm-collector/apm-collector-boot/pom.xml
index 99605cca1..1acface4b 100644
--- a/apm-collector/apm-collector-boot/pom.xml
+++ b/apm-collector/apm-collector-boot/pom.xml
@@ -227,26 +227,7 @@
                     </execution>
                 </executions>
             </plugin>
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-antrun-plugin</artifactId>
-                <executions>
-                    <execution>
-                        <phase>package</phase>
-                        <goals>
-                            <goal>run</goal>
-                        </goals>
-                        <configuration>
-                            <tasks>
-                                <copy file="${project.build.directory}/skywalking-collector-assembly.tar.gz"
-                                      tofile="${project.basedir}/../../packages/skywalking-collector.tar.gz" overwrite="true"/>
-                                <copy file="${project.build.directory}/skywalking-collector-assembly.zip"
-                                      tofile="${project.basedir}/../../packages/skywalking-collector.zip" overwrite="true"/>
-                            </tasks>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
+
             <plugin>
                 <groupId>com.spotify</groupId>
                 <artifactId>docker-maven-plugin</artifactId>
diff --git a/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml b/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml
index d694f8ed6..ea2ee62ac 100644
--- a/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml
+++ b/apm-collector/apm-collector-boot/src/main/assembly/assembly.xml
@@ -22,8 +22,7 @@
     xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
     <id>assembly</id>
     <formats>
-        <format>zip</format>
-        <format>tar.gz</format>
+        <format>dir</format>
     </formats>
     <dependencySets>
         <dependencySet>
@@ -32,15 +31,6 @@
         </dependencySet>
     </dependencySets>
     <fileSets>
-        <fileSet>
-            <directory>${project.basedir}/bin</directory>
-            <outputDirectory>/bin</outputDirectory>
-            <includes>
-                <include>*.sh</include>
-                <include>*.bat</include>
-            </includes>
-            <fileMode>0755</fileMode>
-        </fileSet>
         <fileSet>
             <directory>src/main/resources</directory>
             <outputDirectory>/config</outputDirectory>
diff --git a/pom.xml b/pom.xml
index 08e93f514..bcbbff716 100644
--- a/pom.xml
+++ b/pom.xml
@@ -64,6 +64,7 @@
         <module>apm-collector</module>
         <module>apm-protocol</module>
         <module>apm-webapp</module>
+        <module>apm-backend-dist</module>
     </modules>
     <packaging>pom</packaging>
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services