This is an automated email from the ASF dual-hosted git repository.

dpavlov pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ignite-teamcity-bot.git


The following commit(s) were added to refs/heads/master by this push:
     new 5d8ddb0  Server module more skeletons were added
5d8ddb0 is described below

commit 5d8ddb0e64231affd605eb10cfc2205ae4b6e141
Author: Dmitriy Pavlov <dpav...@apache.org>
AuthorDate: Thu Sep 20 21:13:53 2018 +0300

    Server module more skeletons were added
---
 .../org/apache/ignite/ci/db/Ignite2Configurer.java | 69 ++++++++++++++++++++++
 .../java/org/apache/ignite/ci/db/TcHelperDb.java   | 51 +++-------------
 tc-bot-server/build.gradle                         | 54 +++++++++++++++++
 tc-bot-server/header.txt                           | 14 +++++
 .../org/apache/ignite/ci/TcHelperDbLauncher.java   | 26 ++++++++
 5 files changed, 170 insertions(+), 44 deletions(-)

diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
new file mode 100644
index 0000000..048a152
--- /dev/null
+++ 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/Ignite2Configurer.java
@@ -0,0 +1,69 @@
+/*
+ * 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.
+ */
+package org.apache.ignite.ci.db;
+
+import ch.qos.logback.classic.Level;
+import ch.qos.logback.classic.Logger;
+import ch.qos.logback.classic.LoggerContext;
+import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
+import ch.qos.logback.core.rolling.RollingFileAppender;
+import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
+import org.apache.ignite.ci.HelperConfig;
+import org.slf4j.LoggerFactory;
+
+import java.io.File;
+
+public class Ignite2Configurer {
+    static void configLogger(File workDir, String subdir) {
+        LoggerContext logCtx = (LoggerContext) 
LoggerFactory.getILoggerFactory();
+
+        PatternLayoutEncoder logEncoder  = new PatternLayoutEncoder();
+        logEncoder.setContext(logCtx);
+        logEncoder.setPattern("%-12date{YYYY-MM-dd HH:mm:ss.SSS} %-5level [%t] 
- %msg%n");
+        logEncoder.start();
+
+        RollingFileAppender rollingFa = new RollingFileAppender();
+        rollingFa.setContext(logCtx);
+        rollingFa.setName("logFile");
+        rollingFa.setEncoder(logEncoder);
+        rollingFa.setAppend(true);
+
+        final File logs = new File(workDir, subdir);
+        HelperConfig.ensureDirExist(logs);
+
+        rollingFa.setFile(new File(logs, "logfile.log").getAbsolutePath());
+
+        TimeBasedRollingPolicy logFilePolicy = new TimeBasedRollingPolicy();
+        logFilePolicy.setContext(logCtx);
+        logFilePolicy.setParent(rollingFa);
+        logFilePolicy.setFileNamePattern(new File(logs, 
"logfile-%d{yyyy-MM-dd_HH}.log").getAbsolutePath());
+        logFilePolicy.setMaxHistory(7);
+        logFilePolicy.start();
+
+        //todo use logFilePolicy.getActiveFileName()
+
+        rollingFa.setRollingPolicy(logFilePolicy);
+        rollingFa.start();
+
+        Logger log = logCtx.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
+        log.setAdditive(false);
+        log.setLevel(Level.INFO);
+        log.detachAndStopAllAppenders();
+
+        log.addAppender(rollingFa);
+    }
+}
diff --git 
a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/TcHelperDb.java 
b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/TcHelperDb.java
index a762452..0d38baa 100644
--- a/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/TcHelperDb.java
+++ b/ignite-tc-helper-web/src/main/java/org/apache/ignite/ci/db/TcHelperDb.java
@@ -23,7 +23,6 @@ import java.net.InetSocketAddress;
 import java.util.Collection;
 import java.util.Collections;
 
-import ch.qos.logback.classic.LoggerContext;
 import org.apache.ignite.Ignite;
 import org.apache.ignite.Ignition;
 import org.apache.ignite.cache.CacheAtomicityMode;
@@ -39,11 +38,6 @@ import org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi;
 import org.apache.ignite.spi.discovery.tcp.ipfinder.TcpDiscoveryIpFinder;
 import org.jetbrains.annotations.NotNull;
 
-import ch.qos.logback.classic.Level;
-import ch.qos.logback.classic.Logger;
-import ch.qos.logback.classic.encoder.PatternLayoutEncoder;
-import ch.qos.logback.core.rolling.RollingFileAppender;
-import ch.qos.logback.core.rolling.TimeBasedRollingPolicy;
 import org.slf4j.LoggerFactory;
 
 import static org.apache.ignite.ci.web.Launcher.waitStopSignal;
@@ -77,7 +71,6 @@ public class TcHelperDb {
     }
 
     public static Ignite start() {
-
         final File workDir = HelperConfig.resolveWorkDir();
         configLogger(workDir);
 
@@ -145,42 +138,8 @@ public class TcHelperDb {
     }
 
     private static void configLogger(File workDir) {
-        LoggerContext logCtx = (LoggerContext) 
LoggerFactory.getILoggerFactory();
-
-        PatternLayoutEncoder logEncoder  = new PatternLayoutEncoder();
-        logEncoder.setContext(logCtx);
-        logEncoder.setPattern("%-12date{YYYY-MM-dd HH:mm:ss.SSS} %-5level [%t] 
- %msg%n");
-        logEncoder.start();
-
-        RollingFileAppender rollingFa = new RollingFileAppender();
-        rollingFa.setContext(logCtx);
-        rollingFa.setName("logFile");
-        rollingFa.setEncoder(logEncoder);
-        rollingFa.setAppend(true);
-
-        final File logs = new File(workDir, "tchelper_logs");
-        HelperConfig.ensureDirExist(logs);
-
-        rollingFa.setFile(new File(logs, "logfile.log").getAbsolutePath());
-
-        TimeBasedRollingPolicy logFilePolicy = new TimeBasedRollingPolicy();
-        logFilePolicy.setContext(logCtx);
-        logFilePolicy.setParent(rollingFa);
-        logFilePolicy.setFileNamePattern(new File(logs, 
"logfile-%d{yyyy-MM-dd_HH}.log").getAbsolutePath());
-        logFilePolicy.setMaxHistory(7);
-        logFilePolicy.start();
-
-        //todo use logFilePolicy.getActiveFileName()
-
-        rollingFa.setRollingPolicy(logFilePolicy);
-        rollingFa.start();
-
-        Logger log = logCtx.getLogger(org.slf4j.Logger.ROOT_LOGGER_NAME);
-        log.setAdditive(false);
-        log.setLevel(Level.INFO);
-        log.detachAndStopAllAppenders();
-
-        log.addAppender(rollingFa);
+        final String subdir = "tchelper_logs";
+        Ignite2Configurer.configLogger(workDir, subdir);
     }
 
     public static Ignite startClient() {
@@ -198,8 +157,12 @@ public class TcHelperDb {
     }
 
     private static void setupDisco(IgniteConfiguration cfg) {
-        final TcpDiscoverySpi spi = new TcpDiscoverySpi();
         final int locPort = 54433;
+        setupSinglePortDisco(cfg, locPort);
+    }
+
+    private static void setupSinglePortDisco(IgniteConfiguration cfg, int 
locPort) {
+        final TcpDiscoverySpi spi = new TcpDiscoverySpi();
         spi.setLocalPort(locPort);
         spi.setLocalPortRange(1);
         spi.setIpFinder(new LocalOnlyTcpDiscoveryIpFinder(locPort));
diff --git a/tc-bot-server/build.gradle b/tc-bot-server/build.gradle
index e69de29..67922a2 100644
--- a/tc-bot-server/build.gradle
+++ b/tc-bot-server/build.gradle
@@ -0,0 +1,54 @@
+/*
+ * 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.
+ */
+
+apply plugin: 'java'
+apply plugin: 'application'
+
+sourceCompatibility = '1.8'
+targetCompatibility = '1.8'
+
+repositories {
+    mavenCentral()
+    mavenLocal()
+}
+
+mainClassName = 'org.apache.ignite.ci.TcHelperDbLauncher'
+applicationDefaultJvmArgs = ["-Dteamcity.helper.home=../work",
+                             "-Dteamcity.bot.regionsize=16", // 16g Durable 
Memory region
+                             "-server",
+                             "-Xmx2g",
+                             "-XX:+AlwaysPreTouch",
+                             "-XX:+UseG1GC",
+                             "-XX:+ScavengeBeforeFullGC",
+                             "-XX:+UseStringDeduplication",
+                             "-Djava.rmi.server.hostname=app02",
+                             "-Dcom.sun.management.jmxremote",
+                             "-Dcom.sun.management.jmxremote.port=9011",
+                             "-Dcom.sun.management.jmxremote.local.only=false",
+                             
"-Dcom.sun.management.jmxremote.authenticate=false",
+                             "-Dcom.sun.management.jmxremote.ssl=false"]
+
+distributions {
+
+}
+
+dependencies {
+    compile (project(":ignite-tc-helper-web"))  {
+        transitive = false
+    }
+
+}
\ No newline at end of file
diff --git a/tc-bot-server/header.txt b/tc-bot-server/header.txt
new file mode 100644
index 0000000..a9ac967
--- /dev/null
+++ b/tc-bot-server/header.txt
@@ -0,0 +1,14 @@
+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.
\ No newline at end of file
diff --git 
a/tc-bot-server/src/main/java/org/apache/ignite/ci/TcHelperDbLauncher.java 
b/tc-bot-server/src/main/java/org/apache/ignite/ci/TcHelperDbLauncher.java
new file mode 100644
index 0000000..81c2d99
--- /dev/null
+++ b/tc-bot-server/src/main/java/org/apache/ignite/ci/TcHelperDbLauncher.java
@@ -0,0 +1,26 @@
+/*
+ * 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.
+ */
+
+package org.apache.ignite.ci;
+
+import org.apache.ignite.ci.db.TcHelperDb;
+
+public class TcHelperDbLauncher {
+    public static void main(String[] args) {
+        System.err.println("Hello");
+    }
+}

Reply via email to