-
Notifications
You must be signed in to change notification settings - Fork 26.5k
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
DUBBO-7349 Fix the build on Linux ARM64 CPU architecture #7408
DUBBO-7349 Fix the build on Linux ARM64 CPU architecture #7408
Conversation
<artifactId>embedded-redis</artifactId> | ||
<scope>test</scope> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why remove test scope
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
because it is already set at https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-dependencies-bom/pom.xml#L628 in the dependencyManagement section
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this way it is in sync with
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-registry/dubbo-registry-multiple/pom.xml#L55-L58
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-registry/dubbo-registry-redis/pom.xml#L47-L50
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-rpc/dubbo-rpc-redis/pom.xml#L42-L45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rather than remove <scope>test</scope>
, add <scope>test</scope>
will be better I think.
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-registry/dubbo-registry-multiple/pom.xml#L55-L58
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-registry/dubbo-registry-redis/pom.xml#L47-L50
- https://github.com/martin-g/dubbo/blob/fix-build-and-tests-on-arm64/dubbo-rpc/dubbo-rpc-redis/pom.xml#L42-L45
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@horizonzy OK, I will add the scope!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
Also rebased to latest master
…gement section Inline the version so that it is not forgotten to be removed when the dependency is removed with the upgrade to embedded-consul:2.2.1 See pszymczyk/embedded-consul#114
dubbo-dependencies-bom/pom.xml
Outdated
@@ -700,6 +700,16 @@ | |||
<artifactId>grpc-grpclb</artifactId> | |||
<version>${grpc.version}</version> | |||
</dependency> | |||
<!-- Groovy, for Embedded Consul. Could be removed once embedded-consul:2.2.1 is released | |||
See https://github.com/pszymczyk/embedded-consul/pull/114 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might wait a little bit with merging that PR. We plan to release 2.2.1 "soon".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I really hope this PR can be merged ASAP, so this issue #7421 can be fixed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinxiong I am afraid that this PR won't fix the issue for Mac ARM64. Currently embedded-redis:0.9.0 supports only Linux ARM64. We used Docker+QEMU to build the Linux ARM64 binary - https://github.com/codemonstur/embedded-redis/tree/master/src/main/binaries. I am not sure whether there is a similar way to emulate Mac ARM64.
I am not sure whether @codemonstur has access to Mac M1 machine to build the binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for letting me know! If somebody need my help for testing in Mac M1 machine, I'm very happy to do it. @martin-g @codemonstur
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinxiong With PR codemonstur/embedded-redis#3 I've tried to convince @codemonstur to add support for a special system property to ExecutableProvider to set the path to the redis-server binary but he didn't like this approach.
If this PR was merged then Dubbo/pom.xml could add a profile
for Mac ARM64 and export this property in Maven Surefire argline
. Maybe @codemonstur will reconsider it.
BTW once you pass the issue with embedded-redis I expect that you will face similar issue with embedded-consul.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
BTW once you pass the issue with embedded-redis I expect that you will face similar issue with embedded-consul.
@martin-g Thanks for your reminder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-g I have passed the issue with embedded-redis
when I disabled all test cases in RedisMetadataReportTest. Fortunately, I didn't face similar issue with embedded-consul
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might wait a little bit with merging that PR. We plan to release 2.2.1 "soon".
@szpak Any ETA ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-g ETA: -15 minutes :-)
https://github.com/pszymczyk/embedded-consul/releases/tag/release%2F2.2.1
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -60,15 +60,15 @@ public void constructor(TestInfo testInfo) throws IOException { | |||
String methodName = testInfo.getTestMethod().get().getName(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Below this line you would put
ExecutableProvider provider = () -> new File(System.getProperty("my.custom.property"));
@@ -60,15 +60,15 @@ public void constructor(TestInfo testInfo) throws IOException { | |||
String methodName = testInfo.getTestMethod().get().getName(); | |||
if ("testAuthRedisMetadata".equals(methodName) || ("testWrongAuthRedisMetadata".equals(methodName))) { | |||
String password = "チェリー"; | |||
RedisServerBuilder builder = RedisServer.builder().port(redisPort).setting("requirepass " + password); | |||
RedisServerBuilder builder = RedisServer.newRedisServer().port(redisPort).setting("requirepass " + password); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add .redisExecProvider(provider)
here.
if (SystemUtils.IS_OS_WINDOWS) { | ||
// set maxheap to fix Windows error 0x70 while starting redis | ||
builder.setting("maxheap 128mb"); | ||
} | ||
redisServer = builder.build(); | ||
registryUrl = URL.valueOf("redis://username:" + password + "@localhost:" + redisPort); | ||
} else { | ||
RedisServerBuilder builder = RedisServer.builder().port(redisPort); | ||
RedisServerBuilder builder = RedisServer.newRedisServer().port(redisPort); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And here add .redisExecProvider(provider)
as well.
@@ -60,15 +60,15 @@ public void constructor(TestInfo testInfo) throws IOException { | |||
String methodName = testInfo.getTestMethod().get().getName(); | |||
if ("testAuthRedisMetadata".equals(methodName) || ("testWrongAuthRedisMetadata".equals(methodName))) { | |||
String password = "チェリー"; | |||
RedisServerBuilder builder = RedisServer.builder().port(redisPort).setting("requirepass " + password); | |||
RedisServerBuilder builder = RedisServer.newRedisServer().port(redisPort).setting("requirepass " + password); | |||
if (SystemUtils.IS_OS_WINDOWS) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yuck. I'm going to add a .settingIf(boolean, String)
so that you can use the builder as it was intended.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codemonstur Thanks for your help. I hope everything will be the same as you expected.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@codemonstur I see that your update has been merged in master
branch. However, I still cannot work well when I run RedisMetadataReportTest
.
If we want to fix issue #7421 , we need to upgrade the redis
from 2.8.19
to 6.0.10
or 6.2 RC2
(see #8062, #8195) in embedded-redis
We can get some more details from redis releases 6.0.10
Bug fixes:
- Fix setproctitle related crashes. (#8150, #8088)
Caused various crashes on startup, mainly on Apple M1 chips or under instrumentation
I really hope you can commit an new PR to solve this problem (#7421).
Maybe @martin-g can persuade @codemonstur to do it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was going to suggest to create an issue at https://github.com/codemonstur/embedded-redis and discuss there but "Issues" are not enabled there, only "Pull Requests".
@pinxiong As I said earlier - many of us do not have access to Mac ARM64 hardware and it is impossible for us to improve for it. But @codemonstur added APIs to use custom ExecutableProvider that can run any binary you tell it to.
For example, you can introduce a new Maven profile that is activated only for os=mac + arch=aarch64 and sets system property embedded.redis.executable
(see https://github.com/codemonstur/embedded-redis/blob/master/src/main/java/redis/embedded/core/ExecutableProvider.java#L18). The value should be an absolute path to the Redis 6.x binary for Mac ARM64. Then in the tests code check whether this system property is non-null and use ExecutableProvider.newSystemPropertyProvider()
instead of the default one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pinxiong the current approach that I think will work for you is as @martin-g described. I just enabled issues in https://github.com/codemonstur/embedded-redis. So if you guys want to discuss any it is now possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@martin-g @codemonstur I have opened an issue #6 where we can discuss.
@martin-g great! Please merge master branch to solve confilcting file. |
8825d52
to
f959bf5
Compare
…gement section Inline the version so that it is not forgotten to be removed when the dependency is removed with the upgrade to embedded-consul:2.2.1 See pszymczyk/embedded-consul#114
Done! |
Codecov Report
@@ Coverage Diff @@
## master #7408 +/- ##
============================================
- Coverage 59.24% 59.19% -0.06%
+ Complexity 503 501 -2
============================================
Files 1076 1076
Lines 43407 43406 -1
Branches 6337 6337
============================================
- Hits 25716 25693 -23
- Misses 14852 14877 +25
+ Partials 2839 2836 -3 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Update embedded-redis and embedded-consul to newer versions which have native binaries for aarch64 Re-introduce TravisCI as a build tool only for ARM64. It will run as a cron job every night
…gement section Inline the version so that it is not forgotten to be removed when the dependency is removed with the upgrade to embedded-consul:2.2.1 See pszymczyk/embedded-consul#114
f959bf5
to
a70d2c6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
…ions And that there is a nightly build on ARM64 at TravisCI Depends-on: apache/dubbo#7408
What is the purpose of the change
Apache Dubbo is a Java application and thus should work fine on any architecture supported by the Java Virtual Machine.
But Dubbo depends on some libraries which use native binaries that do not have aarch64 version, for example embedded-redis and embedded-consul.
This PR updates those dependencies with newer versions which added support for ARM64 architecture!
Verifying this change
The PR re-introduces TravisCI as a build tool to build and tests
master
branch every night.This has been discussed at https://lists.apache.org/thread.html/r2742c51066b55787571417ed74843cd9607ba8202566ddd807f9bdab%40%3Cdev.dubbo.apache.org%3E
Someone from Dubbo team will have to setup the Cron job at TravisCI UI !