feat(railway): Project, Service, Postgres, Redis, Bucket, and bindings - #1295
Open
sam-goodwin wants to merge 11 commits into
Open
feat(railway): Project, Service, Postgres, Redis, Bucket, and bindings#1295sam-goodwin wants to merge 11 commits into
sam-goodwin wants to merge 11 commits into
Conversation
Railway is one GraphQL service. Call @distilled.cloud/railway directly — no ./railway subpath.
Railway allows one project create per workspace every 30 seconds. Concurrent stacks were racing that and failing as RailwayRateLimited. Hold a process slot, retry the typed tag, and wait out the window after a success.
Project, Environment, Variable, Volume, Postgres, Redis, Bucket, TcpProxy, image Service, Effect Api + Worker, and every binding (ConnectPostgres, ReadWriteRedis, S3, MountVolume). CustomDomain when RAILWAY_TEST_DOMAIN is set.
loginSession*, privateNetworkEndpoint, audit-log scalars, usage limits, volume-backup lock, canvas merge, and empty-token auth.
…atalog Canvas Functions, GitHub source/healthcheck/replicas on Service, MySQL and Mongo with Connect* bindings, named private networks, Groups, Templates, Sandboxes, Cloud Agents, UsageLimit, VolumeBackup, oauth login sessions, audit logs, and Railway.ref variable templates.
Railway.Function is a Platform like Service: class + main + fetch, no registry. Canvas source/cron stays. Live tests cover both.
Pull RESP + makeRead/makeWrite/makeReadWrite into alchemy/Redis so Fly and Railway bindings do not duplicate the runtime client.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Railway provider. Auth is
RAILWAY_API_TOKENoralchemy login(oauthCLI pairing). Resource-valued props acceptT | Effect<T, never, Providers>. Depends on distilled #472.A Project is a workspace-scoped namespace. A Service is a container — a public image, a GitHub repo, or an Effect program Alchemy bundles and pushes. A Function is an Effect program on the canvas Bun runtime (no Docker, no registry). Postgres, MySQL, Mongo, Redis, Volumes, Variables, and Buckets live in the same TypeScript program.
providers
Project
site.urlishttps://railway.com/project/{projectId}. Production issite.environmentId— do not recreate it as an Environment.Environment
Service
api.urlishttps://{name}.up.railway.app.api.dnsNameis{name}.railway.internal. Effect-native images are pushed toregistry— Railway has no private registry of its own.replicasmay be a count or a per-region map.Function
Canvas Bun runtime. No Docker. No registry. Cap is 96KB. Distinct from
Service({ main, registry }).Postgres
Private hostname is
{name}.railway.internal.public(defaulttrue) creates a TCP proxy;publicConnectionUriis for laptop access and deploy-time migrations.ConnectPostgres
MySQL
Official
mysql:9image, volume at/var/lib/mysql, optional TCP proxy. Private URI is{name}.railway.internal:3306. AliasRailway.mysql.ConnectMySQL
Mongo
Official
mongo:8, volume at/data/db, IPv6 bind for{name}.railway.internal. AliasRailway.Mongo.ConnectMongo
pingMongo
Redis
ReadRedis
Provide
Railway.ReadRedisHttp.WriteRedis
Provide
Railway.WriteRedisHttp.ReadWriteRedis
alchemy/Redis
Fly and Railway
ReadWriteRedisshare this RESP client. Error tags areRedis.UrlMissing/Redis.CommandError.Bucket
S3-compatible. Region defaults to
sjc. Changingproject,environment, orregionreplaces the Bucket.PutObject
Provide
Railway.PutObjectHttp.GetObject
Provide
Railway.GetObjectHttp.HeadObject
Provide
Railway.HeadObjectHttp.ListObjectsV2
Provide
Railway.ListObjectsV2Http.DeleteObject
Provide
Railway.DeleteObjectHttp.Volume
MountVolume
VolumeBackup
Pro-plan. Snapshot of a mounted volume instance.
lockis one-way.schedulesis instance state (DAILY/WEEKLY/MONTHLY).restoreVolumeBackup
Destructive to the live volume instance.
restoreVolumePITR
Forks a new Postgres service from a point-in-time archive. Source stays online.
Variable
Config.redactedin a Service is for deploy-time.env. UseRailway.Variablewhen Railway should own a shared value. Plaintext is never stored in attributes.ref
Railway template (
${{Service.KEY}}/${{shared.NAME}}). Not a resolved URI.TcpProxy
Public endpoint is
{domain}:{proxyPort}on*.proxy.rlwy.net.CustomDomain
Point DNS at
verificationDnsHost/verificationToken. HTTP Services already get a generated*.up.railway.appdomain.PrivateNetwork
Named mesh in an environment. Destroy is a no-op — Railway has no per-network delete.
PrivateNetworkEndpoint
Per-service DNS name on a named network.
nameis the prefix ({name}.{network.dnsName}).Group
Canvas group. Writes
EnvironmentConfig.groupsviaenvironmentPatchCommit.Template
Deploys a marketplace template (
postgres, UUID, …). Omitprojectand Alchemy creates an owned one.Sandbox
Ephemeral Linux VM. Priority Boarding. No in-place update.
execSandbox
heartbeatSandbox
createSandboxCheckpoint
listSandboxCheckpoints
renameSandboxCheckpoint
deleteSandboxCheckpoint
Exec
Runtime binding. Provide
Railway.ExecHttp. From tests preferexecSandbox.CloudAgent
Persistent coding-agent VM. Priority Boarding. Changing
nameorenvironmentreplaces the disk.sleepCloudAgent
Stops compute billing. Disk stays.
wakeCloudAgent
Re-runs the entrypoint with files in place.
UsageLimit
Soft/hard dollar cap on the workspace customer.
usage
estimatedUsage
Catalog
listAuditLogs
Query-only. One page; default 50.
getAuditLog
listAuditLogEventTypes
loginSessionUrl
Pairing URL for
railway login --browserless.alchemy loginwithmethod: "oauth"runs this flow.