Skip to content

Commit 03888c8

Browse files
Andrey Cheptsovclaude
andcommitted
Upgrade litestream 0.5.0 to 0.5.9 and simplify entrypoint restore logic
Litestream 0.5.9 reduces Go dependency CVEs from 24 to 7. The entrypoint now uses `restore -if-replica-exists` instead of parsing error messages, consistent with the enterprise entrypoint and resilient to future litestream error message changes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 18f52c3 commit 03888c8

3 files changed

Lines changed: 7 additions & 13 deletions

File tree

docker/server/entrypoint.sh

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,9 @@ if [[ -z "${LITESTREAM_REPLICA_URL}" ]]; then
1313
exec dstack server --host 0.0.0.0
1414
else
1515
if [[ ! -f "$DB_PATH" ]]; then
16-
echo "Attempting Litestream restore..."
17-
if ! output=$(litestream restore -o "$DB_PATH" "$LITESTREAM_REPLICA_URL" 2>&1); then
18-
if echo "$output" | grep -qiE "cannot calc restore plan"; then
19-
echo "No replica snapshots found; starting with empty database."
20-
else
21-
echo "$output" >&2
22-
exit 1
23-
fi
24-
fi
16+
echo "Starting db restore"
17+
litestream restore -if-replica-exists -o "$DB_PATH" "$LITESTREAM_REPLICA_URL"
18+
echo "Finished db restore"
2519
fi
2620
exec litestream replicate -exec "dstack server --host 0.0.0.0" "$DB_PATH" "$LITESTREAM_REPLICA_URL"
2721
fi

docker/server/release/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ RUN apt-get update && apt-get install -y \
1515
&& rm -rf /var/lib/apt/lists/*
1616

1717
RUN if [ $(uname -m) = "aarch64" ]; then ARCH="arm64"; else ARCH="x86_64"; fi && \
18-
curl https://github.com/benbjohnson/litestream/releases/download/v0.5.0/litestream-0.5.0-linux-$ARCH.deb -O -L && \
19-
dpkg -i litestream-0.5.0-linux-$ARCH.deb
18+
curl https://github.com/benbjohnson/litestream/releases/download/v0.5.9/litestream-0.5.9-linux-$ARCH.deb -O -L && \
19+
dpkg -i litestream-0.5.9-linux-$ARCH.deb
2020

2121
ADD https://astral.sh/uv/install.sh /uv-installer.sh
2222
RUN sh /uv-installer.sh && rm /uv-installer.sh

docker/server/stgn/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ RUN apt-get update && apt-get install -y \
1313
&& rm -rf /var/lib/apt/lists/*
1414

1515
RUN if [ $(uname -m) = "aarch64" ]; then ARCH="arm64"; else ARCH="x86_64"; fi && \
16-
curl https://github.com/benbjohnson/litestream/releases/download/v0.5.0/litestream-0.5.0-linux-$ARCH.deb -O -L && \
17-
dpkg -i litestream-0.5.0-linux-$ARCH.deb
16+
curl https://github.com/benbjohnson/litestream/releases/download/v0.5.9/litestream-0.5.9-linux-$ARCH.deb -O -L && \
17+
dpkg -i litestream-0.5.9-linux-$ARCH.deb
1818

1919
ADD https://astral.sh/uv/install.sh /uv-installer.sh
2020
RUN sh /uv-installer.sh && rm /uv-installer.sh

0 commit comments

Comments
 (0)