basho / riak

Riak is a decentralized datastore from Basho Technologies.
http://docs.basho.com
Apache License 2.0
3.92k stars 534 forks source link

riak on YP/OE #1039

Closed joaohf closed 3 years ago

joaohf commented 3 years ago

Hi there

I'm developing a riak recipe for the [Yocto Project](https://www.yoctoproject.org]/[Openembedded](https://www.openembedded.org) using the meta-erlang layer. I know that it seems weird or unconventional but lets focus on riak.

Here is my ongoing development: https://github.com/joaohf/meta-erlang/pull/58

My aimed is to be able to run riak on embedded devices as well traditional servers (bare metal or VMs).

During the build and packaging of erlang applications I usually face a lot of small issues regarding cross compilation problems and the correct set of dependencies.

I have a couple of questions/report regarding to riak build process.

  1. What is the purpose of having rebar3 or rebar binaries in the repository ?

  2. cross compiling eleveldb is broken or at least not working properly. I'm planning to fix that properly and submit the PRs

  3. canola and syslog uses the old rebar approach. rebar3 uses a different and better approach when cross compiling. I'm also preparing PRs

Anyway, this issue is most to track my progress for those interesting in use riak with Linux embedded projects.

Thanks

martinsumner commented 3 years ago

wrt (1) - I think it was just done to avoid issues with different local versions of rebar3 not working as expected, so a specific version of the rebar3 executable was packaged everywhere. There may well have been better ways of addressing this problem.

joaohf commented 3 years ago

Hello

Overall status: building and running riak on qemu arm works as expected. I'll run more tests and try to build for other architectures. This approach can be an option for those want to run riak plus custom hardware (not only in embedded field), creating amazing solutions.

Item 1:

Thanks. I was using rebar3 3.14 and got some weird errors related to relx and cuttlefish. Using 3.13.2 works.

Item 2:

After changing the eleveldb build script build_deps.sh and adding a Makefile it builds. Also this approach is not using the rebar pc plugin.

One small detail is that I'm using snappy-1.1.8 instead of the snappy tar.gz from eleveldb.

The eleveldb works as expected. I didn't perform any additional tests yet.

Item 3: very specific to YP/OE, but worth to mention here:

Building canola and syslog requires special changes in rebar.config and the respective rebar.config.script (1, 2 and adding Makefiles (1, 2)

I would like to say thank you guys for the hard work maintaining riak.

joaohf commented 3 years ago

So far, riak works with arm and x86 as well x86-64.

I couldn't build for arm64 due to:

| ./port/atomic_pointer.h:143:2: error: #error Please implement AtomicPointer for this platform.
|   143 | #error Please implement AtomicPointer for this platform.

In leveldb/port/atomic_pointer.h

I left it for the next round.

Thanks