Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions lib/flame/fly_backend.ex
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ defmodule FLAME.FlyBackend do
:cpu_kind,
:cpus,
:gpu_kind,
:mounts,
:memory_mb,
:image,
:app,
Expand All @@ -73,6 +74,7 @@ defmodule FLAME.FlyBackend do
cpus: nil,
memory_mb: nil,
gpu_kind: nil,
mounts: [],
image: nil,
services: [],
app: nil,
Expand All @@ -86,7 +88,7 @@ defmodule FLAME.FlyBackend do
runner_private_ip: nil,
runner_node_name: nil

@valid_opts ~w(app image token host cpu_kind cpus memory_mb gpu_kind boot_timeout env terminator_sup log services)a
@valid_opts ~w(app image token host cpu_kind cpus mounts memory_mb gpu_kind boot_timeout env terminator_sup log services)a

@impl true
def init(opts) do
Expand Down Expand Up @@ -179,11 +181,12 @@ defmodule FLAME.FlyBackend do
name: "#{state.app}-flame-#{rand_id(20)}",
config: %{
image: state.image,
mounts: state.mounts,
guest: %{
cpu_kind: state.cpu_kind,
cpus: state.cpus,
memory_mb: state.memory_mb,
gpu_kind: state.gpu_kind
gpu_kind: state.gpu_kind,
},
auto_destroy: true,
restart: %{policy: "no"},
Expand Down
8 changes: 8 additions & 0 deletions lib/flame/fly_backend/mounts.ex
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
defmodule FLAME.FlyBackend.Mounts do
@derive Jason.Encoder
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hey, you should be aware that FLAME is not using Jason module for last versions it is using FLAME.Parser.JSON which is a wrapper which detects the version you are using and sets Jason or :json parsers.

defstruct name: nil,
path: nil
# extend_threshold_percent: 0,
# add_size_gb: 0,
# size_gb_limit: 0
end