R
Railway14mo 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
Percy14mo ago
Project ID: 120b5ec5-59d8-4087-84ae-4e0b3d934aa7
johns
johnsOP14mo ago
120b5ec5-59d8-4087-84ae-4e0b3d934aa7 Pretty standard k8 feature but I couldn't find it
Brody
Brody14mo ago
there is not, railway also does not use k8s
johns
johnsOP14mo ago
I see
Brody
Brody14mo ago
you would need to have your app wait for the other service to come online
johns
johnsOP14mo ago
With a start script or something right? I see
Brody
Brody14mo ago
what kind of service do you need to be online first?
johns
johnsOP14mo ago
The Datadog client
Brody
Brody14mo ago
you can just wait on a dial conn then once that connects you start your app
johns
johnsOP14mo 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
Brody14mo ago
there definitely exists such a thing
johns
johnsOP14mo ago
So for us it's datadog.railway.internal - is there a cli command that loops to check if it exists
Brody
Brody14mo ago
thats a google question
johns
johnsOP14mo 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
Brody14mo ago
looks like it does what you want
Want results from more Discord servers?
Add your server