Railway and Circle CI deployment

siimarmattias
HOBBY

8 months ago

Hey Community,

I am trying to deploy an ML model using Railway and Cricle CI. When running my app with Circle CI it stops and asks me to select a Railway service and log in to Railway but I cannot do that. I have set Railway token to Circle CI environment variable. How to make to process automatic? In Circle CI i have used Railway token and environment variable.

In Circle CI I am asked to select a service but I cannot select it there. It needs to be automatic.

I have tried two commands:

command: | cd section-07-ci-and-publishing/house-prices-api && railway up --detach

command: | cd section-08-deploying-with-containers && railway link -p radiant-generosity -s triumphant-insight && railway up --detach

15 Replies

siimarmattias
HOBBY

8 months ago

The errors i get:

? Select a service to deploy to

Too long with no output (exceeded 10m0s): context deadline exceeded

Unauthorized. Please login with railway login

Exited with code exit status 1


siimarmattias
HOBBY

8 months ago

Here is the terminal that shows up

Attachments


8 months ago

Please check out railway up --help

You need to specify a service Id with the --service flag.

The command would be -

railway up --service <service_id>

You can get the service Id by opening the desired service in the Railway dashboard and copying it from the URL - /service/<service_id>


siimarmattias
HOBBY

8 months ago

So the command should be

railway --service 7181fa1b-bb29-4d56-a1c2-dc09f0ea### (my service)?


siimarmattias
HOBBY

8 months ago

When i specify the service like this:

command: | cd section-08-deploying-with-containers && railway link -p radiant-generosity -s triumphant-insight && railway up --detach

then i get that i need to log in. Attaching an error

Attachments


8 months ago

Per my previous message, the command would be -

railway up --service <service_id>


siimarmattias
HOBBY

8 months ago

Thank you will try it out. How can I resolve the log in error when i have added railway_token to circle ci variables?


8 months ago

If you're being asked to login then you have likely specified the wrong variable, specified it incorrectly, or something along those lines.


siimarmattias
HOBBY

8 months ago

Okay. When i run locally railway up --service 7181fa1b-bb29-4d56-a1c2-dc09f0eae### in terminal then i get the error:

No linked project found. Run railway link to connect to a project, and a service.


8 months ago

Locally you would want to login via railway login and link with railway link

Please check out railway --help


siimarmattias
HOBBY

8 months ago

I am logged in and i have checked out the help option but have not been able to get passed that unfortunately. I do not know why i have to link the project and not get away with --service


8 months ago

Locally you use the link command, in CI environments you use a project token and the service flag.

What CLI version are you using locally? make sure it's the latest.


siimarmattias
HOBBY

8 months ago

I am using railwayapp 3.18.0


siimarmattias
HOBBY

8 months ago

Thank you for the help. Unfortunately there is not much information how Railway and Circle CI work togather


8 months ago

Exact same way as how it works in GitHub actions, specify a project token and use the commands I had previously given.

https://blog.railway.com/p/github-actions

https://docs.railway.com/guides/cli#project-tokens