Skip to content

Commit

Permalink
Unify keeper.Dockerfile and clickhouse.Dockerfile
Browse files Browse the repository at this point in the history
This solves issues with keeper on 22.X
  • Loading branch information
strtgbb committed Oct 4, 2024
1 parent a5ec08e commit 7c8b707
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
9 changes: 8 additions & 1 deletion docker-compose/base_os/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,13 @@

These files install ClickHouse and test dependencies.

`clickhouse.Dockerfile` and `keeper.Dockerfile` are special, they are used with docker releases of ClickHouse, and thus only install test dependencies.
`clickhouse.Dockerfile` is special, it is used with docker releases of ClickHouse server and keeper, and thus only installs test dependencies.

Adding support for a new distribution is simple, make a copy of the most closely related Dockerfile, name it accordingly, and adjust it as necessary.

You can get the correct name with the following python snippet:

```python
>>> "docker://redhat/ubi9:9.4".split("//")[-1].split(":")[0].split("/")[-1] + ".Dockerfile"
'ubi9.Dockerfile'
```
3 changes: 3 additions & 0 deletions docker-compose/base_os/clickhouse.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ FROM $CLICKHOUSE_DOCKER_IMAGE_NAME
ENV TZ=Europe/Berlin
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone

# Fix for 22.x keeper
RUN mkdir -p /var/lib/clickhouse/coordination

# install curl, base image could be alpine
RUN if [ -f /etc/alpine-release ]; then \
apk update && \
Expand Down
8 changes: 0 additions & 8 deletions docker-compose/base_os/keeper.Dockerfile

This file was deleted.

2 changes: 1 addition & 1 deletion docker-compose/keeper-service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ services:
pull_policy: never
build:
context: ..
dockerfile: docker-compose/base_os/${CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME:-keeper}.Dockerfile
dockerfile: docker-compose/base_os/${CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME:-clickhouse}.Dockerfile
args:
KEEPER_DOCKER_IMAGE: $CLICKHOUSE_TESTS_KEEPER_DOCKER_IMAGE
CLICKHOUSE_PACKAGE: $CLICKHOUSE_TESTS_KEEPER_BIN_PATH
Expand Down
2 changes: 1 addition & 1 deletion helpers/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -1904,7 +1904,7 @@ def up(self, timeout=30 * 60):
)
self.environ["CLICKHOUSE_TESTS_KEEPER_BASE_OS"] = self.keeper_base_os
self.environ["CLICKHOUSE_TESTS_KEEPER_BASE_OS_NAME"] = (
"keeper"
"clickhouse"
if not self.keeper_base_os
else self.keeper_base_os.split(":")[0].split("/")[-1]
)
Expand Down

0 comments on commit 7c8b707

Please sign in to comment.