apache / incubator-seata

:fire: Seata is an easy-to-use, high-performance, open source distributed transaction solution.
https://seata.apache.org/
Apache License 2.0
25.33k stars 8.78k forks source link

Require image for ARM64 architecture #4660

Closed odidev closed 2 years ago

odidev commented 2 years ago

@a364176773 , I am trying to use the seata/seata docker image on the arm64 platform but it seems it is not available for arm64. I have tried building the image on the arm64 platform using docker build -t <image_name .> command, but it is failing with below error on arm64.

Step 5/9 : ADD target/ /seata-server/target
ADD failed: file not found in build context or excluded by .dockerignore: stat target/: file does not exist

Before using docker build -t <image_name .> command, I had tried to build Uber Jar through mvn clean install but it's falling with below error.

[ERROR] Failed to execute goal org.xolstice.maven.plugins:protobuf-maven-plugin:0.5.0:compile (default) on project seata-serializer-protobuf: Missing:
[ERROR] ----------
[ERROR] 1) com.google.protobuf:protoc:exe:linux-aarch_64:3.3.0
[ERROR]
[ERROR]   Try downloading the file manually from the project website.
[ERROR]
[ERROR]   Then, install it using the command:
[ERROR]       mvn install:install-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.3.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/path/to/file
[ERROR]
[ERROR]   Alternatively, if you host your own repository you can deploy the file there:
[ERROR]       mvn deploy:deploy-file -DgroupId=com.google.protobuf -DartifactId=protoc -Dversion=3.3.0 -Dclassifier=linux-aarch_64 -Dpackaging=exe -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR]   Path to dependency:
[ERROR]         1) io.seata:seata-serializer-protobuf:jar:1.5.2-SNAPSHOT
[ERROR]         2) com.google.protobuf:protoc:exe:linux-aarch_64:3.3.0
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR]   io.seata:seata-serializer-protobuf:jar:1.5.2-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR]   central (https://repo.maven.apache.org/maven2, releases=true, snapshots=false)
[ERROR]
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :seata-serializer-protobuf

It will be very helpful if the seata image is released for the ARM64 platform. If required, I am happy to contribute. But as a start, can you please provide me with some pointers on the above mvn related issue ?

funky-eyes commented 2 years ago

for issues that cannot be packaged, you can refer to https://seata.io/zh-cn/docs/overview/faq.html https://github.com/seata/seata/blob/develop/distribution/Dockerfile You can modify this dockerfile to support the arm64 platform

odidev commented 2 years ago

@a364176773

I am trying to use the seata/seata image on arm64 platform, but it seems it is not available for arm64. I have successfully built the image for arm64 platform, using the command docker build -t image_name . I have modified the distribution/Dockerfile, .github/workflows/test.yml, .github/workflows/test.yml, pom.xml and serializer/seata-serializer-protobuf/pom.xml files to build and push the docker image of seata/seata for both the platforms using buildx.

Commit Link – odidev@2896380

Docker Hub Link - odidev/seata Tags | Docker Hub

GitHub Link:https://github.com/seata/seata

Also I have Modified the distribution/Dockerfile, .github/workflows/test.yml, .github/workflows/test.yml, pom.xml and serializer/seata-serializer-protobuf/pom.xml file for running the test for arm64 platform

gha_log_test-arm64: gha_log_test-arm64.txt

gha_link: https://github.com/odidev/seata/runs/6854356068?check_suite_focus=true

Do you have any plans on releasing arm64 images and add arm64 support in ci?

Please have a look at the changes and let me know, I can raise a PR for the same.

odidev commented 2 years ago

@a364176773

seata binary is not available for arm64 platform. I have tried to built the arm binary for this repository using mvn clean install but, I have faced below error.

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.19.1:test (default-test) on project seata-common: There are test failures.
[ERROR]
[ERROR] Please refer to /home/abhay/seata/common/target/surefire-reports for the individual test results.
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :seata-common

After that, tried using mvn clean compile -Dcheckstyle.skip=true. It ran successfully but I'm not able to find the exact location of the binaries. I am not sure that binaries are built or not.

It will be very helpful if you share some pointer on it how can we build and release arm64 binaries for this repo. If required, I am happy to help. Also please have a look on  this Thanks in advance.

odidev commented 2 years ago

@a364176773 @slievrly Can you please review my previous comment Kindly share some pointer on it how can we build and release arm64 binaries for this repository. Thanks in advance.

funky-eyes commented 2 years ago

Execute first modify distribution/dockerfile ,then in seata folder execute mvn -Prelease-seata -Dmaven.test.skip=true clean install -U In the target directory under the distribution folder, you can find the packaged folder for docker build testing

odidev commented 2 years ago

@slievrly @a364176773

Could you please share your opinion regarding docker image for arm64. Please have a look at the changes and let me know, I can raise a PR for the same. Thanks in advance.

slievrly commented 2 years ago

@odidev Thank you for your feedback on this issue. We noticed this, so we released a Seata docker image with arm64 platform support based on the openjdk: 8u332 base image (support both AMD64 and ARM64).

https://github.com/seata/seata/pull/4802/files https://github.com/seata/seata/pull/4805/files

https://hub.docker.com/layers/76626452/seataio/seata-server/latest/images/sha256-da083a7dce2b524c29dafaa0d834af52568e669908ecdf3a3cab0e3299e2d8a4?context=repo

odidev commented 2 years ago

@slievrly

I have resolved maven related error and successfully built package folder (arm64 binary) by using mvn -Prelease-seata -Dmaven.test.skip=true clean install -U inside the target directory under the distribution folder in my local instances by doing few changes in these files. It will be very helpful if you suggest me, how can we test arm64 binaries for this repo.

odidev commented 2 years ago

For arm64 test support

@slievrly @a364176773

I have Modified these files ....  .github/workflows/test.yml, dependencies/pom.xml, discovery/seata-discovery-etcd3/pom.xml, discovery/seata-discovery-etcd3/src/test/java/io/seata/discovery/registry/etcd/EtcdRegistryServiceImplTest.java, integration/grpc/pom.xml and serializer/seata-serializer-protobuf/pom.xml for running the test for arm64 platform.

commit-link: https://github.com/odidev/seata/commit/282466e54aa36e2d54d05bc173f754ef709ff648

gha_log_test-arm64: https://github.com/odidev/seata/runs/7968840046?check_suite_focus=true

Do you have any plans on add arm64 support in ci? Please have a look at the changes and let me know if I can raise a PR for the same.

odidev commented 2 years ago

Hi, @slievrly @a364176773 @zhengyangyong

Please have a look at the changes for arm64 binary and arm64 test-support, let me know if I can raise a PR for the same. Thanks in advance.

odidev commented 2 years ago

@slievrly @a364176773

Please have a look at the changes for arm binary and arm64 test-support, Could you please let me know if there are any plans for releasing arm64 binary and adding arm64 test support in ci. I can raise a PR for the same. Thanks in advance.