You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@drill.apache.org by lu...@apache.org on 2021/09/15 23:19:13 UTC

[drill] branch master updated: [TRAVIS-CI-FIX]: Change clickhouse image to be able to run on both x86-64 and arm64 (#2315)

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

luoc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/drill.git


The following commit(s) were added to refs/heads/master by this push:
     new fb1a77e  [TRAVIS-CI-FIX]: Change clickhouse image to be able to run on both x86-64 and arm64 (#2315)
fb1a77e is described below

commit fb1a77e8bcba2e71124376d092916f08b0128898
Author: feiteng <32...@qq.com>
AuthorDate: Tue Sep 14 16:29:55 2021 +0800

    [TRAVIS-CI-FIX]: Change clickhouse image to be able to run on both x86-64 and arm64 (#2315)
---
 .../store/jdbc/TestJdbcPluginWithClickhouse.java    | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

diff --git a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithClickhouse.java b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithClickhouse.java
index d2d697f..b417c4c 100644
--- a/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithClickhouse.java
+++ b/contrib/storage-jdbc/src/test/java/org/apache/drill/exec/store/jdbc/TestJdbcPluginWithClickhouse.java
@@ -44,17 +44,26 @@ import static org.junit.Assert.assertEquals;
  */
 @Category(JdbcStorageTest.class)
 public class TestJdbcPluginWithClickhouse extends ClusterTest {
-
-  private static final String DOCKER_IMAGE_CLICKHOUSE = "yandex/clickhouse" +
-    "-server:21.8.4.51";
+  private static final String DOCKER_IMAGE_CLICKHOUSE_X86 = "yandex" +
+    "/clickhouse-server:21.8.4.51";
+  private static final String DOCKER_IMAGE_CLICKHOUSE_ARM = "lunalabsltd" +
+    "/clickhouse-server:21.7.2.7-arm";
   private static JdbcDatabaseContainer<?> jdbcContainer;
 
   @BeforeClass
   public static void initClickhouse() throws Exception {
     startCluster(ClusterFixture.builder(dirTestWatcher));
-    jdbcContainer =
-      new ClickHouseContainer(DockerImageName.parse(DOCKER_IMAGE_CLICKHOUSE))
-        .withInitScript("clickhouse-test-data.sql");
+    String osName = System.getProperty("os.name").toLowerCase();
+    DockerImageName imageName;
+    if (osName.startsWith("linux") && "aarch64".equals(System.getProperty("os.arch"))) {
+      imageName = DockerImageName.parse(DOCKER_IMAGE_CLICKHOUSE_ARM)
+        .asCompatibleSubstituteFor("yandex/clickhouse-server");
+    } else {
+      imageName = DockerImageName.parse(DOCKER_IMAGE_CLICKHOUSE_X86);
+    }
+
+    jdbcContainer = new ClickHouseContainer(imageName)
+      .withInitScript("clickhouse-test-data.sql");
     jdbcContainer.start();
 
     JdbcStorageConfig jdbcStorageConfig =