mbklein

mbklein

I’ve been playing with the Remote Execution smart cell, and it’s been mostly fantastic. Just about everything I was looking for when I made this offhand comment back in May. :slight_smile:

I’m left with two major questions:

  1. I’m working on creating a LiveBook that will be mostly focused on interacting with one specific application. I’d like to be able to set the node name and cookie somewhere (maybe in the setup; maybe in a regular cell) and have those become the values (or at least the defaults) used for each Remote Execution smart cell I add. I’d be happy to use secrets for them[1], but it looks like you can’t use a secret or variable for the node name. I suppose the alternative would be to create my own smart cell that uses my target runtime’s settings instead of allowing for user input.

  2. I’ve found that I get an error if the Elixir/OTP versions of the livebook environment and the remote are not exactly the same, down to the elixir point release (i.e., Livebook built on 1.15.2-otp-26 while my remote runtime is 1.15.4-otp-26). Is there a way around that, or is it just how it is? I don’t mind building a livebook container using the same base image as my app, but if there’s another way, I’d love to know it.

[1] Side question: Is it possible to programatically set a secret from a cell (or in the notebook setup) for use in another cell?

Showing Posts 11 to 2

codyjroberts

codyjroberts

Works great. Thanks much!

josevalim

josevalim

Creator of Elixir

Can you folks please try Kino’s main? GitHub - livebook-dev/kino: Client-driven interactive widgets for Livebook · GitHub We have pushed a new approach that should work and be more robust across both Erlang and Elixir version changes.

josevalim

josevalim

Creator of Elixir

Can you call :erpc.call(node, :elixir, :module_info, []) on both nodes and let me know what it returns? Is the vsn attribute the same? Are the OTP versions exactly the same too?

EDIT: Nevermind, I know what is wrong. The fix we provided for Elixir is not enough.

codyjroberts

codyjroberts

Thanks for the reply and sorry for the confusion.

What I’m saying is that the nodes are on 1.15.7. They all return the same value from System.build_info().

josevalim

josevalim

Creator of Elixir

You need both nodes on 1.15.7+, which means it requires the same version for now but not for future versions.

codyjroberts

codyjroberts

@josevalim @jonatanklosko super excited to see the remote smart cell. But I’ve been having some issues.

I saw your PRs and reddit post around the fix for :eprc.call(node, fn -> :ok end) failing on differing OTP/elixir versions, yet I’m seeing the same issue on latest with and without the smart cell. I can’t for the life of me find any documentation around how to get OTP minor/patch versions from the repl though.

Error:

** (ErlangError) Erlang error: {:exception, {:badfun, #Function<43.105768164/0 in :erl_eval.expr/6>}, [{:erlang, :apply, 2, []}]}
    (kernel 9.1) erpc.erl:702: :erpc.call/5

Remote node, local livebook (connected via wireguard), and fly notebook all show

%{
  version: "1.15.7",
  date: "2023-10-14T10:23:03Z",
  otp_release: "26",
  build: "1.15.7 (compiled with Erlang/OTP 26)",
  revision: "927b10d"
}

and Livebook v0.11.3 (also tried v0.11.2)

:erpc.call works fine w/ MFA. I’m stumped on how to debug this further and I’m probably doing something silly so figured I’d post here rather than open an issue. Any ideas?

mbklein

mbklein OP

OTP 26 on both. The only difference when I get the error is the Elixir patch version.

josevalim

josevalim

Creator of Elixir

I see. So you need to create a secret, choose it, and then you can replace its value dynamically inside the runtime using System.put_env/2.

mbklein

mbklein OP

Will do, thanks.

Wow, I even had the error on my clipboard ready to go, and completely failed to hit paste.

My test remote runtime’s startup log looks like this:

Erlang/OTP 26 [erts-14.1] [source] [64-bit] [smp:2:2] [ds:2:2:10] [async-threads:1] [jit:ns]

Interactive Elixir (1.15.6) - press Ctrl+C to exit (type h() ENTER for help)

Then I run this in a livebook cell:

{:local, System.version(), :erlang.system_info(:otp_release)} |> IO.inspect()
Node.set_cookie(runtime_node, runtime_cookie)
:erpc.call(runtime_node, fn -> {:remote, System.version(), :erlang.system_info(:otp_release)} end)

Output:

{:local, "1.15.2", ~c"26"}
** (ErlangError) Erlang error: {:exception, {:badfun, #Function<43.125776118/0 in :erl_eval.expr/6>}, [{:erlang, :apply, 2, []}]}
    (kernel 9.0.2) erpc.erl:702: :erpc.call/5
    #cell:k7nkn7u5tzfc2lpqmpli5dnwbtu2zmg5:3: (file)

I get the same result if I change the remote function to fn -> :ok end, so clearly it’s not the code. Both functions work fine if the livebook node and the remote runtime node are on matching versions.

Secrets are env vars, so try setting or overriding “LB_SECRET_NAME”, and let us know how it goes.

I tried setting the env var in the notebook setup, and it didn’t create a secret that I could browse and select in the remote execution cell’s cookie field. But maybe it would work if I create the cookie beforehand and then change its value in code. I’ll play around with it and get back to you.

jonatanklosko

jonatanklosko

Creator of Livebook

@mbklein what OTP versions are you using on remote and locally?

Where Next? Top

Trending in Questions Top

katta
I having some trouble figuring out if I have set myself too strict of standards for my production server. Currently I can handle 75% of r...
New
achenet
Hello, I’m trying to build a basic Phoenix web-app, and I’d like to use Tailwind. However, when I launch mix phx.server, I get an error...
New
kpanic
Hi everyone, I am toying with the idea of building a “match maker” for giving personal help to people that wants to start coding. I sta...
New
Cxx-mlr
I’m working on a small exercise involving update_in/3, and I came up with this solution: data = %{ name: "Periodic Table", category:...
New
ChrisAmelia
I’ve got trouble wrapping my head around the order in which functions are called in this snippet (from Phoenix’s authentication): toke...
New
dillonoconnor
Is there any way to avoid the Hologram compiler running when using iex? It seems like the front-end code could potentially be disregarded...
New
thiagogsr
** (ArgumentError) expected :max_attempts to be a positive integer, got: {:@, [line: 10, column: 19], [{:max_attempts, [line: 10, column:...
New

Other Trending Topics Top

GenericJam
Edit: 2026 May 15 - This post is archived. Mob is alive!! Main docs: mob v0.7.11 — Documentation A bit of explanation for the slightly c...
New
mudasobwa
I am happy to introduce the very α version of the new programming language compiled to BEAM. Welcome Cure. It has literally three kille...
New
garrison
Hobbes is a low-level distributed database for the Elixir programming language. Hobbes provides a simple, safe, and scalable storage lay...
New
budgie
A little off-topic, but I feel like people here have a good head on their shoulders. I used to be quite good at making software. Was luc...
New
KristerV
Hey. Is there anyone here who creates agents in their apps? Not talking about using agents, but creating them. I’m finding it pretty diff...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews