Releases for ARM64

Moved from GitHub dgraph/5566

Posted by TiemenSch:

Experience Report

Hi, ARM64 support was already requested and confirmed as a conclusion of #3586, but official releases of Dgraph haven’t been included. It would be awesome if the Docker images of Dgraph would be cross-compiled and included in the manifests so they work on ARM64 out of the box.

What you wanted to do

Run Dgraph on my Raspberry Pi 4 K3s cluster. I believe that the enthousiasts (like me) that want to try out Dgraph might just have an ARM server or cluster at home which requires ARM64 binaries or images.

What you actually did

Currently, I made a pipeline over at Gitlab that compiles to ARM64 and stores a Docker image. That image seems to work on my Raspberry Pi 4’s as a demo cluster. See:

registry.gitlab.com/tiemen/dgraph-aarch64:latest

Why that wasn’t great, with examples

It’s better to have a single “official” source of cross-compiled images in a single manifest. I’m for instance not sure what the compiled binary expects on the system, which is why I don’t know if I can get away with a clean alpine image with the binary dropped in in the long run. (e.g. user rights, folder structure, etc.)

Any external references to support your case

My custom setup uses Docker buildx: Overview of Docker Build | Docker Docs
I would be happy to submit a PR that mimics this, but as this influences your release process (and I usually work with Gitlab pipelines) I’m not entirely sure how this should work.

1 Like

jamesjarvis commented :

+1 this, would be a great (and simple) addition to have multi-arch docker images :grinning_face_with_smiling_eyes:

Edit: Looks like multi-arch compiling would require also modifying the way each of the binaries are compiled, since all releases are built from the same script dgraph/release.sh at master · dgraph-io/dgraph · GitHub

TiemenSch commented :

The most important binary by far is the dgraph one itself, as ratel should be able to run remotely and tap into your database. Compiling ratel was also slightly more tricky in my limited attempt. I think an initial PR for the dgraph binary only would already go a long way!

Really hoping this gets picked up soon, because my custom built pipeline is getting stuck on some peculiar issues.

When ARM64 support has been released, will we see Android and iOS capable of making a Dgraph server? :smiley:

Honestly, that could be one of my big dreams. (So, I don’t have to turn on my computer every time I want to access my Dgraph database.)

Update: I’m also thinking it could be another unique selling point of Dgraph (compared to other database management systems).

1 Like

That seems a bit of a far-fetched use-case to be honest (you would have to design a complete app around this, and somehow maintain a server running on some device that travels throughout the world). Completely different issue, which naturally needs this compilation issue to be completed first ;).

ARM in general is making a good name for itself as far as architectures go and the Go language used to build Dgraph has cross-compilation built in. It does take some effort rewriting the current CI/CD pipelines and optionally finding some ARM hardware for that. Docker buildx may be a short-term alternative to emulate ARM64, too. Also, I wouldn’t mind opening up my three piece RPi4 cluster for some initial CI/CD testing.

Here’s to hoping this gets picked up soon! I think it would be great for enthusiasts to start tinkering on their Raspberries with it.

1 Like

Bumping this issue up as dgraph does is not working on latest t4g instances that AWS has launched with Graviton2 processors based on Arm64. There are other instance types that AWS has launched along with t4g based off Graviton2. This should make enough of a case for this to be fast tracked.

2 Likes

It is being worked on :slight_smile:

4 Likes

Very interested in Dgraph on ARM as well.
Is there any timeline of what & when to expect?

A bit of a delay. Recently we decided to focus more on Linux, and given M1 Macs are the only commercially available Arm64 machines (outside Gravitons), there’s gonna be a bit of a delay

1 Like

Really interested in an ARM binary to use on Graviton instances on AWS. Looking forward for it.

2 Likes

Am curious about Graviton myself. We will investigate it in Q3 perhaps.

Note that you can always compile Dgraph yourself. Infact, if you do, let us know how it works on Graviton.

3 Likes

I got it working on arm machine a few months back. Here is a gist if someone wants to try it out themselves. Build DGraph for ARM processor · GitHub

Cannot comment on how it works as it was just a test, nothing production level.

1 Like

With the latest version of Go, I can happily announce that Dgraph builds and runs. (again, official support is not really there yet, I am speaking on personal capacity)

1 Like

Yes, I got this to both build with Docker Desktop on a M1 laptop and using crosscompiling on my Linux desktop.

Desktop: Running and Building ARM Docker Containers on x86 | Stereolabs

My dockerfile (grabbed from above):

FROM arm64v8/golang:1.16.5-buster as builder

RUN apt-get update && apt-get install -qy build-essential software-properties-common gcc make sudo

ENV CGO_ENABLED=1 GOOS=linux GOARCH=arm64
RUN go get -u -v google.golang.org/grpc && \
    git clone --depth 1 --branch v21.03.1 https://www.github.com/dgraph-io/dgraph/ && \
    cd dgraph && \
    make dgraph

RUN mkdir -p /dist/bin && \
    mkdir -p /dist/tmp && \
    mv dgraph/dgraph/dgraph /dist/bin/dgraph

FROM arm64v8/debian:buster-slim as dgraph
RUN apt-get update && apt-get install libjemalloc-dev -qy
COPY --from=builder /dist /
ENV PATH=$PATH:/bin/
RUN chmod +x /bin/dgraph
WORKDIR /bin

EXPOSE 5080 6080 7080 8080 8000 9080
COPY --from=builder /go/dgraph/contrib/standalone/run.sh /run.sh
RUN chmod +x /run.sh
CMD ["/run.sh"]

Builds crazy quick on the m1, takes about 2 minutes to build via docker.

1 Like

Hey,
after 11 months, what is the progress for multi-platform images?
Would love to use it on my M1 Mac (without building it myself).

2 Likes

Hi it may be on hold for now, check announcements out on the discord Community-run unofficial Discord community

It would be a shame if ARM64 support was on hold. I really want the k8s operator working on my ARM64 Raspberry Pi 4 only cluster (k3s). I have other databases running on it, but I’ve been moving toward DGraph at work, and I can’t play around with it at home unless it runs on my cluster, since that’s the only thing with enough storage for my graph data.

arm64 is essential as cloud providers launch more arm64 enabled instances that are actually cheaper. as for developers working on Apple Silicon it would also make sense.

I compiled master on an Apple M1 but upon starting dgraph alpha it throws errors that some server running at port 2000 stopped working

1 Like

With everything else on arm, Ratel is the only missing piece.
Arm enables cheaper servers, and also, M1 macs are hugely popular.
Releasing ratel docker images for arm should be prioritized.