Skip to content

Adds mounts to fly backend - #22

Closed
benbot wants to merge 4 commits into
phoenixframework:mainfrom
benbot:main
Closed

Adds mounts to fly backend#22
benbot wants to merge 4 commits into
phoenixframework:mainfrom
benbot:main

Conversation

@benbot

@benbot benbot commented Dec 20, 2023

Copy link
Copy Markdown

I'm working on getting some elastic LLM inference set up using phoenix, fly, and FLAME and needed volumes attached to my flame workers so that I don't need to download an 8gb+ model on startup.

I added support for the mounts field in the machines api (https://fly.io/docs/machines/working-with-machines/)

Though it seems like fly has a bug where this isn't working right now. I keep getting 500s when passing in that argument. I made a thread on their forum to track it
https://community.fly.io/t/machine-api-returning-500-when-passing-in-mounts/17336

@benbot

benbot commented Dec 21, 2023

Copy link
Copy Markdown
Author

Quick update. Apparently the volumeId is a required field, so i'm going to work on a change to this to grab a volumeId from existing un-attached volumes with matching names, and use those ids to build the mounts array

@benbot

benbot commented Dec 21, 2023

Copy link
Copy Markdown
Author

Alright, now the fly backend will attempt to find a volumeId that matches the name specified in the mounts config option.

If it finds enough it'll add those ids in as volume in the fly machine request.

This gets around the 500 that's thrown by fly if you don't include the volume id.

@mruoss mruoss left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Stumbled upon this. Some suggestions to improve readability.

Comment thread lib/flame/fly_backend.ex Outdated
Comment thread lib/flame/fly_backend.ex Outdated
Comment thread lib/flame/fly_backend.ex Outdated
@benbot

benbot commented Dec 30, 2023

Copy link
Copy Markdown
Author

These are great suggestions!

I'll get them in tomorrow

@andr-ec

andr-ec commented Dec 6, 2024

Copy link
Copy Markdown

@benbot could this be updated to resolve conflicts? I'd love to see this merged in to the latest!

@@ -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.

pxp9 added a commit to pxp9/flame that referenced this pull request May 24, 2025
@pxp9

pxp9 commented May 24, 2025

Copy link
Copy Markdown

Hey @andr-ec , I have opened a new PR which continues the work from Ben

Hope it is what you were looking for.

@benbot

benbot commented Apr 27, 2026

Copy link
Copy Markdown
Author

I check back in on flame every once in a while and it's kind of crazy that there's been 3 PRs for this same feature over the years and none of them got any official feedback

I know this isn't a priority for phoenix or fly, but still... total silence :(

I'll close this one, since the others are more up to date anyway.

@benbot benbot closed this Apr 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants