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 newer kafka & zookeeper images to support Apple arm64 #29084

Merged
merged 3 commits into from
Oct 6, 2021

Conversation

armenzg
Copy link
Member

@armenzg armenzg commented Oct 5, 2021

The current zookeeper image we use fails to execute on Apple's arm64 machines (see issue for details).

Only change the version when executing on Apple arm64 machines.

Fixes #28570.

@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 changed the base branch from armenzg/dev/confluent-kafka-apple-m1 to master October 6, 2021 13:51
The current zookeeper image we use fails to execute on Apple's arm64 machines (see [issue][1]) for details).

Only upgrading the version of both when executing on Apple arm64 machines.

Fixes #28570.

[1]: confluentinc/kafka-images#80 (comment)
@@ -158,12 +158,16 @@ runs:

# TODO: Use devservices kafka. See https://github.com/getsentry/sentry/pull/20986#issuecomment-704510570
if [ "$NEED_KAFKA" = "true" ]; then
# This is *not* the production version. Unclear reason as to why this was chosen
# https://github.com/getsentry/ops/blob/c823e62f930ecc6c97bb08898c71e49edc7232f6/cookbooks/getsentry/attributes/default.rb#L631
Copy link
Member Author

Choose a reason for hiding this comment

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

Just keeping track of the discrepancy. Production uses 3.4.11.

docker run \
--name sentry_zookeeper \
-d --network host \
-e ZOOKEEPER_CLIENT_PORT=2181 \
confluentinc/cp-zookeeper:4.1.0

# This is the production version; do not change w/o changing it there as well
# https://github.com/getsentry/ops/blob/c823e62f930ecc6c97bb08898c71e49edc7232f6/cookbooks/getsentry/attributes/default.rb#L643
Copy link
Member Author

Choose a reason for hiding this comment

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

Just taking note of it. Production uses 4.1.2-3 instead of 5.1.2.

@@ -1697,6 +1698,8 @@ def build_cdc_postgres_init_db_volume(settings):
)


APPLE_ARM64 = pf().startswith("mac") and pf().endswith("arm64-arm-64bit")
Copy link
Member Author

Choose a reason for hiding this comment

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

For the curious:

❯ python -c "import platform; print(platform.platform())"
macOS-11.6-arm64-arm-64bit

# See details https://github.com/confluentinc/kafka-images/issues/80#issuecomment-855511438
"image": "confluentinc/cp-zookeeper:6.2.0"
if APPLE_ARM64
else "confluentinc/cp-zookeeper:5.1.2",
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 selectively upgrading the version on Apple's arm64 since there was a bug that only affects Intel (You can read more details in #28672).

I've added a card to investigate this later on.

Copy link
Member

Choose a reason for hiding this comment

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

I would add this explanation in the comments

Copy link
Member Author

Choose a reason for hiding this comment

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

Added

@armenzg armenzg marked this pull request as ready for review October 6, 2021 14:08
@armenzg armenzg requested a review from a team as a code owner October 6, 2021 14:08
@armenzg armenzg requested review from billyvg and BYK October 6, 2021 14:20
@armenzg
Copy link
Member Author

armenzg commented Oct 6, 2021

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

# See details https://github.com/confluentinc/kafka-images/issues/80#issuecomment-855511438
"image": "confluentinc/cp-zookeeper:6.2.0"
if APPLE_ARM64
else "confluentinc/cp-zookeeper:5.1.2",
Copy link
Member

Choose a reason for hiding this comment

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

I would add this explanation in the comments

@@ -9,6 +9,7 @@
import sys
import tempfile
from datetime import timedelta
from platform import platform as pf
Copy link
Member

Choose a reason for hiding this comment

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

is there a reason to alias to pf? I would just keep it as platform

@armenzg armenzg enabled auto-merge (squash) October 6, 2021 16:02
@armenzg armenzg merged commit 767bf79 into master Oct 6, 2021
@armenzg armenzg deleted the armenzg/devservices/kafka-zookeeper-arm64 branch October 6, 2021 18:19
@github-actions github-actions bot locked and limited conversation to collaborators Oct 22, 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.

Zookeper Docker image not working on Apple's arm64
2 participants