Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(dev): Use arm64 ClickHouse image on Apple arm64 machines #29081

Merged
merged 6 commits into from
Oct 12, 2021

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Oct 5, 2021

ClickHouse, currently, does not provide an arm64 Docker image for the clickhouse-server.

Until they do, we can use the experimental image that Altinity produces.
I believe this image is built by this script on an aarch64 host.

Fixes #28564

@armenzg armenzg self-assigned this Oct 5, 2021
@armenzg armenzg added the Component: Developer Environment This covers issues related to setting up a developer's environment label Oct 5, 2021
@armenzg armenzg linked an issue Oct 5, 2021 that may be closed by this pull request
@armenzg armenzg force-pushed the armenzg/devservices/clickhouse-arm64 branch from 715b1da to 4b0dd7c Compare October 5, 2021 19:31
@armenzg armenzg changed the base branch from armenzg/dev/confluent-kafka-apple-m1 to master October 6, 2021 13:51
@armenzg armenzg force-pushed the armenzg/devservices/clickhouse-arm64 branch from 1550afb to ef8b77e Compare October 6, 2021 13:59
@armenzg armenzg force-pushed the armenzg/devservices/clickhouse-arm64 branch from ef8b77e to d796462 Compare October 6, 2021 14:00
@armenzg
Copy link
Member Author

armenzg commented Oct 6, 2021

On an Apple M1 machine this can be tested with sentry devservices up snuba clickhouse.

# altinity provides clickhouse support to other companies
# Official support: https://github.com/ClickHouse/ClickHouse/issues/22222
# This image is build with this script https://gist.github.com/filimonov/5f9732909ff66d5d0a65b8283382590d
"image": "altinity/clickhouse-server:21.6.1.6734-testing-arm"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the earliest ClickHouse version that works with ARM? That's a big jump from 20.3 to 21.6.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The version they have are 20.10.1.4844-testing-arm, 21.4.1.6307-testing-arm and 21.6.1.6734-testing-arm. I've downgraded to the 20.x series.

"pull": True,
"ports": {"9000/tcp": 9000, "9009/tcp": 9009, "8123/tcp": 8123},
"ulimits": [{"name": "nofile", "soft": 262144, "hard": 262144}],
"environment": {"MAX_MEMORY_USAGE_RATIO": "0.3"},
# The arm image does not properly load the MAX_MEMORY_USAGE_RATIO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know why?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not certain yet. I tried it manually with -e, however, I believe the image does not accept the variable (i.e. MAX_MEMORY_USAGE_RATIO is not set as an ENV in the Docker image).

You can see in this screenshot that it is not defined in the image:
image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(i.e. MAX_MEMORY_USAGE_RATIO is not set as an ENV in the Docker image).

This is not relevant as you can pass anything via the -e option and it will be set inside at runtime. I'd say we should investigate this (not in this PR tho, as a follow up)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did try as well manually with -e. Added it to my backlog.

@armenzg
Copy link
Member Author

armenzg commented Oct 12, 2021

@BYK @lynnagara Billy is out this week. Would you mind reviewing this? Thanks

@armenzg armenzg enabled auto-merge (squash) October 12, 2021 13:00
ClickHouse, currently, [does not provide an `arm64` Docker image for the clickhouse-server][issue].

Until they do, we can use the [experimental image that Altinity produces][image].
I believe this image is built by this [script][script] on an `aarch64` host.

Fixes #28564

[issue]: ClickHouse/ClickHouse#22222
[image]: https://hub.docker.com/layers/altinity/clickhouse-server/21.6.1.6734-testing-arm/images/sha256-9a4516444fef9e0f11ee6b2de716d3b97b36bf05d9cc2d44c4596cfb0584dea6?context=explore
[script]: https://gist.github.com/filimonov/5f9732909ff66d5d0a65b8283382590d
Copy link
Member

@BYK BYK left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mostly rejecting for the version mismatch.

"volumes": {
"clickhouse_dist"
if settings.SENTRY_DISTRIBUTED_CLICKHOUSE_TABLES
else "clickhouse": {"bind": "/var/lib/clickhouse"},
"clickhouse_logs": {"bind": "/var/log/clickhouse-server"},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this, especially as a bind mount?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because I needed to extract the logs. I guess I could have attached to the container. I don't need it. I will remove it.

Co-authored-by: Burak Yigit Kaya <byk@sentry.io>
Comment on lines +1805 to +1810
# altinity provides clickhouse support to other companies
# Official support: https://github.com/ClickHouse/ClickHouse/issues/22222
# This image is build with this script https://gist.github.com/filimonov/5f9732909ff66d5d0a65b8283382590d
"image": "yandex/clickhouse-server:20.3.9.70"
if not APPLE_ARM64
else "altinity/clickhouse-server:20.10.1.4844-testing-arm",
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to move the comment to line 1809 to avoid confusion:

Suggested change
# altinity provides clickhouse support to other companies
# Official support: https://github.com/ClickHouse/ClickHouse/issues/22222
# This image is build with this script https://gist.github.com/filimonov/5f9732909ff66d5d0a65b8283382590d
"image": "yandex/clickhouse-server:20.3.9.70"
if not APPLE_ARM64
else "altinity/clickhouse-server:20.10.1.4844-testing-arm",
"image": "yandex/clickhouse-server:20.3.9.70"
if not APPLE_ARM64
# altinity provides clickhouse support to other companies
# Official support: https://github.com/ClickHouse/ClickHouse/issues/22222
# This image is build with this script https://gist.github.com/filimonov/5f9732909ff66d5d0a65b8283382590d
else "altinity/clickhouse-server:20.10.1.4844-testing-arm",

@armenzg armenzg merged commit f7238b6 into master Oct 12, 2021
@armenzg armenzg deleted the armenzg/devservices/clickhouse-arm64 branch October 12, 2021 16:52
armenzg added a commit that referenced this pull request Oct 13, 2021
In #29081, we changed the arm ClickHouse container at the last moment without realizing that the older
version has this `libunwind: Unsupported .eh_frame_hdr version` [issue][issue].

We upgrade to a newer version that does not have profiling enabled.

[issue]: ClickHouse/ClickHouse#15638
armenzg added a commit that referenced this pull request Oct 13, 2021
In #29081, we changed the arm ClickHouse container at the last moment without realizing that the older
version has this `libunwind: Unsupported .eh_frame_hdr version` [issue][issue].

We upgrade to a newer version that does not have profiling enabled.

[issue]: ClickHouse/ClickHouse#15638
@github-actions github-actions bot locked and limited conversation to collaborators Oct 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Component: Developer Environment This covers issues related to setting up a developer's environment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

No clickhouse Docker image for Mac Arm64
4 participants