R
Railwayscutifer

How can I include two executables?

My NodeJS project needs Deno as well (to execute customer code in a sandbox). I can write a Dockerfile to use the node image and bring in the Deno executable, but I was wondering if this can be done in the dashboard, or in via a Nixpack config change? Here's the railway.json so far
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": [
"...",
"deno"
]
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": [
"...",
"deno"
]
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
Project ID: ac35f6d4-75b3-485b-9991-499bf2b68d3b
P
Percy15d ago
Project ID: ac35f6d4-75b3-485b-9991-499bf2b68d3b
B
Brody15d ago
try this -
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": [
"...",
"deno"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"nixPkgs": [
"...",
"deno"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
S
scutifer15d ago
Thanks. I see a build failure with this though. There's a conflict with the Deno executable. See this output.
╔════════════ Nixpacks v1.21.2 ═══════════╗
deno:setup │ deno ║
║─────────────────────────────────────────║
setup │ nodejs_18, npm-9_x, deno ║
║─────────────────────────────────────────║
install │ npm ci ║
║─────────────────────────────────────────║
build │ npm run build ║
║─────────────────────────────────────────║
start │ HOST=0.0.0.0 npm run start ║
╚═════════════════════════════════════════╝
...snip...

#10 19.09 these 6 derivations will be built:
#10 19.09 /nix/store/csb3sqga2w44j1a6n464hwslys7xkzx7-npm-9.9.3.tgz.drv
#10 19.09 /nix/store/76ym75lx9mg386lmzg605rmgpk708k4z-npm.drv
#10 19.09 /nix/store/fffnygd90xk1ymy1xd7iw89gbw8sk5jx-builder.pl.drv
#10 19.09 /nix/store/lqd25firjmxvr7w1s20njzc5mb2clqq5-libraries.drv
#10 19.09 /nix/store/ya3rlp59328vqal7m4i6z0xm57lqakjq-bf744fe90419885eefced41b3e5ae442d732712d-env.drv
#10 19.09 /nix/store/rl1bzh4c4qalvgyng83rv0i45bid2r6c-bf744fe90419885eefced41b3e5ae442d732712d-env.drv

#10 19.09 these 82 paths will be fetched (133.98 MiB download, 607.88 MiB unpacked):
...snip...
#10 19.09 /nix/store/1dsk5j6cl0x1p1fhqs5ags1qdc51hraj-deno-1.38.0
...snip...
#10 19.09 /nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2

...snip...

#10 28.34 error: Unable to build profile. There is a conflict for the following files:
#10 28.34
#10 28.34 /nix/store/4ky0adziza8yy3xpq97jp17hqdgrgi60-deno-1.36.0/bin/deno
#10 28.34 /nix/store/gkr76pzx9c4d125kf81sghpflxv177x8-bf744fe90419885eefced41b3e5ae442d732712d-env/bin/deno
#10 28.41 error: builder for '/nix/store/zk8qlm7iih7vcgbq3afdybxi4d9qyw9k-user-environment.drv' failed with exit code 1
╔════════════ Nixpacks v1.21.2 ═══════════╗
deno:setup │ deno ║
║─────────────────────────────────────────║
setup │ nodejs_18, npm-9_x, deno ║
║─────────────────────────────────────────║
install │ npm ci ║
║─────────────────────────────────────────║
build │ npm run build ║
║─────────────────────────────────────────║
start │ HOST=0.0.0.0 npm run start ║
╚═════════════════════════════════════════╝
...snip...

#10 19.09 these 6 derivations will be built:
#10 19.09 /nix/store/csb3sqga2w44j1a6n464hwslys7xkzx7-npm-9.9.3.tgz.drv
#10 19.09 /nix/store/76ym75lx9mg386lmzg605rmgpk708k4z-npm.drv
#10 19.09 /nix/store/fffnygd90xk1ymy1xd7iw89gbw8sk5jx-builder.pl.drv
#10 19.09 /nix/store/lqd25firjmxvr7w1s20njzc5mb2clqq5-libraries.drv
#10 19.09 /nix/store/ya3rlp59328vqal7m4i6z0xm57lqakjq-bf744fe90419885eefced41b3e5ae442d732712d-env.drv
#10 19.09 /nix/store/rl1bzh4c4qalvgyng83rv0i45bid2r6c-bf744fe90419885eefced41b3e5ae442d732712d-env.drv

#10 19.09 these 82 paths will be fetched (133.98 MiB download, 607.88 MiB unpacked):
...snip...
#10 19.09 /nix/store/1dsk5j6cl0x1p1fhqs5ags1qdc51hraj-deno-1.38.0
...snip...
#10 19.09 /nix/store/5l687mklyr9rhhbvvpvi93zv0zbbi4vg-nodejs-18.18.2

...snip...

#10 28.34 error: Unable to build profile. There is a conflict for the following files:
#10 28.34
#10 28.34 /nix/store/4ky0adziza8yy3xpq97jp17hqdgrgi60-deno-1.36.0/bin/deno
#10 28.34 /nix/store/gkr76pzx9c4d125kf81sghpflxv177x8-bf744fe90419885eefced41b3e5ae442d732712d-env/bin/deno
#10 28.41 error: builder for '/nix/store/zk8qlm7iih7vcgbq3afdybxi4d9qyw9k-user-environment.drv' failed with exit code 1
B
Brody15d ago
i have updated this, please try again
S
scutifer15d ago
I'll try this, thanks. Alternatively, can we add an equivalent of the following into the JSON?
[phases.install]
cmds=["...", "curl -fsSL https://deno.land/install.sh | sh"]
[phases.install]
cmds=["...", "curl -fsSL https://deno.land/install.sh | sh"]
B
Brody15d ago
you can do something like that, but not in the install phase, that also uses incorrect syntax afaik
S
scutifer15d ago
I tried the cmd thing and it worked well! Here's the JSON if someone else needs it.
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"aptPkgs": ["...", "unzip"],
"cmds": [
"...",
"curl -fsSL https://deno.land/install.sh | sh"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
{
"$schema": "https://schema.up.railway.app/railway.schema.json",
"build": {
"builder": "NIXPACKS",
"buildCommand": "npm run build",
"nixpacksPlan": {
"providers": ["node"],
"phases": {
"setup": {
"aptPkgs": ["...", "unzip"],
"cmds": [
"...",
"curl -fsSL https://deno.land/install.sh | sh"
]
}
}
}
},
"deploy": {
"numReplicas": 1,
"startCommand": "HOST=0.0.0.0 npm run start",
"sleepApplication": false,
"restartPolicyType": "ON_FAILURE",
"restartPolicyMaxRetries": 10
}
}
B
Brody15d ago
did the latest railway.json i gave not work?
S
scutifer15d ago
it didn't; it had the same error i.e conflicting Deno version dependencies
B
Brody15d ago
can you send the build logs from it
S
scutifer15d ago
yes, here it is
S
scutifer15d ago
B
Brody15d ago
interesting
Want results from more Discord servers?
Add your server
More Posts
Possible Security Attack RedisHi, my redis is showing this logs: Possible SECURITY ATTACK detected. It looks like somebody is sendHow to support both grpc and http for a railway service?I'm trying to set up weaviate on railway. Since their migration to the v4 client, I cannot instantiaInstalling dependencies for sub directoriesMy project have this structure ``` root/ ├── client/ (React app) | ├── .env | ├── .paFetching a file hosted on Filebrowser via Private NetworkSo I currently have a file that I am hosting using Filebrowser template. The file has a download lierror 13when i run "railway up" in the terminal of my project it says Permission denied (os error 13)Transferring a service from one project to anotherHow Can i transfer a service from a project to another project. it's a mysql database so i can't reIssue when deploying node app using dockerI'm having issues when I'm trying to deploy a node app with docker, when I build and run the image lFastAPI service health-check fails in IPV6I'm running a fastAPI service in railway. I setup a `/healthcheck` endpoint. It worked well when I eServer Response too slowI have Django, React application live on railway. I'm using Hobby plan. whenever I click through pDown only in DubaiHi Railway, Starting around 7.30 PM UTC +4, we can’t access our production instances. The URL is zeApplying chance is persistingI have this popup constantly appearing, even though nothing is being updated / changed. Anyway to geMySQL Memory UsageHey there, we just migrated to Railway and in the last 24h I saw that the memory usage is consistentRailway crashed after errors on trycatch?Is there any parameter to change in Railway so that it doesn't crash? because I'm using a trycatch tRailway having trouble connecting to local db upon deploymentHi. I recently deployed my node.js app on Railway and found out that during startup of my node.js apRedeploying service doesnt use updated Source Repo URLHi im new to railway so maybe this is a misunderstanding. I have started a project using a template rust deploy uses 10x more ram than local devhey guys, i have a rust api that is using 4-8gb of ram suddenly, now for rust that's unheard of conUnique variables for replicasHow can I assign a different token environment variable to each replica? Or have the replicas chooseDelete Strapi build and .cache foldersHello, how can I get a list of files in my railway project? I tried the command `railway run ls` buUnable to add repository to service that I'm a collaborator onI'm a collaborator on a github repo, and I'm trying to deploy a service on railway using that repo. Deploy angular project on RailwayI have angular project which I can build and run on my local machine perfectly. here is the link of