Fly recently migrated from their (now legacy) "Nomad platform" to the new "machines platform." There are some significant differences in terms of how volumes are mounted to an app. For example you now need "at least two volumes per app," and volumes need to be pinned to a "machine," but once you've launched a machine, it's not possible to assign a volume to it unless you destroy the machine.
We need to update the docs to reflect this, but in the meantime I've changed the docs to suggest users add the --force-nomad flag to fly launch, which opts into the legacy Nomad platform.
If you were following our Seafowl docs about deploying to Fly, and you had the latest fly CLI but didn't add the --force-nomad flag, the first time you would notice this is when you try to mount a volume to an app (following the guide in our docs):
~/exp/fly-seafowl
❯ fly volumes create seafowl_data --region lhr --size 1
Warning! Individual volumes are pinned to individual hosts. You should create two or more volumes per application. You will have downtime if you only create one. Learn more at https://fly.io/docs/reference/volumes/
? Do you still want to use the volumes feature? Yes
ID: vol_e628r6gojodvwmnp
Name: seafowl_data
App: splitgraph-testing
Region: lhr
Zone: b6a7
Size GB: 1
Encrypted: true
Created at: 30 Mar 23 21:17 UTC
~/exp/fly-seafowl
❯ vi fly.toml
# Added this:
# [mounts]
# source="seafowl_data"
# destination="/seafowl-data"
~/exp/fly-seafowl
❯ fly deploy
==> Verifying app config
Validating /Users/mjr/exp/fly-seafowl/fly.toml
Platform: machines
✓ Configuration is valid
--> Verified app config
==> Building image
Searching for image 'splitgraph/seafowl:nightly' remotely...
image found: img_nr0lpjql8x9v5q98
Error error machine 148edd1f345e08 does not have a volume configured and fly.toml expects one with destination /seafowl-data; remove the [mounts] configuration in fly.toml or use the machines API to add a volume to this machine
The command that it seems we want is flyctl machines update 148edd1f345e08 --volume seafowl_data:/seafowl-data, to add a volume to a machine, but this doesn't work:
? Apply changes? Yes
Updating machine 148edd1f345e08
Error could not stop machine 148edd1f345e08: failed to update VM 148edd1f345e08: unable to add volume after machine is created
Fly recently migrated from their (now legacy) "Nomad platform" to the new "machines platform." There are some significant differences in terms of how volumes are mounted to an app. For example you now need "at least two volumes per app," and volumes need to be pinned to a "machine," but once you've launched a machine, it's not possible to assign a volume to it unless you destroy the machine.
We need to update the docs to reflect this, but in the meantime I've changed the docs to suggest users add the
--force-nomad
flag tofly launch
, which opts into the legacy Nomad platform.If you were following our Seafowl docs about deploying to Fly, and you had the latest
fly
CLI but didn't add the--force-nomad
flag, the first time you would notice this is when you try to mount a volume to an app (following the guide in our docs):The command that it seems we want is
flyctl machines update 148edd1f345e08 --volume seafowl_data:/seafowl-data
, to add a volume to a machine, but this doesn't work:Relevant Fly docs:
We probably want to update our docs to include two guides:
Once we figure all this out, we should remove the warnings about the legacy API that I added to the docs in this commit: https://github.com/splitgraph/marketing/commit/640d9f5190c18859203d1c1c7264eb2c13dd2871