Skip to content

Commit

Permalink
fix: workaround for identus-cloud-agent/1482 #101 (#101)
Browse files Browse the repository at this point in the history
Workaround for Mac M4 / Docker / Java Bug - (No Java detected)
See [identus-cloud-agent/issues/1482](hyperledger/identus-cloud-agent#1482)

Signed-off-by: FabioPinheiro <[email protected]>
Co-authored-by: goncalo-frade-iohk <[email protected]>
  • Loading branch information
FabioPinheiro and goncalo-frade-iohk authored Jan 17, 2025
1 parent 6e6d4ac commit 2846be9
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 2 deletions.
5 changes: 5 additions & 0 deletions identus-docker/cloud-agent-M4-workaround/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
FROM docker.io/identus/identus-cloud-agent:1.40.0

USER root
RUN sed -i -e 's/"\$java_cmd"/"\$java_cmd" -XX:UseSVE=0/g' ./bin/identus-cloud-agent
USER demiourgos728
2 changes: 2 additions & 0 deletions identus-docker/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ services:

cloud-agent:
image: docker.io/identus/identus-cloud-agent:1.40.0
# build: ./cloud-agent-M4-workaround # Workaround for the M4 see https://github.com/hyperledger/identus-cloud-agent/issues/1482
ports:
- "8085:8085" # API endpoint
- "8090:8090" # DIDComm endpoint
environment:
JAVA_OPTS: "-XX:UseSVE=0"
POLLUX_DB_HOST: db
POLLUX_DB_PORT: 5432
POLLUX_DB_NAME: pollux
Expand Down
26 changes: 24 additions & 2 deletions identus-docker/dockerize-identus.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,28 @@ The port `8085` should not be publicly accessible.

Other Docker network drivers, like `macvlan`, could be useful for running multiple instances for testing purposes, making them appear as different machines on your local network. However, these drivers are not supported on Docker Desktop for Mac and Windows.

---
## Troubleshoot

### Mac M4 / Docker / Java Bug - (No Java detected)

If you see the following message `No java installations was detected.` when starting docker compose on a Mac with the M4 CPU. There is a problem and a workaround for it.
For more information check the [issues](https://github.com/hyperledger/identus-cloud-agent/issues/1482)

The workaround is to disable CPU's vector extensions. So we need to create a new docker image based on the previous one.
We do that on the [Dockerfile](./identus-docker/cloud-agent-M4-workaround/Dockerfile) (for version 1.40.0) where we hard-code the workaround.

So on your docker compose file [docker-compose.yaml](identus-docker/docker-compose.yaml) you need to use the new image we just created.
By changing the following:

- From
```
image: docker.io/identus/identus-cloud-agent:1.40.0
# build: ./cloud-agent-M4-workaround
```
- To
```
# image: docker.io/identus/identus-cloud-agent:1.40.0
build: ./cloud-agent-M4-workaround
```

Let me know if there are any specific adjustments or additional sections you'd like to add!
We recommended way of running docker compose `docker compose up --build --remove-orphans --force-recreate` (just to be extra sure there is no confusion with caches)

0 comments on commit 2846be9

Please sign in to comment.