Can I run `arm64` images in railway?
currently image breaks when using arm64
451 Replies
Project ID:
N/A
railway is amd64 only
got it thanks. ipfs which is what I'm using offers amd64 but for some reason it doesn't work. Only arm64 works for me
any plans for arm support?
it's unlikely that railway will support arm
you may want to find out whats going wrong with the amd64 version
why won't railway support arm? I'm very curious. I don't use it all the time (arm) but I would think it's a win to support it
I'll answer that with a question, why should railway support arm?
plenty of reasons one of which is more customers. Apple Silicon machines are extremely common now and arm is much more prevalent now
arm64 is more performant than amd64 (at some cost)
i think
would it be neet? absolutely, is there a great benefit over amd64 from a business perspective, not really
there is
for example myself. You would gain me as a permanent customer
I mean I'm sure there's actually nothing wrong with the ipfs amd64 image
you're right. I haven't yet ran it in railway. Been having problems with it locally in my arm64 machine
so deployment platform requires amd64
local machine requires arm64
wait would you even be able to run ipfs on railway? what protocol does that use
Instances that we have would need to be ARM based which atm, we don't have. Open to it in the future but we are a long way away from that. (Unless we start wrapping Gravitron instances.)
he can read my mind, I was just about to silent ping for your 2 cents
Angelo is just a Brody-alt
I've been caught
but yeah from a quick google search, ipfs does not communicate the data over http, therfore it would not work on railway for public access
Would need to run Ngrok in front of it (assuming it supports IPFS)
I'm running ipfs on railway right now
got it working
amd64
what proxy are you using
i'm using ipfs/kubo implementation
bifrost-gateway
single
index.ts
as proxyGitHub
GitHub - o-az/eyepfs: Hosted IPFS Gateway & HTTP Proxy
Hosted IPFS Gateway & HTTP Proxy. Contribute to o-az/eyepfs development by creating an account on GitHub.
hell ya
railway too good
awsome!
Make this into a Template, you won't
beat me to it
on it right now!
gimme a min
he just won't stop predicting my moves
lmao
it's a template
https://github.com/o-az/eyepfs
GitHub
GitHub - o-az/eyepfs: Hosted IPFS Gateway & HTTP Proxy
Hosted IPFS Gateway & HTTP Proxy. Contribute to o-az/eyepfs development by creating an account on GitHub.
wheres the deploy to railway button
oh you mean railway template
yeah that's what we mean
as well
definitely!
i'm gonna tweet it once i add the button. Can the official railway on twitter rt me <a:wave_bear:1013524488652079254>
above my paygrade but its likely David will
should I name it just ipfs or same as repo name?
I have been banned from tweeting after I said "Go is a employment program for distinguished engineers at Google."
ok so the way I started this is the same way I start all my railway projects:
create project
create empty service
deploy with:
idk how to translate this into the template
but here's the template https://railway.app/template/PhPjgz?referralCode=eD4laT
Railway
Deploy eyepfs on Railway
Railway is an infrastructure platform where you can provision infrastructure, develop with that infrastructure locally, and then deploy to the cloud.
what port does the proxy listen on
damn right
you going to add arm64 support now?
3031
does gcp have arm?
don't know don't care don't wanna know
that's odd since you want railway to have arm, railway runs on gcp
will quit before i use gcp directly again
if gcp doesn't have it, then railway can't have it
yeah and railway hates gcp don't you?
i was hoping you'd be leaving them soon
thanks for abstracting hell away 😹
We are working on racking our own stuff, POPing in GCP for regions and co-lo
then you are missing the PORT variable in your template that tells railway your app listens on 3031, can you deploy your template and work out all the kinks before publishing it?
it's in Dockerfile as ENV. That should works?
i don't have the variable in my personal deployment
Just added it
your index.ts listens on PORT
oh good catch
so no need to add a PORT to the template
but still deploy your template to make sure it works
i do have it locally in
.env
. Does railway grab envs from there when running deploy command?no they don't
.env is only loaded if you copy it into the raw editor or use something like dotenv
i'm slightly confused by the naming
service
in templates. Is that the same service
in a project? or does it refer to project
in templates?the project name is the template name when deployed, the service name is the service name
let's see
i can very likely cut the image size by 60% later
your dockerfile is a little odd
say more
words are hard
you are downloading and installing bun yourself, why not do this in a multistage build with bun's official docker image being one of the stages
i had that originally then i needed go then i just wanted to get it working asap. You're right though multi stage build is the way to go
also, alpine > bullseye
this can have multiple improvements. My main goal is to reduce image size'
i seldom use go tbh so idk what's all out there
has alpine img?
yes they have an alpine image
cool so golang is just like any other language. Why do people hate it?
multistage build, with the last stage being maybe just the default alpine image with only the stuff you need to run copied into it
idk, I love it, it's my main language I use
i was thinking of having last stage be a distroless image
https://github.com/GoogleContainerTools/distroless
grab the minimum necessary executables needed to run stuff and copy them over to the stage
too much work. I'll go for alpine 👍
I use distroless in all my go Dockerfiles, but yeah I thought that would be way overkill for what you are doing given the fact that the base alpine image is under 6mb
there's no shell in distroless and it looks like you will need a shell, alpine provides the sh shell instead of bash
also the
Makefile
is not necessary. I left it as an option for people but maybe it causes more confusionbest to eliminate all points of possible confusion
originally i ran kubo as a docker container and bifrost also as a container but had to switch to this cause no docker compose in railway
but there is internal networking
sounds too technical
it would sound less technical if I could spell it correctly
tell me more about it. If I have a simple project where I'm running 2 docker containers, not using compose let's say, how would i use internal networking?
you could run ipfs separately, then your proxy service on another service, then proxy requests to the ipfs service through the internal network
oh i see, split them into 3 services
3?
ipfs kubo
bifrost-gateway
bun proxy
ah yeah forgot about the gateway
thanks for the info
alright I think it's good as it is right now. Next do the dockerfile improvements next week
so i got the template published: https://railway.app/template/PhPjgz
source code:
https://github.com/o-az/eyepfs
template demo deployed test:
https://api-production-bcc4.up.railway.app/bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
thank you bothGitHub
GitHub - o-az/eyepfs: Hosted IPFS Gateway & HTTP Proxy
Hosted IPFS Gateway & HTTP Proxy. Contribute to o-az/eyepfs development by creating an account on GitHub.
awesome!!
very pog
if only David knew how many people I've converted over to Railway just over the last 12 months. Crazy #
do you want a nice Template code?
i'm actually dumb for not leveraging referral codes
i just saw it's a thing smh
we now do it automatically
fwiw
wym?
you're taking about account referrals not template referrals
yeah ops
i see what you mean @Angelo
idc about template referral
i want that big buck
lemme credit you anyway
one sec
can you get that arm64 thing setup on the way
that is a gigantic ask
massive
it was a joke lol don't need it so far
above your pay grade?
upgrading entire infrastructure. Probably above owner/ceo/chair's paygrade
need vc's signed approval
man time really fast this year. It was more than a year ago that I was here asking many questions while trying to get bun to run on railway
lost in the sauce. Look at everything now. Railway simply became a much smoother and more seamless experience. I can't pin exactly what changed by everything is better
thank ya'll
just consistent dedication to improving the product one week at a time
I'm sort of in the middle of this weeks-lasting discussion w/ a friend comparing railway, fly, render. Specifically which platform can take you from dockerfile to deployed the fastest
don't want to keep taking your time. Thanks a lot
what's your twitter? @ both of you
@ ngeloxyz
I have two followers and I think that's plenty
be ruthless in your feedback
spoiler alert, it's railway
and sometimes it might not be; but we need to be honest where we suck and work hard to improve it
yes! for just dockerfile. Otherwise my answer is it depends on the project
php
we should just give people an FTP server for PHP
zoom the files up, no build
but the thing is 80% of projects just need to run a server so dockerfile + node. In that case objectively railway better
for some other services fly wins
and for some other other services render wins because only render offers those services
More info pls?
i would like to opt out of this upgrade
followed you
we got a bnuch in common lol
that's a neat pfp
tell us why fly wins!?
seriously
what a cliffhanger
1. edge
2. innovations like this: https://fly.io/docs/litefs/
1. Does Edge matter to you?
2. Fair, getting the one of the lead SQLite maintainers gets ya that
a possible 3 though I haven't used it much: Fly Machines - the fact that it lets you use and interact with Firecracker VMs programmatically is amazing
unfortunately yeah. Everything I work on has global users
How much local fidelity do you expect, would just having traffic proxy to the region be good enough?
may you never get liquidated
Base line performance is cloudflare workers. I never use fly/railway or any server if I can use cloudflare workers but sometimes it's just not possible (payloads too large, etc etc.)
fly ends up showing closer performance to cloudflare workers than a railway server
i already did. got rekt, small one thankfully
on the other hand fly has been extremely unreliable at times last 12-16 months
down a bunch of times, randomly upgrading my projects and messing with my config
I'll sacrifice even a whole 1s for reliability
at least when railway is unreliable it's bc of gcp
To be frank, a lot of our issues is with scaling builds
knocking on all pieces of wood
I don't know what that means. "Scaling builds"? Too broad
Meaning, if we do have incidents, its with deploys, not workload availibility.
We'd rather stop builds rather than effect raw workload uptime.
Preferably never any incident.
one annoying thing with railway is the changes to team and project policies. I haven't even looked into it yet but I just now kinda assume I will get an email every now and then telling me structure is changing
or I will try to setup a project with a team and the path I took last time doesn't work anymore3
ooh and lest I forget. Railway nuked my production postgres db about 6 months ago. It was so painful. Still bruised
nuked is the wrong word, more like it stopped working and remained stuck at extremely high resource usage. Worse, wasn't possible to stop it or delete the service & project
I remember... Our DBs falling over were top 10 most frustrating parts of Railway
Thats going to be fixed with DBs2
what's DBs2?
Now DBs will be services backed by volumes
and we will allow you to SSH in
oh no, a whole new class of help requests
there you go
how can i access this? https://docs.railway.app/reference/priority-boarding
trie the
/beta
you are beta
how dare you
I didn't do anything
/beta is how you join
its not out yet
but JR is working on it as we speak
our DBs leave a lot to be desired
we want automatic backups, tuning, and live config
priority boarding. The name gives me airport vibes
never seen it in docs
you board trains too lol
google priority boarding. First results airplane, on page 200 train
skill issue
Amtrak has it!
never ridden a train
never priority boarded a train
missing out fr fr
apparently you can ship your car coast to coast and ride the train? Wish I knew this last year
are you serious? Is it actually a pleasent experience?
brb texting friends
trains? yeah for sure
ok good time to call it. I'll go take my dog out. Will comeback with more feedback about railway. Where is a good channel to post?
#🤗|feedback
A ++++++++++++++ on railway's side. UI is amazing. Great aesthetics. I wish you would make a public npm library of some css / tailwind components
closet thing is https://railway.app/design/forms
Doesn't cut it 😦
i know
Like these icons are fireee
More designer work kinda
Look at that well crafted docker square
why is there a dot on the whale
Angelo did this one
wrong
and you can tell Angelo didn't do this one /j
I did 145
someone else did 141
okay getting funky with figma, i see
the thumbnail for 145 has a template that didn't even exist at that time lol
aspirational
well it exists now 😉
Wow
Can't unsee
Btw did you know you can COPY from a remote image in dockerfile? So basically no need to even install bun. Just COPY bin
Better, you can COPY from a remote git repository
Won't always work obviously but does work in a surprising # of cases
yes I did know those things
Actually I'm wrong I think. Only works with ADD?
yeah I had assumed you meant that
Does railway support nix / any plans?
be more specific
Same way I can deploy apps using dockerfile
I can deploy those apps using nix
Nix can replace docker
https://nixpacks.com/docs
applicable?
dockerfile* railway uses docker whether you use a Dockerfile or nixpacks
@Brody everything is 10x harder in alpine
how so
musl
glibc
those are easily added
also the fact that I'm deving on an arm machine and some of these tools are amd only (bun hard to do in alpine)
i got this working so far:
the missing piece is bun build step. No luck with that
honestly I really think you should take the multi service approach
Totally agree
run ipfs and bitfrost in their own services and then your bun proxy in another
this is definitely not a job for 1 dockerfile
some tips, the rm -f stuff you do after apk add is redundant since you have the no-cache flag.
expose is not necessary, volume also isn't necessary
and for styling,
as
should be capital case, while the image names should be lower caseI do
EXPOSE
for comments purposes just to show intent. I guess not the convention?meh
FROM ipfs/kubo:latest AS kubo_binary
?
do you write sql queries lower case or uppercase?I don't do sql
what do you do
I don't use databases
nice
I'm happier that way
lmao there's an official alpine image https://github.com/oven-sh/bun/blob/main/dockerhub/Dockerfile-alpine
GitHub
bun/dockerhub/Dockerfile-alpine at main · oven-sh/bun
Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one - oven-sh/bun
# Not officially supported (yet)
distroless version toojust use the bun image that's in dockerhub
that;s what i'm doing but i'm checking if i can do bun in alpine so that i can run
bun --compile
to generate a binary. The binary will only be able to run in the same env and distro as the one it was built inwhat's wrong with doing that in buns image
doing
bun --compile
?yeah
nothing. It works there, but if you want to use multistage and copy over the binary to an alpine stage, it won't work
so you'd need all stages be debian
so?
the bun image is only ~100mb
what do you mean so? As in so why not use debian?
whatever the bun image is based on, just use the bun image
it's what I'm doing
just need to remove alpine stuff
rm -rf Dockerfile
vi compose.yml
why was the original message deleted
nvm, discord buggin out
Is there any railway way of adding rate limiter to public service API?
I normally use a redis table for that. Curious if there's any specific tools in railway before I setup redis
there is not, up to your app or cloudflare
also, doesn't that defeat the point??
The point of it is to use it for one's own project only but im thinking of adding rate limiter option if someone wants it for another use case
For my own use case I don't actually need it. Just need ip check and cors config'd
Oof. Too high. I didn't know ipfs took that much
yikes
Tbf I have everything enabled just not exposed
But still too high right?
just ram costs alone would be 10$ /month
Kms
Nice
I'm probably moving the js api part to cloudflare
volume file browser lol
Good job
Despite having 0 volumes I added it
Before I add vols
i hope you read the readme
Yup. It's perfect once I have everything setup
Speed things up
Cause I need to volumes. I haven't added them yey
Yet
Install IPFS Kubo inside Docker | IPFS Docs
You can run IPFS inside Docker to simplify your deployment processes, and horizontally scale your IPFS infrastructure.
Got more nice templates to look at? Not for this project just in general
two volumes for the ipfs and bitfrost services?
just ipfs
you can only have one volume per service
I just learned that literally 5 mins ago
meh who needs an export volume
BUT. It's possible to have just one if you're not planning on uploading files which I don't need
So we good
Is that common? Im volumes rookie
i think multiple volumes per service and multiple volumes attached to multiple services are coming at some point
i dont know lol, just joking around
I literally only swapped the runtime from bun to deno
damn bun used a lot of memory
I've heard about that, bun may be fast, but at the cost of increased memory usage?
i'm sensing deno to be faster here
haha rip bun
does this look leaky?
not many people would want to deploy something that uses 1gb of ram at idle
over that time frame, nah not really, I'd need to see a longer timeframe without any restarts
not fully true. I also reduced Dockerfile and am not doing any build steps inside docker
just grabbing bins now
idk how much that affects memory though
that's not 3 separate services 😦
i have to defeat this boss first
don't worry 3 services are coming soon and deployed to both railway and fly so we can see live 1:1 comparison
finale
pog
I'm trying to figure out now if somehow I can disable ipfs peer connections from using mine
so like 5-8 hours?
at start it was 165 MB now 195 MB
yeah that would give a better idea
this is kinda hilarous
bun wants more
damn
this is the same old one
just looking at it it looks like if there was 2GB it woud've gone for it lmao
there is 8gb
don't tell bun about it pls
lmao
lol what happened there
i think it's just showing past from bun deployment until now
i removed deployment for a few hours
strange there's no dashed line at the cliff
it was on then I off'd it then deployed again
this doesn't look right?
this doesn't look right
3am is 8am?
oops
minor display bug
it's cirrect in other points
post-clif it's off
this is right
all of post-cliff is at 8:28 am until the deployment 30-45mins ago
odd
fun
Massive benefit of fly: serverless containers
https://aws.amazon.com/fargate/
Amazon Web Services, Inc.
Serverless Compute Engine – AWS Fargate – AWS
AWS Fargate is a serverless compute engine for containers that works with both Amazon Elastic Container Service (ECS) and Amazon Elastic Kubernetes (EKS).
the CEO of railway on multiple occasions has poked fun at server less, and I agree with him, why server less when you can just do servers lol
Depends on use case
If you have a site that receives heavy traffic in the morning but very little traffic between 8pm and 5am then fargate is economically saner
The overhead is 100x when running ec2 vs fargate (serverless)
Also fargate economically better for things like cron jobs
meh
ay not bad
boss doesn't like it. Said switch to rust
Go*
GOat
what's the go-to way of converting to go?
just the proxy part that used to use bun?
well, do you know go?
i've written 1 go "app" in the past
https://github.com/o-az/gomark
lol
what's the lightest web framework in go?
either chi or gorilla mux, i recommend chi, but both are 100% stdlib (good thing)
stdlib is the homie
we go way back
the same proxy in go should be sub 20mb in mem
financially irresponsible to not go for it
railway rewards code golfing!
what does that mean?
in a nutshell, write better code, pay less
what's the perfect go project setup? dir structure, linter/formatter, etc.
i am not the one to ask about that lol, i can write go code all day long, but my weak point is structure
@Vin 👀
?
Aren’t you a GO-getter?
Yessum
A Go-od dooer?
A Pokémon-Go-To-The-Polls fiend?
🤨
person above could use some go help is what I’m getting at
slap everything in the single main.go file and call it a day
I joke, but the original code is nearly just index.ts so a nicely formatted single main.go file would be perfectly adequate to be honest
If you’re looking for a decent way to structure go projects, you can check this video out
https://youtu.be/dxPakeBsgl4
Melkey
YouTube
This Is The BEST Way To Structure Your GO Projects
World of Go programming language! 🚀 Whether you're a complete beginner or an experienced developer looking to explore Go, this video has something for everyone.
🔧 Installing Go Lang:
With easy-to-follow instructions, you'll have Go up and running on your machine in no time.
📁 Directory Layout Best Practices:
We discuss the recommended directo...
too long
Not everyone has the attention span of a gopher Brody! 🤣🤣🤣
it's about 11 minutes too long
aka forward request
my go rn
why my comment gets deleted
https
you cant edit links
pseudo code
is it a go convention to short name things?
resp
, err
, w
, r
yes, at least thats how ive always seen it done
chi has its own cors middleware btw
sorry for the wall of code lol
with the help of 4 ai agents
oh, nvm
i take that back then
it's still fast thoguh
though*
not impressed anymore
understandable
that is not an effective method for learning to code imo
my goal here is not to learn code though lol. When I'm trying to learn I don't copy paste
I just need to get this going for now
i dont agree with that approach but oh well
approach pays the bills
but still, chi has its own cors middleware
you have no error checking or validation for the
ALLOW_ORIGINS
variable
instead of a route on the route, just use a groupso better
value, exists := os.LookupEnv(...)
you would want to check if it exists yeah
is the call to ipfsURL always going to be a get call?
yup
whats the purpose of proxing a get request to another get request anyway?
seems redundant?
it's so i can rate limit and only allow myself to call that endpoint
if i call my ipfs directly in a public website then others will see it and be able to call it but if i call my proxy then i can set checks and only allow myself
gotcha
used the chi cors middleware. Much cleaner 👍
Mage :: Mage
Mage
no, that looks silly
it's just a custom makefile
why silly
I looked up
package.json
/ Makefile
equivalent in gowhy needed? want to run the go app?
go run .
job donewhat if you have 10 long scripts, do you memorize all or have a scripts runner?
it's handy
why would you have so many scripts?
Many reasons. Could be a large monorepo for example
this is one example i have, not monorepo
that just looks like a mess, ive never had anything like that in any project
it's extremely common. I'm surprised
messy codebases are common, indeed
that makes it less messy
it's the same as Makefile, been around forever
mess has been around forever*
https://github.com/go-chi/chi/blob/master/Makefile here they have scripts organized same way
GitHub
chi/Makefile at master · go-chi/chi
lightweight, idiomatic and composable router for building Go HTTP services - go-chi/chi
You're saying organizing scripts is messy?
makefile looks messy too
f
bout to
go
ahead and deploy this go applol the puns
no
bun
intended
alpine better but glibc scarywhy do you need a dockerfile for this?
cause kubo is much cleaner this way
and why does the go proxy need the ipfs bin
ipfs has to run and I proxy requests through go server
weren't you gonna run ipfs in another service?
this works why need another service
this way messy
i reduced # of services now just 2
that's a tiny dockerfile
you could do no dockerfile, with 3 services
in compose?
no, railway doesnt support compose
that seems messy
Dockerfile global standard
youre funny
response time
429.229389ms
for?
4ms!
well yeah of course a request across the internet is going to take longer than a request to localhost
it was the same exact request
first time 400ms then it got cached
oh
cache is cool
HTTP/1.1
cache invalidation is messy
yellow
I keep making it worse
Better Go Playground
Better Go Playground with syntax highlight support
😍
haha
os.Environ()
what's up with the shorthands. Don't like itwhat should it be
os.Environment()
meh it's incredibly inconsequential
When I first started coding I was so confused with
req
and res
, e
, etc.
https://github.com/sindresorhus/eslint-plugin-unicorn/blob/main/docs/rules/prevent-abbreviations.mdit's okay you use AI anyway
boom roasted
multistage build ftw
-10MB with alpine
so when are you gonna do 3 services
i'm gonna host on fly first to see what's better
you could then run the go service in a distroless image
fly
what does this show lol
that it works
when i switched to go railway don't work
that's because you didn't read the docs 😉
https://docs.railway.app/troubleshoot/fixing-common-errors#go--nethttp
I knew this from past experience but didn't use the provided solution
I did
yikes
yikes
🙂
I will say, it's kind dumb how go doesn't have an standard function for environmental variable fallback like every other language does
undefined: envPortOrcompilerUndeclaredName
i'm importing net/http already
where did you put that function?
in the example in the doc, it's just under the main() function
that's what i have too
show code please
I don't see a
envPortOr
function?smh
i thought it's a built in lmao
i see now
pls add syntax highlight for rookies like me
above my pay grade
jokes, I don't actually know how
whatever static site generator or tool you're using for the docs should have syntax highlight
actually already does
yeah it just doesn't have highlighting for golang
maybe this needs
go
in beginningyou don't think I did that lmao?
no otherwise there would be rainbow
wild. So it has syntax highlight for node but not go?
disrespectful
https://raw.githubusercontent.com/railwayapp/docs/main/src/docs/troubleshoot/fixing-common-errors.md
the codeblock is tagged with
go
damn so the tool sucks
personally I wouldn't let that one slide
like i said, above my paygrade
sure
you are welcome to pr it though!
👀
while youre at it, add in styling for single backtick code blocks
what's missing there?
fixed: just share github link https://github.com/railwayapp/docs/blob/main/src/docs/troubleshoot/fixing-common-errors.md
Go /
net/http
see, single backtick codeblockthis is next contentlayer by default. It adds the extra backtick
well pr it to format the codeblock properly 🙂
the single backtick? It's supposedly desirable
personally I wouldn't use nextjs
what would you use? whatever chat gpt recommends?
sorry, i couldnt help it
vitepress https://vitepress.dev/
VitePress
VitePress | Vite & Vue Powered Static Site Generator
Vite & Vue powered static site generator.
can vitepress do ssr?
don't need that for docs
railways docs has server side features that use prisma
yes
it's vue btw. Doubt your team will accept not using react
i think ive told you this before, but i dont work for railway
I don't remember. Did you?
I don't think you did
you did
https://discord.com/channels/713503345364697088/1139335435982741534/1139357413942771733
not to me though
close enough
now that both fly and railway deployed, I think I prefer railway. Pending more tests
thats the spirit
does this show railway is faster?
3x
look @ last line
wow fly slow
"fly"
well, where is flys server located relative to you?
same town
good point!
it's even slower than what I thought
fly is in the same city
i assume you dont live near oregon though?
(gcp us-west1)
sea
i'm currently as close as physically possible to the fly server
where's the railway serveroregon
us-west1
close
fly uses aws right?
don't know
also fly app sleeps every like 20 seconds
i tried to tell you serverless aint it
ive tried to tell you a few things
i'm deploying to aws next
like just an ec2 or lightsail instance?
ec2
lightsail > ec2
i'll check it out!'