The Interledger Community 🌱

Radhy
Radhy

Posted on

 

Has anyone tried running Rafiki locally?

I know Rafiki isn't ready yet, but I've been wanting to try running Rafiki on my local machine. Tested it on Mac mini M1 chip, but got crash when trying build with Docker.

The script I'm running:

yarn docker build backend -t rafiki-backend
Enter fullscreen mode Exit fullscreen mode

It seems that the crash because I haven't set the Docker to run as non-root user, but I couldn't manage to set that up because I'm clueless as a mac user less than one year experience and to add to that, most guides to set Docker as non-root user seems written for Linux users.

Any help appreciated 🙏

Top comments (8)

Collapse
 
omertoast profile image
Ömer Özdemir

Hey @radhyr, I don't think the problem is setting docker as non-root user as it's not possible nor required on macOS. I guess the problem is the node version you are using according to my experiences with macOS M1. You can try using node v14 and build the image. If it still doesn't work then you can create an issue about it on Rafiki repo, I would like to help you with that.

Collapse
 
radhyr profile image
Radhy

Thanks for coming by @omertoast
It seems changing node version to v14 doesn't help me much here. Here's the error screenshot I got:
error

I opened an issue per your suggestion here:
github.com/interledger/rafiki/issu...

Collapse
 
radhyr profile image
Radhy

I think this has to do with bcrypt failing in Docker m1 chip
github.com/kelektiv/node.bcrypt.js...

Collapse
 
vineel profile image
Vineel R. Pindi

Hi @radhyr , Rafiki planning calls are open to community and are hosted every Monday at 17:00 GMT, via Google Meet [1]. You could try joining if possible to get your questioned answered.

In between, I'll get back with more details about your question shortly.

[1] Google Meet joining info Video call link: meet.google.com/rdx-xoqn-iiq Or dial: ‪(US) +1 408-831-2432‬ PIN: ‪472 676 485‬# More phone numbers: tel.meet/rdx-xoqn-iiq?pin=32630088...

Collapse
 
vineel profile image
Vineel R. Pindi

Hi @radhyr , I checked with the team, and we don't have a dockerized version yet to run locally; it's a work in progress and the documentation should be available shortly! If you have any other questions, please let me know.

Collapse
 
radhyr profile image
Radhy

Oh, so that was the case. I thought I made a mistake somehow. Really looking forward for Rafiki to be available soon! Thanks for the reply Vineel! 👍

Collapse
 
radhyr profile image
Radhy

So I did troubleshooting myself by following clue I got from bcrypt dependency. This bug is exclusive to Mac with M1 chips and when building a Docker image.

In package.json I change bcypt version from "^5.0.1" to "5.0.0" to downgrade and lock the culprit dependency that crashes Docker. From there I run yarn rebuild and run the Docker build image again.

And there it goes 😎! I finally got Rafiki build in my machine.

Rafiki docker

But now the problem is Docker can't run the image somehow.
This is the error I got when tried running Rafiki:

Error: Failed to initialize io_uring
    at Object.Module._extensions..node (internal/modules/cjs/loader.js:1144:18)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.external_module_.Module._load (/workspace/.pnp.cjs:19603:14)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:101:18)
    at Object.<anonymous> (/workspace/.yarn/unplugged/tigerbeetle-node-npm-0.4.1-16106fd9d1/node_modules/tigerbeetle-node/dist/index.js:4:17)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.external_module_.Module._load (/workspace/.pnp.cjs:19603:14)
emergency: Failed to initialise environment.

internal/modules/cjs/loader.js:1144
  return process.dlopen(module, path.toNamespacedPath(filename));
Enter fullscreen mode Exit fullscreen mode
Collapse
 
chrislarry profile image
Chris Lawrence