Skip to content

fix(examples/init-example): pin Railway build to local Dockerfile#522

Merged
AbirAbbas merged 1 commit intomainfrom
fix/railway-init-example-config
May 3, 2026
Merged

fix(examples/init-example): pin Railway build to local Dockerfile#522
AbirAbbas merged 1 commit intomainfrom
fix/railway-init-example-config

Conversation

@AbirAbbas
Copy link
Copy Markdown
Contributor

Summary

  • The Railway "example node" service in the github-buddy project (rootDirectory examples/ts-node-examples/init-example/) has been failing on every deploy with failed to compute cache key: "/control-plane/web/client": not found.
  • Root cause: with no railway config inside the example dir, Railway falls back to the repo-root railway.json, which builds deployments/docker/Dockerfile.control-plane. That Dockerfile expects the repo root as its build context (COPY control-plane/web/client/...), but Railway scopes the context to the service's rootDirectory — where control-plane/ doesn't exist.
  • Fix: drop a local railway.json into the example pinning the build to the local Dockerfile (the simple node:20-alpine + npm start image already in the directory). This decouples the agent example from the control-plane template config.

Test plan

  • Trigger a Railway deploy of the example node service in github-buddy against this branch and confirm the build uses examples/ts-node-examples/init-example/Dockerfile and succeeds.
  • Confirm the agent comes up healthy and registers with the control plane.

The Railway "example node" service deploys with rootDirectory set to
examples/ts-node-examples/init-example/. With no local railway.json,
Railway falls back to the repo-root /railway.json, which targets
deployments/docker/Dockerfile.control-plane. That Dockerfile expects
the repo root as build context (it COPYs control-plane/web/client/...),
but the build context here is the example dir, so the build fails with:

    failed to compute cache key: "/control-plane/web/client": not found

Add an example-local railway.json that pins the build to the existing
Dockerfile in this directory, so the example builds as the simple Node
agent it is and is no longer coupled to the control-plane template
config.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@AbirAbbas AbirAbbas requested a review from a team as a code owner May 3, 2026 22:55
@AbirAbbas AbirAbbas merged commit 9fb4315 into main May 3, 2026
16 checks passed
@AbirAbbas AbirAbbas deleted the fix/railway-init-example-config branch May 3, 2026 23:01
AbirAbbas added a commit that referenced this pull request May 3, 2026
…#523)

* fix(railway): remove dead repo-root railway.json

Every Railway template that ships AgentField (controlplane-template,
sec-af, swe-af, contract-af, cloudsecurity-af, agentfield-deep-research)
deploys the control plane via the prebuilt image
agentfield/control-plane:latest, not by building this repo. No live
service in the workspace builds the agentfield repo as a control plane,
and deployments/railway/README.md documents image-based deploys only.

This file was a leftover from before the switchover to prebuilt images.
Worse, it actively breaks any service that points at a sub-path of the
repo via rootDirectory: Railway falls back to /railway.json, finds
"dockerfilePath: deployments/docker/Dockerfile.control-plane", and tries
to build the control plane Dockerfile against the sub-path's context —
which has no control-plane/ directory, so the first COPY fails with:

    failed to compute cache key: "/control-plane/web/client": not found

That's exactly what the controlplane-template's "example node" service
(rootDirectory /examples/ts-node-examples/init-example) hit on every
fresh template instantiation since PR #151. With this file gone Railway
falls through to auto-detecting the local Dockerfile in the service's
rootDirectory, which is what the example was always meant to use.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

* chore(examples/init-example): drop now-redundant railway.json

Added in #522 as a defensive override against the dead repo-root
railway.json. With that root file removed in the previous commit,
Railway auto-detects the local Dockerfile in the service's rootDirectory
on its own, so this per-example config is dead weight too.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant