Depot remote builders becoming the default

This is being actively worked on. How much memory do you need?

I’ve seen this done by using a build argument and COPY --from pointing to the separately built frontend image, like:

ARG FRONTEND_IMAGE=frontend-build
COPY --from=${FRONTEND_IMAGE} /app/build /app/public

Would this work for your use case?

@joshua-fly Thank you for the quick reply!

re worker size: 8GiB of memory works consistently. The rollup process when building our next.js frontend is taking up a lot of memory and none of the recommendations to limit it I found online are doing anything.

re docker build:

I’ve seen this done by using a build argument and COPY --from pointing to the separately built frontend image, like:

ARG FRONTEND_IMAGE=frontend-build
COPY --from=${FRONTEND_IMAGE} /app/build /app/public

Would this work for your use case?

This would work, but can we build and push that image using fly somehow, or would we need a separate registry?

Depot builders are also sized at 8GB. You’re saying you see different results with Depot and the Fly builders?

You can use Fly. Something like this:

fly deploy --build-only --image-label registry.fly.io/myapp:sometag --dockerfile frontend.Dockerfile
fly deploy --dockerfile backend.Dockerfile --build-arg FRONTEND_IMAGE=http://registry.fly.io/myapp:sometag
``

Thanks for the commands, I was hoping for a way to automatically resolve that dependency and build it, but this should work as well!

Re depot worker: You’re right, it seems like our memory footprint grew again. I get the following error on both the legacy and depot builders, but not locally (running fly deploy --build-arg GIT_REVISION=$(git rev-parse --short HEAD) --vm-memory 8192 --local-only --build-only, which probably doesn’t actually limit the local memory usage). Manually changing the legacy builder size to 16GiB works.

0.680 > tsc && vite build                                                                                                                                                                                        
0.680                                                                                                                                                                                                            
10.36 vite v5.4.9 building for production...
10.45 transforming...
31.61 ✓ 3272 modules transformed.
34.09 rendering chunks...
50.09 
50.09 <--- Last few GCs --->
50.09 
50.09 [31:0x77c2000]    39617 ms: Scavenge 2037.6 (2082.7) -> 2037.1 (2083.7) MB, pooled: 0 MB, 6.66 / 0.00 ms  (average mu = 0.156, current mu = 0.097) allocation failure; 
50.09 [31:0x77c2000]    40607 ms: Mark-Compact 2039.1 (2084.1) -> 2037.3 (2085.4) MB, pooled: 0 MB, 979.67 / 0.00 ms  (average mu = 0.110, current mu = 0.037) allocation failure; scavenge might not succeed
50.09 
50.09 
50.09 <--- JS stacktrace --->
50.09 
50.09 FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory
50.09 ----- Native stack trace -----
50.09 
50.09  1: 0xe19de0 node::OOMErrorHandler(char const*, v8::OOMDetails const&) [node]
50.10  2: 0x1240310 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
50.10  3: 0x12405e7 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&) [node]
50.10  4: 0x146e125  [node]
50.10  5: 0x146e153  [node]
50.10  6: 0x148720a  [node]
50.10  7: 0x148a3d8  [node]
50.10  8: 0x1cc5711  [node]
50.27 Aborted
50.27  ELIFECYCLE  Command failed with exit code 134.
------
Error: failed to fetch an image or build from source: error building: failed to solve: process "/bin/sh -c pnpm build" did not complete successfully: exit code: 134

will be migrated to Depot’s Fly-hosted remote builder platform

So, is it remote or fly-hosted?

Observing below error intermediately

Waiting for depot builder...
Error: failed to fetch an image or build from source: error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = "transport: authentication handshake failed: EOF"

same here, amazing enhancement indeed

5 months later this is still broken, and for multiple users as it seems. Why would you make this half-baked thing a default? So frustrated with my fly experience.

Waiting for depot builder...
Waiting for depot builder...
 🌎DEBUG <-- 200 https://api.fly.io/graphql (378.56ms)

DEBUG {
  "data": {
    "ensureDepotRemoteBuilder": {
      "buildId": "vzr5fpn3cn",
      "buildToken": "REDACTED"
    }
  }
}
DEBUG result image:<nil> error:error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = "transport: authentication handshake failed: EOF"

DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "\nmutation FinishBuild ($input: FinishBuildInput!) {\n\tfinishBuild(input: $input) {\n\t\tid\n\t\tstatus\n\t\twallclockTimeMs\n\t}\n}\n",
  "variables": {
    "input": {
      "appName": "kapybro",
      "buildId": "2497206",
      "builderMeta": {
        "builderType": "depot.dev",
        "buildkitEnabled": false,
        "dockerVersion": "",
        "platform": "",
        "remoteAppName": "",
        "remoteMachineId": ""
      },
      "clientMutationId": "",
      "finalImage": {
        "id": "",
        "sizeBytes": 0,
        "tag": ""
      },
      "logs": "error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = \"transport: authentication handshake failed: EOF\"",
      "machineId": "",
      "status": "failed",
      "strategiesAttempted": [
        {
          "error": "error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = \"transport: authentication handshake failed: EOF\"",
          "note": "",
          "result": "failed",
          "strategy": "depot.dev"
        }
      ],
      "timings": {
        "buildAndPushMs": 301273,
        "buildMs": 301273,
        "builderInitMs": 924,
        "contextBuildMs": -1,
        "imageBuildMs": 301273,
        "pushMs": -1
      }
    }
  },
  "operationName": "FinishBuild"
}

DEBUG {0x14000981710}
DEBUG <-- 200 https://api.fly.io/graphql (520.14ms)

DEBUG {
  "data": {
    "finishBuild": {
      "id": "2497206",
      "status": "failed",
      "wallclockTimeMs": 301706
    }
  }
}

DEBUG Task manager done
DEBUG done monitoring tokens
DEBUG started querying for host issues
DEBUG --> POST https://api.fly.io/graphql

DEBUG {
  "query": "query($appName: String!) { apphostissues:app(name: $appName) { hostIssues { nodes { internalId message createdAt updatedAt } } } }",
  "variables": {
    "appName": "kapybro"
  }
}


DEBUG {}
DEBUG started querying for statuspage incidents
DEBUG <-- 200 https://api.fly.io/graphql (401.21ms)

DEBUG {
  "data": {
    "apphostissues": {
      "hostIssues": {
        "nodes": []
      }
    }
  }
}

DEBUG querying for host issues resulted to []
DEBUG querying for statuspage incidents resulted to &{[]}
Error: failed to fetch an image or build from source: error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = "transport: authentication handshake failed: EOF"

I’m also getting this now:

Error: failed to fetch an image or build from source: error building: timed out connecting to machine: failed to list workers: Unavailable: connection error: desc = "transport: authentication handshake failed: EOF"

Having never gotten it in the past.
Any workarounds?

@cooper, if it’s specifically a Depot glitch, then the above flag should work around it.

Hope this helps!

That worked, thank you.

1 Like

talking to support right now, and they told me they’re fixing this on depot side. I’ll ask them to update this post as well once we get any progress.

This build error almost gave me a heart attack. For those having the problem, try uisng the cli, fly deploy --depot=false . This is a big error on fly part in my opinion. They should say something or notify.