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

[fix][build] Build test container image using current hardware platform #1205

Merged
merged 2 commits into from
Apr 17, 2024

Conversation

dragosvictor
Copy link
Contributor

@dragosvictor dragosvictor commented Apr 16, 2024

Motivation

Test container image is built for amd64 platforms only. This makes it difficult to test and run on others, notably Apple Silicon chips running arm64.

Modifications

The source of the problem is using the hardcoded amd64 Go binary distribution during the image build. On Apple Silicon, running make test yields the following error:

...
docker run -i pulsar-client-go-test:latest bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci.sh"
+ export GOPATH=/pulsar/go
+ GOPATH=/pulsar/go
+ export GOCACHE=/tmp/go-cache
+ GOCACHE=/tmp/go-cache
+ go mod download
rosetta error: failed to open elf at /lib64/ld-linux-x86-64.so.2
 ./scripts/run-ci.sh: line 26:     7 Trace/breakpoint trap   go mod download
make: *** [test] Error 133

Sourcing the local platform name from uname -m and using it to download the corresponding Go distribution solves the issue:

...
docker run -i pulsar-client-go-test:latest bash -c "cd /pulsar/pulsar-client-go && ./scripts/run-ci.sh"
+ export GOPATH=/pulsar/go
+ GOPATH=/pulsar/go
+ export GOCACHE=/tmp/go-cache
+ GOCACHE=/tmp/go-cache
+ go mod download
+ go build ./pulsar
+ go build -o bin/pulsar-perf ./perf
+ scripts/pulsar-test-service-start.sh
...

Verifying this change

  • Make sure that the change passes the CI checks.

This change is a trivial rework / code cleanup without any test coverage.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): No
  • The public API: No
  • The schema: No
  • The default values of configurations: No
  • The wire protocol: No

Documentation

  • Does this pull request introduce a new feature? No
  • If yes, how is the feature documented? Not applicable
  • If a feature is not applicable for documentation, explain why? Relevant only for build/test workflows
  • If a feature is not documented yet in this PR, please create a followup issue for adding the documentation

@dragosvictor dragosvictor marked this pull request as ready for review April 16, 2024 19:59
Copy link
Contributor

@maxsxu maxsxu left a comment

Choose a reason for hiding this comment

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

👍 Thanks for this fix

@RobertIndie RobertIndie merged commit c3e94e2 into apache:master Apr 17, 2024
8 checks passed
@RobertIndie RobertIndie added this to the v0.13.0 milestone Jun 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants