Closed myesn closed 1 year ago
Hi @myesn, openjdk:8-jre-alpine
can support arm64.
BTW, Do you have a mirror for building shenyu locally? It may be that the shenyu image in docker hub does not support arm64.
Sorry, I forgot to click the more
button.
BTW, Do you have a mirror for building shenyu locally? It may be that the shenyu image in docker hub does not support arm64.
I doesn't have a mirror for shenyu.
How should I go about solving this problem?
First, delete the shenyu image on your machine.
There is a temporary solution, you can first download the source code of the release to the machine you want to deploy, unzip it and execute it in the root directory of the project
mvn clean install -Dmaven.javadoc.skip=true -B -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests -Prelease,docker
This way, you will have the appropriate image on your machine, you can check it with docker images
.
@myesn Here are some additional suggestions, please refer mainly to the previous comment. I am using mac m1 which is also arm architecture. You might consider building the image locally to run the project. See the first part of this link on how to build the image locally.
Here is a screenshot of my docker repository, I can run shenyu-admin and shenyu-bootstarp normally.
Thanks a lot, I'll try it later, and if it works, I'll close this issue.
@JooKS-me @erdengk After shenyu-bootstrap
runs, after processing several http requests, this error occurs and shenyu-bootstrap
stops running:
shenyu-bootstrap | #
shenyu-bootstrap | # A fatal error has been detected by the Java Runtime Environment:
shenyu-bootstrap | #
shenyu-bootstrap | # Internal Error (assembler_aarch64.hpp:1156), pid=33, tid=0x0000ffffad4a6aa0
shenyu-bootstrap | # guarantee(Rs != Rn && Rs != Rt) failed: unpredictable instruction
shenyu-bootstrap | #
shenyu-bootstrap | # JRE version: OpenJDK Runtime Environment (8.0_212-b04) (build 1.8.0_212-b04)
shenyu-bootstrap | # Java VM: OpenJDK 64-Bit Server VM (25.212-b04 mixed mode linux-aarch64 compressed oops)
shenyu-bootstrap | # Derivative: IcedTea 3.12.0
shenyu-bootstrap | # Distribution: Custom build (Sat May 4 17:44:26 UTC 2019)
shenyu-bootstrap | # Core dump written. Default location: /opt/shenyu-bootstrap/core or core.33
shenyu-bootstrap | #
shenyu-bootstrap | # An error report file with more information is saved as:
shenyu-bootstrap | # /opt/shenyu-bootstrap/hs_err_pid33.log
shenyu-bootstrap | #
shenyu-bootstrap | # Compiler replay data is saved as:
shenyu-bootstrap | # /opt/shenyu-bootstrap/replay_pid33.log
shenyu-bootstrap | #
shenyu-bootstrap | # If you would like to submit a bug report, please include
shenyu-bootstrap | # instructions on how to reproduce the bug and visit:
shenyu-bootstrap | # https://icedtea.classpath.org/bugzilla
shenyu-bootstrap | #
I found the same problem elsewhere, it looks like there was a bug in the OpenJDK that needs to be fixed by upgrading the Docker image.
hi, @myesn I checked the link you provided and I think you are right. Maybe this problem can be solved by upgrading the openjdk version, can you help try it? I've been so busy with exams lately that I don't have time for this at the moment.
Very understand that you are busy with exams, but can other project members help me look at this problem (database and shenyu services run on arm64 architecture)?
I tried it all day today, using the v2.4.2 tag
and deploying it with Docker-Compose, but things didn't go well. I replaced the base Docker Image for shenyu-bootstrap
and shenyu-admin
with openjdk:8u322-jre
, and there was another new problems:
db
service image does not support arm64
architecture, I used biarms/mysql:5.7.30-linux-arm64v8
as a replacement, and it seems to work fineshenyu-admin
service's spring.profiles.active=mysql
environment variable configuration no longer works, I used SPRING_PROFILES_ACTIVE=mysql
to replace it and it worksshenyu-admin
service has an error that the database cannot be connected:
Communications link failure(The last packet sent successfully to the server was 0 milliseconds ago. The driver has not received any packets from the server)But when I use the source code of v2.4.2 tag
to run locally, the above errors do not appear, so I want to debug by printing some logs in the source code, but I don't know how the release profile works. I modified the source code, but there is no newly added code in the tar.gz
file of the final release. I tried my best. I have been doing this all day today. The Raspberry Pi executes mvn -Prelease, docker
is very Slow, it takes more than ten minutes each time. I really want to introduce this gateway product in our company, but at present, in terms of deployment, the database
, shenyu bootstrap
and shenyu admin
cannot run well on the arm64
architecture. I Hope you guys can help me with these issues, I'd be more than happy to assist you with testing!
Thanks!
Can you provide the log of shenyu-admin
?
@JooKS-me Thank you very much for your reply, I have compiled the following information for your reference.
All of the following steps are performed on the Raspberry Pi
:
1. Download and extract v2.4.2 Souce code(tar.gz)
2. Open and edit the contents of incubator-shenyu-2.4.2/shenyu-dist/shenyu-admin-dist/Dockerfile
and incubator-shenyu-2.4.2/shenyu-dist/shenyu-bootstrap-dist/Dockerfile
files:
3. Switch to the incubator-shenyu-2.4.2/shenyu-dist
directory and execute the following command (Total time 10:51 min):
mvn clean install -Dmaven.javadoc.skip=true -B -Drat.skip=true -Djacoco.skip=true -DskipITs -DskipTests -Prelease,docker
Although the following warning appears during the build process, the final result is BUILD SUCCESS
:
4. Execute the following command to download the v2.4.2 install.sh
file (auto-execute), the script will create a shenyu-v2.4.2
directory, since the database does not support arm64
architecture, this script will terminate when it outputs Pulling db(docker.io/mysql:5.7)
:
curl https://raw.githubusercontent.com/apache/incubator-shenyu/v2.4.2/shenyu-dist/shenyu-docker-compose-dist/src/main/resources/install.sh | bash -s v2.4.2 mysql
5. Open the shenyu-v2.4.2/docker-compose.yaml
file and modify the followingοΌ
6. Execute docker-compose up -d
command to start the service collection, all 3
services are created and started successfully, then execute docker-compose logs -f shenyu-admin
to view the logs:
From the logs, we can see that the shenyu-admin
program is using the h2
profile, but the environment
variable configured in docker-compose.yaml
is mysql
.
So I went inside the shenyu-admin
container to check the environment variables and found no problemsοΌ
7. So I opened the docker-compose.yaml
file and replaced spring.profiles.active=mysql
with SPRING_PROFILES_ACTIVE=mysql
in the environment
of the shenyu-admin
service:
8. Execute docker-compose down -v
(for a clearer view of the logs), then execute docker-compose up -d
again, wait for a successful start and then execute docker-compose logs -f shenyu-admin
to view the logs:
From the output log, we can see that active profile
is already correctly configured for mysql
, but there is a Communications link failure
error, which causes the program to run abnormally.
That's all the steps and the process.
- Execute the following command to download the v2.4.2 install.sh file (auto-execute), the script will create a shenyu-v2.4.2 directory, since the database does not support arm64 architecture, this script will terminate when it outputs Pulling db(docker.io/mysql:5.7):
@myesn After executing this command, what does the file directory look like (for example, you can check it with the tree
command)? Did something else go wrong while executing the script?
@JooKS-me Please check the following content:
And I noticed an unexpected file docker-compose.yamlr
, but I looked at the contents of the install.sh
file and there was nothing relevant.
ubuntu@ubuntu:~/shenyu/docker$ ls
ubuntu@ubuntu:~/shenyu/docker$ curl https://raw.githubusercontent.com/apache/incubator-shenyu/v2.4.2/shenyu-dist/shenyu-docker-compose-dist/src/main/resources/install.sh | bash -s v2.4.2 mysql
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2229 100 2229 0 0 67 0 0:00:33 0:00:33 --:--:-- 564
current version: v2.4.2
current storage: mysql
download docker-compose configuration
download mysql-connector.jar
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2275k 100 2275k 0 0 1010k 0 0:00:02 0:00:02 --:--:-- 1010k
download shenyu-admin of configuration
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1102 100 1102 0 0 640 0 0:00:01 0:00:01 --:--:-- 639
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4585 100 4585 0 0 9188 0 --:--:-- --:--:-- --:--:-- 9188
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 2788 100 2788 0 0 5632 0 --:--:-- --:--:-- --:--:-- 5620
download shenyu-bootstrap of configuration
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 14 100 14 0 0 6 0 0:00:02 0:00:02 --:--:-- 6
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4589 100 4589 0 0 11443 0 --:--:-- --:--:-- --:--:-- 11443
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 4361 100 4361 0 0 11012 0 --:--:-- --:--:-- --:--:-- 10984
Creating network "shenyu-v242_default" with the default driver
Pulling db (docker.io/mysql:5.7)...
5.7: Pulling from library/mysql
ERROR: no matching manifest for linux/arm64/v8 in the manifest list entries
ubuntu@ubuntu:~/shenyu/docker$ tree
.
βββ shenyu-v2.4.2
βββ docker-compose.yaml
βββ docker-compose.yamlr
βββ shenyu-admin
βΒ Β βββ conf
βΒ Β βΒ Β βββ application-mysql.yml
βΒ Β βΒ Β βββ application.yml
βΒ Β βΒ Β βββ logback.xml
βΒ Β βββ ext-lib
βΒ Β βΒ Β βββ mysql-connector.jar
βΒ Β βββ logs
βββ shenyu-bootstrap
βββ conf
βΒ Β βββ application-local.yml
βΒ Β βββ application.yml
βΒ Β βββ logback.xml
βββ logs
8 directories, 9 files
Hi @myesn , I reproduced your problem locally :)
I find that the base image you used openjdk:8u322-jre
will make the env of spring invalid.
There may be no problem in the dockerfile, and it is recommended not to modify it. I read the log of your shenyu-bootstrap, that is probably because shenyu-admin failed to start successfully, not because of the image problem of openjdk.
Is there an existing issue for this?
Current Behavior
Docker-Compose file:
master/shenyu-dist/shenyu-docker-compose-dist/src/main/resources/stand-alone-mysql/docker-compose.yaml
shenyu-admin
Docker file: master/shenyu-dist/shenyu-admin-dist/Dockerfileshenyu-bootstrap
Docker file: master/shenyu-dist/shenyu-bootstrap-dist/DockerfileI noticed that
shenyu-admin
andshenyu-bootstrap
are both built on theopenjdk:8-jre-alpine
image, but this image does not support the arm64 CPU architecture of the Raspberry Pi 4 Model B, which prevents theshenyu
services from running successfully.The
openjdk:8-jre-alpine
image does not support the arm64 CPU architecture:Expected Behavior
Make it work, thanks.
Steps To Reproduce
An error occurs after executing the following command:
Environment
Debug logs
Anything else?
Using the
arm64v8/openjdk:8-jre
image in our project can run successfully(I'm actually usingarm64v8/openjdk:8
π).