Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 3 additions & 9 deletions docker/server/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,9 @@ if [[ -z "${LITESTREAM_REPLICA_URL}" ]]; then
exec dstack server --host 0.0.0.0
else
if [[ ! -f "$DB_PATH" ]]; then
echo "Attempting Litestream restore..."
if ! output=$(litestream restore -o "$DB_PATH" "$LITESTREAM_REPLICA_URL" 2>&1); then
if echo "$output" | grep -qiE "cannot calc restore plan"; then
echo "No replica snapshots found; starting with empty database."
else
echo "$output" >&2
exit 1
fi
fi
echo "Starting db restore"
litestream restore -if-replica-exists -o "$DB_PATH" "$LITESTREAM_REPLICA_URL"
echo "Finished db restore"
fi
exec litestream replicate -exec "dstack server --host 0.0.0.0" "$DB_PATH" "$LITESTREAM_REPLICA_URL"
fi
4 changes: 2 additions & 2 deletions docker/server/release/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

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

ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
Expand Down
4 changes: 2 additions & 2 deletions docker/server/stgn/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*

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

ADD https://astral.sh/uv/install.sh /uv-installer.sh
RUN sh /uv-installer.sh && rm /uv-installer.sh
Expand Down
Loading