2023-01-30T03:24:26.674 runner[1781031f9e9689] sin [info] Pulling container image
2023-01-30T03:24:28.306 runner[1781031f9e9689] sin [info] Pulling container image
2023-01-30T03:24:29.596 runner[1781031f9e9689] sin [info] Pulling container image
This time while running fly deploy I specified the region as maa but the builder still seems to be created in sin. Here’s the command I am using to trigger the remote build
fly deploy --region=maa --image-label v0.0.1 --build-only --push --remote-only -a <app_name>
==> Verifying app config
--> Verified app config
==> Building image
WARN Failed to start remote builder heartbeat: You hit a Fly API error with request ID: 01GR0B3S260GHKD4YJTFFM527X-maa
WARN Remote builder did not start in time. Check remote builder logs with `flyctl logs -a fly-builder-autumn-sea-3191`
Error failed to fetch an image or build from source: error connecting to docker: remote builder app unavailable
@hi.kanily It turns out that you can’t set the builder’s region. They spawn in the region closest to you geographically. You also can’t set the app’s region because it’s tied to the region of the volume.
I think allowing region override for builders should be an option for cases like this.
Anyway, I came up with a hack you can try to workaround this:
Trigger a build:
fly deploy ... --region sjc --build-only
Once it shows “WARN Failed to start remote builder heartbeat” or “waiting for remote builder…”, CTRL+C it. You only want the builder to spawn. (I’m using sjc region but you can use any, remember to replace it in the steps below if you change it!)
Grab the builder app name:
fly apps list
The builder app starts with fly-builder-....
Grab the builder app’s machine ID:
fly machine list -a $BUILDER_APP_NAME
There should only be one machine, in the sin region. Copy that ID.
Clone the machine into a different region:
fly machine clone $MACHINE_ID_FROM_ABOVE --region sjc -a $BUILDER_APP_NAME
This will clone the machine and its volume into the sjc region.
Verify that sjc is in the app’s region pool:
fly regions list -a $BUILDER_APP_NAME
(Don’t bother with fly regions set .., it won’t go through because of the attached volume in sin.)
Monitor the logs of your builder, it should hint that sjc is up and running:
I’m trying that out now, will report back! It probably won’t be charged because the machine doesn’t seem to know that it’s a builder, but the app does, so the billing probably skips resources connected to a builder app.
More fundamentally, if builders are free and ssh-able, is there anything preventing abuse of builder-spawned machines?