Skip to content

Commit 1f4fc05

Browse files
feat(liveliness): adding liveliness probe (#7)
1 parent fbe74f9 commit 1f4fc05

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed

Dockerfile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,11 @@ ADD entrypoint.sh /entrypoint.sh
5050
ADD create_ca_cert.sh /create_ca_cert.sh
5151
RUN chmod +x /create_ca_cert.sh /entrypoint.sh
5252

53+
# Add Liveliness Probe script for CoreWeave
54+
RUN apk --no-cache add curl
55+
ADD liveliness.sh /liveliness.sh
56+
RUN chmod +x /liveliness.sh
57+
5358
# Clients should only use 3128, not anything else.
5459
EXPOSE 3128
5560

liveliness.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
3+
IFS=', '
4+
5+
read -r -a repos <<< "$LIVELINESS_REPOS"
6+
7+
for i in "${repos[@]}"
8+
do
9+
echo "repo $i liveliness check..."
10+
response=$(curl --head -w '%{http_code}' -o /dev/null -s -k -x http://127.0.0.1:3128 "$i")
11+
if [ "$response" -ne 200 ]; then
12+
echo "failed curl for repo $i"
13+
exit 1
14+
fi
15+
done

0 commit comments

Comments
 (0)