fly-apps / fly-laravel

Run your Laravel apps on Fly
42 stars 3 forks source link

Initial command for mounting volume(s) to a Laravel Fly App storage f… #56

Closed KTanAug21 closed 11 months ago

KTanAug21 commented 12 months ago

…older

**This will persist the storage folder by mounting the necessary number of volumes in the proper regions."

  1. Detect number of machines and on which regions
  2. Create matching volumes for the machines
  3. Revise the fly.toml to include the mount section
  4. Copy over script to reinit the storage folder( as the storage folder is set empty when initially mounting volume )
  5. Re-deploy if confirmed!

Possible edge cases to work on

  1. When existing volumes already exist to match machines, don't create anymore
  2. Will find out more!
Johannes-Werbrouck commented 11 months ago

Could you also add some documentation in the readme file?

KTanAug21 commented 11 months ago

Looks good!

Nice, thanks for the eyes @Johannes-Werbrouck ! Gonna merge soon!

fideloper commented 11 months ago

Looks great! There's actually an API endpoint in the Machines API to create volumes. You may want to use that, unless calling the CLI directly does extra work for you that the API might not do (sometimes flyctl does things better! I'm not sure if that's the case for volume creation).

Check out https://docs.machines.dev/swagger/index.html to see the Volume related API section (and examples of request/response JSON).

(You don't NEED to change over to the API, just want you to be aware of it!)

KTanAug21 commented 11 months ago

Looks great! There's actually an API endpoint in the Machines API to create volumes. You may want to use that, unless calling the CLI directly does extra work for you that the API might not do (sometimes flyctl does things better! I'm not sure if that's the case for volume creation).

Check out https://docs.machines.dev/swagger/index.html to see the Volume related API section (and examples of request/response JSON).

(You don't NEED to change over to the API, just want you to be aware of it!)

ohhhhh right on @fideloper !! I didn't know about the api on creating volumes( but it makes sense that there is one! ), much less this swagger ui for the fly machines api---this is super helpful