R
Railway11mo ago
johns

Deployment order

Is there a way to configure a deployment order so that service A only starts when service B has started and is healthy?
15 Replies
Percy
Percy11mo ago
Project ID: 120b5ec5-59d8-4087-84ae-4e0b3d934aa7
johns
johns11mo ago
120b5ec5-59d8-4087-84ae-4e0b3d934aa7 Pretty standard k8 feature but I couldn't find it
Brody
Brody11mo ago
there is not, railway also does not use k8s
johns
johns11mo ago
I see
Brody
Brody11mo ago
you would need to have your app wait for the other service to come online
johns
johns11mo ago
With a start script or something right? I see
Brody
Brody11mo ago
what kind of service do you need to be online first?
johns
johns11mo ago
The Datadog client
Brody
Brody11mo ago
you can just wait on a dial conn then once that connects you start your app
johns
johns11mo ago
It would be nice if there's a util function that takes the internal host name as argument and checks for that I mean I'll have to write it but if it was provided somewhere haha It's just annoying to keep track of the correct api for IPV6 UDP
Brody
Brody11mo ago
there definitely exists such a thing
johns
johns11mo ago
So for us it's datadog.railway.internal - is there a cli command that loops to check if it exists
Brody
Brody11mo ago
thats a google question
johns
johns11mo ago
while true; do
ping6 -c 1 datadog.railway.internal &> /dev/null
if [ $? -eq 0 ]; then
echo "Successfully connected!"
break
else
echo "Attempting to connect..."
sleep 5 # Sleep for 5 seconds before retrying
fi
done
while true; do
ping6 -c 1 datadog.railway.internal &> /dev/null
if [ $? -eq 0 ]; then
echo "Successfully connected!"
break
else
echo "Attempting to connect..."
sleep 5 # Sleep for 5 seconds before retrying
fi
done
Brody
Brody11mo ago
looks like it does what you want
Want results from more Discord servers?
Add your server