mirror of
https://github.com/livebook-dev/livebook.git
synced 2024-12-29 19:20:46 +08:00
Show more info for Fly runtime in the runtime panel (#2711)
This commit is contained in:
parent
a85b3b02f5
commit
7858466ab5
1 changed files with 15 additions and 2 deletions
|
@ -337,8 +337,21 @@ end
|
||||||
defimpl Livebook.Runtime, for: Livebook.Runtime.Fly do
|
defimpl Livebook.Runtime, for: Livebook.Runtime.Fly do
|
||||||
alias Livebook.Runtime.ErlDist.RuntimeServer
|
alias Livebook.Runtime.ErlDist.RuntimeServer
|
||||||
|
|
||||||
def describe(runtime) do
|
def describe(%{config: config} = runtime) do
|
||||||
[{"Type", "Fly.io machine"}] ++
|
specs =
|
||||||
|
[
|
||||||
|
"#{config.cpus} #{config.cpu_kind} CPU",
|
||||||
|
"#{config.memory_gb} GB RAM",
|
||||||
|
config.gpu_kind && "#{config.gpus} #{config.gpu_kind} GPU"
|
||||||
|
]
|
||||||
|
|> Enum.reject(&is_nil/1)
|
||||||
|
|> Enum.join(", ")
|
||||||
|
|
||||||
|
[
|
||||||
|
{"Type", "Fly.io machine"},
|
||||||
|
{"App", config.app_name},
|
||||||
|
{"Specs", specs}
|
||||||
|
] ++
|
||||||
if runtime.node do
|
if runtime.node do
|
||||||
[{"Node name", Atom.to_string(runtime.node)}]
|
[{"Node name", Atom.to_string(runtime.node)}]
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in a new issue