Skip to content

Commit

Permalink
Update supported clickhouse versions
Browse files Browse the repository at this point in the history
  • Loading branch information
ssheikin committed Dec 20, 2024
1 parent 8205581 commit 844e08f
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,23 @@
public class TestingClickHouseServer
implements Closeable
{
// https://clickhouse.com/docs/en/faq/operations/production#how-to-choose-between-clickhouse-releases
// * stable is the kind of package we recommend by default.
// They are released roughly monthly (and thus provide new features with reasonable delay)
// and three latest stable releases are supported in terms of diagnostics and backporting of bugfixes.
// * lts are released twice a year and are supported for a year after their initial release.
// versioning schema: https://kb.altinity.com/altinity-kb-setup-and-maintenance/clickhouse-versions/
private static final DockerImageName CLICKHOUSE_IMAGE = DockerImageName.parse("clickhouse/clickhouse-server");
public static final DockerImageName CLICKHOUSE_LATEST_IMAGE = CLICKHOUSE_IMAGE.withTag("24.1.8.22"); // EOL by Apr 2025
public static final DockerImageName CLICKHOUSE_DEFAULT_IMAGE = CLICKHOUSE_IMAGE.withTag("23.8.12.13"); // EOL by Jun 2024
// https://clickhouse.com/docs/en/whats-new/changelog#-clickhouse-release-2412-2024-12-19
public static final DockerImageName CLICKHOUSE_LATEST_IMAGE = CLICKHOUSE_IMAGE.withTag("24.12.1.1614"); // EOL in 3 releases after 2024-12-19
// https://clickhouse.com/docs/en/whats-new/changelog#-clickhouse-release-243-lts-2024-03-27
public static final DockerImageName CLICKHOUSE_DEFAULT_IMAGE = CLICKHOUSE_IMAGE.withTag("24.3.14.35"); // EOL in 1 year after 2024-03-27

// Altinity Stable Builds Life-Cycle Table https://docs.altinity.com/altinitystablebuilds/#altinity-stable-builds-life-cycle-table
// On Mac/arm try `21.8.12.29.altinitydev.arm` instead of the specified stable build
// On Mac/arm 23.3.13.7.altinitystable, 23.8.8.21.altinitystable and 22.8.15.25.altinitystable and later versions available on ARM.
private static final DockerImageName ALTINITY_IMAGE = DockerImageName.parse("altinity/clickhouse-server").asCompatibleSubstituteFor("clickhouse/clickhouse-server");
public static final DockerImageName ALTINITY_LATEST_IMAGE = ALTINITY_IMAGE.withTag("23.8.8.21.altinitystable"); // EOL is 27 Dec 2026
public static final DockerImageName ALTINITY_DEFAULT_IMAGE = ALTINITY_IMAGE.withTag("21.8.15.15.altinitystable"); // EOL is 30 Aug 2024
public static final DockerImageName ALTINITY_LATEST_IMAGE = ALTINITY_IMAGE.withTag("24.3.12.76.altinitystable"); // EOL is 23 Jul 2027
public static final DockerImageName ALTINITY_DEFAULT_IMAGE = ALTINITY_IMAGE.withTag("22.3.15.34.altinitystable"); // EOL is 15 Jul 2025

private final ClickHouseContainer dockerContainer;

Expand Down Expand Up @@ -66,7 +74,10 @@ public void execute(String sql)

public String getJdbcUrl()
{
return format("jdbc:clickhouse://%s:%s/", dockerContainer.getHost(),
// externalDatabase=false is needed because Schema listing fetch is extremely slow on Clickhouse-server 24.3+
// https://github.com/ClickHouse/clickhouse-java/issues/1245
// https://github.com/ClickHouse/clickhouse-java/issues/1584
return format("jdbc:clickhouse://%s:%s/?externalDatabase=false", dockerContainer.getHost(),
dockerContainer.getMappedPort(8123));
}

Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,7 @@
<dependency>
<groupId>com.clickhouse</groupId>
<artifactId>clickhouse-jdbc</artifactId>
<version>0.6.3</version>
<version>0.7.1-patch1</version>
<classifier>all</classifier>
</dependency>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import io.trino.tests.product.launcher.env.common.TestsEnvironment;
import io.trino.tests.product.launcher.testcontainers.PortBinder;
import org.testcontainers.containers.startupcheck.IsRunningStartupCheckStrategy;
import org.testcontainers.utility.DockerImageName;

import java.io.IOException;
import java.io.UncheckedIOException;
Expand All @@ -47,6 +48,8 @@ public class EnvMultinodeClickhouse
{
private static final String ZOOKEEPER = "zookeeper";

private static final DockerImageName CLICKHOUSE_IMAGE = DockerImageName.parse("clickhouse/clickhouse-server"); // see TestingClickHouseServer for details
private static final DockerImageName CLICKHOUSE_DEFAULT_IMAGE = CLICKHOUSE_IMAGE.withTag("24.3.14.35"); // EOL in 1 year after 2024-03-27
private static final String CLICKHOUSE = "clickhouse";
private static final String CLICKHOUSE_NTH = CLICKHOUSE + "-";
private static final String CONTAINER_CLICKHOUSE_CONFIG_DIR = "/etc/clickhouse-server/";
Expand Down Expand Up @@ -109,7 +112,7 @@ private static DockerContainer createClickHouse(int number, DockerFiles dockerFi
int httpPort = CLICKHOUSE_DEFAULT_HTTP_PORT + number;
int nativePort = CLICKHOUSE_DEFAULT_NATIVE_PORT + number;

DockerContainer container = new DockerContainer("yandex/clickhouse-server:21.3.2.5", logicalName(number))
DockerContainer container = new DockerContainer(CLICKHOUSE_DEFAULT_IMAGE.toString(), logicalName(number))
.withCopyFileToContainer(
forHostPath(dockerFiles.getDockerFilesHostPath("conf/environment/multinode-clickhouse/test.xml")),
CONTAINER_CLICKHOUSE_USERS_D + "test.xml")
Expand Down

0 comments on commit 844e08f

Please sign in to comment.