Skip to content

Commit 6fde194

Browse files
committed
Merge pull request #7 from ArpNetworking/add_rpm
add rpm build
2 parents 1d16bf1 + 3946a18 commit 6fde194

File tree

11 files changed

+431
-3
lines changed

11 files changed

+431
-3
lines changed

.travis.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@ cache:
33
- "$HOME/.m2"
44
- "$HOME/.jdk"
55
sudo: false
6+
addons:
7+
apt:
8+
packages:
9+
- rpm
610
env:
711
global:
812
- JDKW=https://raw.githubusercontent.com/vjkoskela/jdk-wrapper/master/jdk-wrapper.sh
@@ -15,5 +19,5 @@ install: true
1519
before_script:
1620
- gpg --import arpnetworking.key
1721
script:
18-
- curl -s ${JDKW} | bash /dev/stdin ./mvnw clean install --settings settings.xml -P ci -Dgpg.skip=true -U
22+
- curl -s ${JDKW} | bash /dev/stdin ./mvnw clean install --settings settings.xml -P ci -P rpm -Dgpg.skip=true -U
1923
- if [ \( -n "${TRAVIS_TAG}" \) -a "${TRAVIS_PULL_REQUEST}" = "false" ]; then curl -s ${JDKW} | bash /dev/stdin ./mvnw deploy --settings settings.xml -P ci -DskipAllVerification=true; fi;

config/clusterPipeline.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sinks":
3+
[
4+
]
5+
}

config/config.json

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
{
2+
"monitoringCluster": "tsd_aggregator_dev",
3+
"httpPort": 7066,
4+
"httpHost": "0.0.0.0",
5+
"httpStatusPath": "/status",
6+
"aggregationHost": "0.0.0.0",
7+
"aggregationPort": 7065,
8+
"logDirectory": "logs",
9+
"hostPipelineConfiguration": "/opt/cluster-aggregator/config/hostPipeline.json",
10+
"clusterPipelineConfiguration": "/opt/cluster-aggregator/config/clusterPipeline.json",
11+
"maxConnectionTimeout": "PT2M",
12+
"minConnectionTimeout": "PT1M",
13+
"clusterHostSuffix": ".cluster",
14+
"jvmMetricsCollectionInterval": "PT.5S",
15+
"rebalanceConfiguration": {
16+
"maxParallel": 100,
17+
"threshold": 500
18+
},
19+
"databaseConfigurations": {
20+
"metrics_clusteragg": {
21+
"jdbcUrl": "jdbc:h2:/opt/cluster-aggregator/data/metrics:clusteragg;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=7067;MODE=PostgreSQL;INIT=create schema if not exists clusteragg;DB_CLOSE_DELAY=-1",
22+
"driverName": "org.h2.Driver",
23+
"username": "sa",
24+
"password": "secret",
25+
"maximumPoolSize": 2,
26+
"minimumIdle": 2,
27+
"idleTimeout": 0,
28+
"modelPackages": [ "com.arpnetworking.clusteraggregator.models.ebean" ]
29+
},
30+
"metrics_clusteragg_ddl": {
31+
"jdbcUrl": "jdbc:h2:/opt/cluster-aggregator/data/metrics:clusteragg;AUTO_SERVER=TRUE;AUTO_SERVER_PORT=7067;MODE=PostgreSQL;INIT=create schema if not exists clusteragg;DB_CLOSE_DELAY=-1",
32+
"driverName": "org.h2.Driver",
33+
"username": "sa",
34+
"password": "secret",
35+
"migrationLocations": ["db/migration/metrics_clusteragg/common"],
36+
"migrationSchemas": ["clusteragg"],
37+
"maximumPoolSize": 2,
38+
"minimumIdle": 0,
39+
"idleTimeout": 10000,
40+
"modelPackages": [ "com.arpnetworking.clusteraggregator.models.ebean" ]
41+
}
42+
},
43+
"akkaConfiguration": {
44+
"akka": {
45+
"loggers": ["akka.event.slf4j.Slf4jLogger"],
46+
"loglevel": "DEBUG",
47+
"stdout-loglevel": "DEBUG",
48+
"logging-filter": "akka.event.slf4j.Slf4jLoggingFilter",
49+
"actor": {
50+
"debug": {
51+
"unhandled": "on"
52+
},
53+
"provider": "akka.cluster.ClusterActorRefProvider"
54+
},
55+
"cluster": {
56+
"seed-nodes": [
57+
"akka.tcp://[email protected]:2551"
58+
],
59+
"auto-down-unreachable-after": "300s",
60+
"sharding": {
61+
"guardian-name": "sharding",
62+
"role": "",
63+
"retry-interval": "2 s",
64+
"buffer-size": 100000,
65+
"handoff-timeout": "60 s",
66+
"rebalance-interval": "10 s",
67+
"snapshot-interval": "720 s",
68+
"least-shard-allocation-strategy": {
69+
"rebalance-threshold": 10,
70+
"max-simultaneous-rebalance": 3
71+
}
72+
}
73+
},
74+
"remote": {
75+
"log-remote-lifecycle-events": "on",
76+
"netty": {
77+
"tcp": {
78+
"hostname": "127.0.0.1",
79+
"port": 2551
80+
}
81+
}
82+
},
83+
"persistence": {
84+
"journal": {
85+
"plugin": "akka.persistence.journal.leveldb",
86+
"leveldb" : {
87+
"dir": "/opt/cluster-aggregator/data/journal"
88+
}
89+
}
90+
}
91+
}
92+
}
93+
}

config/hostPipeline.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"sinks":
3+
[
4+
]
5+
}

config/logback.xml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
~ Copyright 2014 Brandon Arp
4+
~
5+
~ Licensed under the Apache License, Version 2.0 (the "License");
6+
~ you may not use this file except in compliance with the License.
7+
~ You may obtain a copy of the License at
8+
~
9+
~ http://www.apache.org/licenses/LICENSE-2.0
10+
~
11+
~ Unless required by applicable law or agreed to in writing, software
12+
~ distributed under the License is distributed on an "AS IS" BASIS,
13+
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
~ See the License for the specific language governing permissions and
15+
~ limitations under the License.
16+
-->
17+
<configuration>
18+
<appender name="cagg-logger" class="ch.qos.logback.core.rolling.RollingFileAppender">
19+
<file>/opt/cluster-aggregator/logs/cluster-aggregator.log</file>
20+
<rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
21+
<timeBasedFileNamingAndTriggeringPolicy class="com.arpnetworking.logback.SizeAndRandomizedTimeBasedFNATP">
22+
<maxOffsetInMillis>900000</maxOffsetInMillis>
23+
<maxFileSize>100MB</maxFileSize>
24+
</timeBasedFileNamingAndTriggeringPolicy>
25+
<fileNamePattern>/opt/cluster-aggregator/logs/cluster-aggregator.%d{yyyy-MM-dd_HH}.%i.log.gz</fileNamePattern>
26+
<maxHistory>4</maxHistory>
27+
<cleanHistoryOnStart>true</cleanHistoryOnStart>
28+
</rollingPolicy>
29+
<encoder class="com.arpnetworking.logback.StenoEncoder">
30+
<injectContextLogger>true</injectContextLogger>
31+
<compressLoggerName>true</compressLoggerName>
32+
<jacksonModule class="com.fasterxml.jackson.datatype.joda.JodaModule" />
33+
<jacksonModule class="com.fasterxml.jackson.datatype.guava.GuavaModule" />
34+
<jacksonModule class="com.fasterxml.jackson.datatype.jdk8.Jdk8Module" />
35+
<injectBeanIdentifier>true</injectBeanIdentifier>
36+
</encoder>
37+
</appender>
38+
39+
40+
<appender name="cagg-async" class="ch.qos.logback.classic.AsyncAppender">
41+
<appender-ref ref="cagg-logger"/>
42+
<discardingThreshold>50</discardingThreshold>
43+
<queueSize>500</queueSize>
44+
</appender>
45+
46+
<logger name="org.reflections.Reflections" level="ERROR" />
47+
48+
<root level="INFO">
49+
<appender-ref ref="cagg-async"/>
50+
</root>
51+
</configuration>

pom.xml

Lines changed: 83 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@
126126
<avaje.ebeanorm.mavenenhancer.version>4.7.1</avaje.ebeanorm.mavenenhancer.version>
127127
<aspectjtools.maven.plugin>1.8.9</aspectjtools.maven.plugin>
128128
<aspectj.maven.plugin.version>1.8</aspectj.maven.plugin.version>
129+
<rpm.maven.plugin.version>2.1.5</rpm.maven.plugin.version>
129130

130131
<!-- Findbugs -->
131132
<findbugs.exclude>${project.basedir}/findbugs.exclude.xml</findbugs.exclude>
@@ -204,7 +205,7 @@
204205
<programs>
205206
<program>
206207
<id>cluster-aggregator</id>
207-
<mainClass>com.arpnetworking.metrics.clusteraggregator.Main</mainClass>
208+
<mainClass>com.arpnetworking.clusteraggregator.Main</mainClass>
208209
</program>
209210
</programs>
210211
</configuration>
@@ -603,12 +604,92 @@
603604
<scope>test</scope>
604605
</dependency>
605606
</dependencies>
606-
607607
<repositories>
608608
<repository>
609609
<id>krasserm</id>
610610
<name>Akka Cassandra Persistence</name>
611611
<url>http://dl.bintray.com/krasserm/maven</url>
612612
</repository>
613613
</repositories>
614+
<profiles>
615+
<profile>
616+
<id>rpm</id>
617+
<activation>
618+
<activeByDefault>false</activeByDefault>
619+
</activation>
620+
<build>
621+
<plugins>
622+
<plugin>
623+
<groupId>org.codehaus.mojo</groupId>
624+
<artifactId>rpm-maven-plugin</artifactId>
625+
<version>${rpm.maven.plugin.version}</version>
626+
<executions>
627+
<execution>
628+
<id>generate-rpm</id>
629+
<goals>
630+
<goal>rpm</goal>
631+
</goals>
632+
</execution>
633+
</executions>
634+
<configuration>
635+
<name>cluster-aggregator</name>
636+
<license>Apache 2 License</license>
637+
<autoRequires>false</autoRequires>
638+
<group>System Environment/Daemons</group>
639+
<preinstallScriptlet>
640+
<scriptFile>rpm/scripts/pre.sh</scriptFile>
641+
</preinstallScriptlet>
642+
<postinstallScriptlet>
643+
<scriptFile>rpm/scripts/post.sh</scriptFile>
644+
</postinstallScriptlet>
645+
<preremoveScriptlet>
646+
<scriptFile>rpm/scripts/preun.sh</scriptFile>
647+
</preremoveScriptlet>
648+
<postremoveScriptlet>
649+
<scriptFile>rpm/scripts/postun.sh</scriptFile>
650+
</postremoveScriptlet>
651+
<requires>
652+
<require>java &gt;= ${jdk.version}</require>
653+
</requires>
654+
<mappings>
655+
<mapping>
656+
<directory>/opt/cluster-aggregator</directory>
657+
<sources>
658+
<source>
659+
<location>target/appassembler</location>
660+
</source>
661+
</sources>
662+
</mapping>
663+
<mapping>
664+
<directory>/opt/cluster-aggregator/config</directory>
665+
<sources>
666+
<source>
667+
<location>config</location>
668+
</source>
669+
</sources>
670+
</mapping>
671+
<mapping>
672+
<directory>/</directory>
673+
<sources>
674+
<source>
675+
<location>rpm/fs</location>
676+
</source>
677+
</sources>
678+
</mapping>
679+
<!-- symlink the start script -->
680+
<mapping>
681+
<directory>/usr/local/bin</directory>
682+
<sources>
683+
<softlinkSource>
684+
<location>/opt/cluster-aggregator/bin/cluster-aggregator</location>
685+
</softlinkSource>
686+
</sources>
687+
</mapping>
688+
</mappings>
689+
</configuration>
690+
</plugin>
691+
</plugins>
692+
</build>
693+
</profile>
694+
</profiles>
614695
</project>

0 commit comments

Comments
 (0)