Ian Maxon has uploaded a new change for review. https://asterix-gerrit.ics.uci.edu/3314
Change subject: PLEASE EDIT to provide a meaningful commit message! ...................................................................... PLEASE EDIT to provide a meaningful commit message! The following commits from your working branch will be included: commit 5bffb3da4ce8b876631407836386009098582f0c Merge: 111d347252 45d9395585 Author: Ian Maxon <[email protected]> Date: Wed Apr 3 10:27:22 2019 -0700 Merge branch 'master' into failify commit 111d3472526c73520b738be77cca2de71dcc2483 Author: Armin Balalaie <[email protected]> Date: Wed Apr 3 00:27:32 2019 -0700 [NO ISSUE] Changes SpiderSilk to Failify - user model changes: no - storage format changes: no - interface changes: no Change-Id: I1e9efa2c14fafbe5981fbb2fed77533173d5cc07 --- M .gitignore R asterixdb/asterix-failify/config/cc.conf R asterixdb/asterix-failify/docker/Dockerfile R asterixdb/asterix-failify/pom.xml R asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/SampleTestIT.java A asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/TestUtil.java R asterixdb/asterix-failify/src/test/resources/logback.xml D asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java M asterixdb/pom.xml 9 files changed, 102 insertions(+), 94 deletions(-) git pull ssh://asterix-gerrit.ics.uci.edu:29418/asterixdb refs/changes/14/3314/1 diff --git a/.gitignore b/.gitignore index 1dcc3c2..62d449f 100644 --- a/.gitignore +++ b/.gitignore @@ -28,4 +28,4 @@ .m2* ß -.SpiderSilkWorkingDirectory +.FailifyWorkingDirectory diff --git a/asterixdb/asterix-spidersilk/config/cc.conf b/asterixdb/asterix-failify/config/cc.conf similarity index 100% rename from asterixdb/asterix-spidersilk/config/cc.conf rename to asterixdb/asterix-failify/config/cc.conf diff --git a/asterixdb/asterix-spidersilk/docker/Dockerfile b/asterixdb/asterix-failify/docker/Dockerfile similarity index 100% rename from asterixdb/asterix-spidersilk/docker/Dockerfile rename to asterixdb/asterix-failify/docker/Dockerfile diff --git a/asterixdb/asterix-spidersilk/pom.xml b/asterixdb/asterix-failify/pom.xml similarity index 95% rename from asterixdb/asterix-spidersilk/pom.xml rename to asterixdb/asterix-failify/pom.xml index 6b370c8..9cb2e7f 100644 --- a/asterixdb/asterix-spidersilk/pom.xml +++ b/asterixdb/asterix-failify/pom.xml @@ -18,8 +18,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/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> - <artifactId>asterix-spidersilk</artifactId> - <name>asterix-spidersilk</name> + <artifactId>asterix-failify</artifactId> + <name>asterix-failify</name> <parent> <groupId>org.apache.asterix</groupId> @@ -57,9 +57,9 @@ <scope>test</scope> </dependency> <dependency> - <groupId>me.arminb.spidersilk</groupId> - <artifactId>spidersilk</artifactId> - <version>0.4.0</version> + <groupId>io.failify</groupId> + <artifactId>failify</artifactId> + <version>0.2.0</version> <scope>test</scope> </dependency> <dependency> diff --git a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java b/asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/SampleTestIT.java similarity index 91% rename from asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java rename to asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/SampleTestIT.java index b3b73bf..8f1bd59 100644 --- a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/SampleTestIT.java +++ b/asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/SampleTestIT.java @@ -16,14 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.apache.asterix.spidersilk; +package org.apache.asterix.failify; -import java.io.InputStream; -import java.util.List; -import java.util.Map; - +import com.fasterxml.jackson.databind.ObjectMapper; +import io.failify.FailifyRunner; +import io.failify.dsl.entities.Deployment; +import io.failify.exceptions.RuntimeEngineException; import org.apache.asterix.test.common.TestExecutor; import org.apache.asterix.testframework.context.TestCaseContext; + import org.junit.AfterClass; import org.junit.Assert; import org.junit.BeforeClass; @@ -31,21 +32,20 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import com.fasterxml.jackson.databind.ObjectMapper; +import java.io.InputStream; -import me.arminb.spidersilk.SpiderSilkRunner; -import me.arminb.spidersilk.dsl.entities.Deployment; -import me.arminb.spidersilk.exceptions.RuntimeEngineException; +import java.util.List; +import java.util.Map; public class SampleTestIT { private static final Logger logger = LoggerFactory.getLogger(SampleTestIT.class); - protected static SpiderSilkRunner runner; + protected static FailifyRunner runner; @BeforeClass public static void before() throws RuntimeEngineException { Deployment deployment = TestUtil.getSimpleClusterDeployment(); - runner = SpiderSilkRunner.run(deployment); + runner = FailifyRunner.run(deployment); TestUtil.waitForClusterToBeUp(runner); logger.info("The cluster is UP!"); } diff --git a/asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/TestUtil.java b/asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/TestUtil.java new file mode 100644 index 0000000..2c20d74 --- /dev/null +++ b/asterixdb/asterix-failify/src/test/java/org/apache/asterix/failify/TestUtil.java @@ -0,0 +1,82 @@ +/* + * 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.asterix.failify; + +import java.io.File; +import java.util.Objects; +import java.util.Optional; +import java.util.stream.Stream; +import org.apache.asterix.test.common.TestExecutor; +import io.failify.FailifyRunner; +import io.failify.dsl.entities.Deployment; +import io.failify.dsl.entities.PathAttr; +import io.failify.dsl.entities.PortType; +import io.failify.dsl.entities.ServiceType; +import io.failify.exceptions.RuntimeEngineException; + +public class TestUtil { + private static String mavenVersion; + private static String asterixHome; + + public static Deployment getSimpleClusterDeployment() { + mavenVersion = getMavenArtifactVersion(); + asterixHome = "/asterix/apache-asterixdb-" + mavenVersion; + + return Deployment.builder("simpleClusterDeployment") + // Service Definitions + .withService("asterix") + .applicationPath("../asterix-server/target/asterix-server-" + mavenVersion + "-binary-assembly.zip", + "/asterix", PathAttr.COMPRESSED) + .dockerFileAddress("docker/Dockerfile", false) + .dockerImageName("failify/test-asterix") + .instrumentablePath(asterixHome + "/repo/asterix-server-" + mavenVersion + ".jar") + .libraryPath(asterixHome + "/repo/*.jar") + .libraryPath(asterixHome + "/lib/*.jar") + .logDirectory(asterixHome + "/logs") + .serviceType(ServiceType.JAVA).and() + // Node Definitions + .withNode("cc", "asterix") + .applicationPath("config", "/asterix/config") + .startCommand(asterixHome + "/bin/asterixcc -config-file /asterix/config/cc.conf") + .tcpPort(19002).and() + .withNode("nc1", "asterix") + .startCommand(asterixHome + "/bin/asterixncservice").and() + .withNode("nc2", "asterix") + .startCommand(asterixHome + "/bin/asterixncservice").and() + .build(); + } + + public static String getMavenArtifactVersion() { + Optional<String> version = Stream + .of(Objects.requireNonNull(new File("../asterix-server/target") + .list((dir, name) -> name.matches("asterix-server-.*-binary-assembly.zip")))) + .map(foo -> foo.replace("asterix-server-", "")).map(foo -> foo.replace("-binary-assembly.zip", "")) + .findFirst(); + return version.orElseThrow(IllegalStateException::new); + } + + public static void waitForClusterToBeUp(FailifyRunner runner) throws RuntimeEngineException { + runner.runtime().runCommandInNode("cc", asterixHome + "/bin/asterixhelper wait_for_cluster"); + } + + public static TestExecutor getTestExecutor(FailifyRunner runner) { + return new TestExecutor(runner.runtime().ip("cc"), + runner.runtime().portMapping("cc", 19002, PortType.TCP)); + } +} diff --git a/asterixdb/asterix-spidersilk/src/test/resources/logback.xml b/asterixdb/asterix-failify/src/test/resources/logback.xml similarity index 96% rename from asterixdb/asterix-spidersilk/src/test/resources/logback.xml rename to asterixdb/asterix-failify/src/test/resources/logback.xml index ca7aa79..adf3a7c 100644 --- a/asterixdb/asterix-spidersilk/src/test/resources/logback.xml +++ b/asterixdb/asterix-failify/src/test/resources/logback.xml @@ -26,7 +26,7 @@ </layout> </appender> - <logger name="me.arminb" level="DEBUG"/> + <logger name="io.failify" level="DEBUG"/> <logger name="org.apache.asterix" level="DEBUG"/> <root level="ERROR"> diff --git a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java b/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java deleted file mode 100644 index 03e8191..0000000 --- a/asterixdb/asterix-spidersilk/src/test/java/org/apache/asterix/spidersilk/TestUtil.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * 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.asterix.spidersilk; - -import java.io.File; -import java.util.Objects; -import java.util.Optional; -import java.util.stream.Stream; - -import org.apache.asterix.test.common.TestExecutor; - -import me.arminb.spidersilk.SpiderSilkRunner; -import me.arminb.spidersilk.dsl.entities.Deployment; -import me.arminb.spidersilk.dsl.entities.PortType; -import me.arminb.spidersilk.dsl.entities.ServiceType; -import me.arminb.spidersilk.exceptions.RuntimeEngineException; - -public class TestUtil { - private static String mavenVersion; - private static String asterixHome; - - public static Deployment getSimpleClusterDeployment() { - mavenVersion = getMavenArtifactVersion(); - asterixHome = "/asterix/apache-asterixdb-" + mavenVersion; - - return new Deployment.DeploymentBuilder("simpleClusterDeployment") - // Service Definitions - .withService("asterix") - .applicationPath("../asterix-server/target/asterix-server-" + mavenVersion + "-binary-assembly.zip", - "/asterix", false, true, false) - .dockerFileAddress("docker/Dockerfile", false).dockerImage("spidersilk/test-asterix") - .instrumentablePath(asterixHome + "/repo/asterix-server-" + mavenVersion + ".jar") - .libraryPath(asterixHome + "/repo/*.jar").libraryPath(asterixHome + "/lib/*.jar") - .logDirectory(asterixHome + "/logs").serviceType(ServiceType.JAVA).and() - // Node Definitions - .withNode("cc", "asterix").applicationPath("config", "/asterix/config") - .startCommand(asterixHome + "/bin/asterixcc -config-file /asterix/config/cc.conf").tcpPort(19002).and() - .withNode("nc1", "asterix").startCommand(asterixHome + "/bin/asterixncservice").and() - .withNode("nc2", "asterix").startCommand(asterixHome + "/bin/asterixncservice").and().build(); - } - - public static String getMavenArtifactVersion() { - Optional<String> version = Stream - .of(Objects.requireNonNull(new File("../asterix-server/target") - .list((dir, name) -> name.matches("asterix-server-.*-binary-assembly.zip")))) - .map(foo -> foo.replace("asterix-server-", "")).map(foo -> foo.replace("-binary-assembly.zip", "")) - .findFirst(); - return version.orElseThrow(IllegalStateException::new); - } - - public static void waitForClusterToBeUp(SpiderSilkRunner runner) throws RuntimeEngineException { - runner.runtime().runCommandInNode("cc", asterixHome + "/bin/asterixhelper wait_for_cluster"); - } - - public static TestExecutor getTestExecutor(SpiderSilkRunner runner) { - return new TestExecutor(runner.runtime().ip("cc"), runner.runtime().portMapping("cc", 19002, PortType.TCP)); - } -} diff --git a/asterixdb/pom.xml b/asterixdb/pom.xml index 0e6e80d..c5cc5ea 100644 --- a/asterixdb/pom.xml +++ b/asterixdb/pom.xml @@ -192,7 +192,7 @@ <exclude>**/*.json</exclude> <exclude>**/*.adm</exclude> <exclude>**/*.template</exclude> - <exclude>**/.SpiderSilkWorkingDirectory/**</exclude> + <exclude>**/.FailifyWorkingDirectory/**</exclude> <exclude>asterix-installer/**</exclude> <!-- in case -DskipInstaller --> </excludes> </configuration> @@ -889,7 +889,7 @@ <module>asterix-client-helper</module> <module>asterix-license</module> <module>asterix-geo</module> - <module>asterix-spidersilk</module> + <module>asterix-failify</module> </modules> <dependencyManagement> -- To view, visit https://asterix-gerrit.ics.uci.edu/3314 To unsubscribe, visit https://asterix-gerrit.ics.uci.edu/settings Gerrit-MessageType: newchange Gerrit-Change-Id: I1e9efa2c14fafbe5981fbb2fed77533173d5cc07 Gerrit-PatchSet: 1 Gerrit-Project: asterixdb Gerrit-Branch: master Gerrit-Owner: Ian Maxon <[email protected]>
