Skip to content

Commit 744d2fe

Browse files
author
benbot
committed
Adds mounts to fly backend
1 parent cca613c commit 744d2fe

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

lib/flame/fly_backend.ex

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ defmodule FLAME.FlyBackend do
5454
:cpu_kind,
5555
:cpus,
5656
:gpu_kind,
57+
:mounts,
5758
:memory_mb,
5859
:image,
5960
:app,
@@ -73,6 +74,7 @@ defmodule FLAME.FlyBackend do
7374
cpus: nil,
7475
memory_mb: nil,
7576
gpu_kind: nil,
77+
mounts: [],
7678
image: nil,
7779
services: [],
7880
app: nil,
@@ -86,7 +88,7 @@ defmodule FLAME.FlyBackend do
8688
runner_private_ip: nil,
8789
runner_node_name: nil
8890

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

9193
@impl true
9294
def init(opts) do
@@ -179,11 +181,12 @@ defmodule FLAME.FlyBackend do
179181
name: "#{state.app}-flame-#{rand_id(20)}",
180182
config: %{
181183
image: state.image,
184+
mounts: state.mounts,
182185
guest: %{
183186
cpu_kind: state.cpu_kind,
184187
cpus: state.cpus,
185188
memory_mb: state.memory_mb,
186-
gpu_kind: state.gpu_kind
189+
gpu_kind: state.gpu_kind,
187190
},
188191
auto_destroy: true,
189192
restart: %{policy: "no"},

lib/flame/fly_backend/mounts.ex

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
defmodule FLAME.FlyBackend.Mounts do
2+
@derive Jason.Encoder
3+
defstruct name: nil,
4+
path: nil
5+
# extend_threshold_percent: 0,
6+
# add_size_gb: 0,
7+
# size_gb_limit: 0
8+
end

0 commit comments

Comments
 (0)