llm, have the Docker-based services fork their background update checker and make it a loop.
This commit is contained in:
1 parent
855cffc64d
commit
5e0b5fb4d2
1 file changed
+34
-16
@@ -419,21 +419,29 @@
|
|||||||
# Ensure the old container is gone.
|
# Ensure the old container is gone.
|
||||||
echo "RUN: Stopping..."
|
echo "RUN: Stopping..."
|
||||||
docker stop open-webui &&
|
docker stop open-webui &&
|
||||||
echo "RUN: Container stopped" ||
|
echo "RUN: Container stopped." ||
|
||||||
echo "RUN: Container already stopped."
|
echo "RUN: Container already stopped."
|
||||||
echo "RUN: Deleting..."
|
echo "RUN: Deleting..."
|
||||||
docker rm -f open-webui &&
|
docker rm -f open-webui &&
|
||||||
echo "RUN: Container deleted" ||
|
echo "RUN: Container deleted." ||
|
||||||
echo "RUN: Container already deleted."
|
echo "RUN: Container already deleted."
|
||||||
|
|
||||||
# Check for any new updates in background.
|
# Check for any new updates in the background.
|
||||||
sleep 300 &&
|
(
|
||||||
echo "RUN: Updating..." &&
|
while true; do
|
||||||
docker pull $image &
|
sleep 600
|
||||||
|
echo "RUN: Checking for updates..."
|
||||||
|
docker pull $image
|
||||||
|
done
|
||||||
|
) &
|
||||||
|
LOOP_PID=$!
|
||||||
|
|
||||||
|
# Ensure cleanup on any exit (normal or signal from runit).
|
||||||
|
trap 'kill "$LOOP_PID" 2>/dev/null; wait "$LOOP_PID" 2>/dev/null' EXIT
|
||||||
|
|
||||||
# Start the open-webui program.
|
# Start the open-webui program.
|
||||||
set -e
|
set -e
|
||||||
exec docker run \
|
docker run \
|
||||||
--name open-webui \
|
--name open-webui \
|
||||||
-e PORT={{ open_webui_port }} \
|
-e PORT={{ open_webui_port }} \
|
||||||
-p {{ open_webui_port }}:{{ open_webui_port }} \
|
-p {{ open_webui_port }}:{{ open_webui_port }} \
|
||||||
@@ -657,7 +665,7 @@
|
|||||||
|
|
||||||
- name: Workstation | Linux | Software | LLMs | runit | open-terminal | Script | Compose YAML
|
- name: Workstation | Linux | Software | LLMs | runit | open-terminal | Script | Compose YAML
|
||||||
ansible.builtin.copy:
|
ansible.builtin.copy:
|
||||||
dest: /usr/local/etc/open-terminal/docker-compose.yml
|
dest: /usr/local/etc/open-terminal/compose.yml
|
||||||
content: |
|
content: |
|
||||||
#exec docker run \
|
#exec docker run \
|
||||||
# --name open-terminal \
|
# --name open-terminal \
|
||||||
@@ -786,22 +794,32 @@
|
|||||||
|
|
||||||
# Ensure the old container is stopped.
|
# Ensure the old container is stopped.
|
||||||
echo "RUN: Stopping..."
|
echo "RUN: Stopping..."
|
||||||
docker compose -f /usr/local/etc/open-terminal/docker-compose.yml down &&
|
docker compose \
|
||||||
echo "RUN: Container stopped" ||
|
-f /usr/local/etc/open-terminal/docker-compose.yml down &&
|
||||||
|
echo "RUN: Container stopped." ||
|
||||||
echo "RUN: Container already stopped."
|
echo "RUN: Container already stopped."
|
||||||
|
|
||||||
# Check for any new updates in background.
|
# Check for any new updates in the background.
|
||||||
sleep 600 &&
|
(
|
||||||
echo "RUN: Updating..." &&
|
while true; do
|
||||||
docker compose -f /usr/local/etc/open-terminal/docker-compose.yml \
|
sleep 600
|
||||||
build --pull &
|
echo "RUN: Checking for updates..."
|
||||||
|
docker compose \
|
||||||
|
-f /usr/local/etc/open-terminal/compose.yml \
|
||||||
|
build --pull
|
||||||
|
done
|
||||||
|
) &
|
||||||
|
LOOP_PID=$!
|
||||||
|
|
||||||
|
# Ensure cleanup on any exit (normal or signal from runit).
|
||||||
|
trap 'kill "$LOOP_PID" 2>/dev/null; wait "$LOOP_PID" 2>/dev/null' EXIT
|
||||||
|
|
||||||
export GOT_EM=true
|
export GOT_EM=true
|
||||||
|
|
||||||
# Start the open-terminal program.
|
# Start the open-terminal program.
|
||||||
# https://github.com/open-webui/open-terminal#configuration
|
# https://github.com/open-webui/open-terminal#configuration
|
||||||
set -e
|
set -e
|
||||||
exec docker compose -f /usr/local/etc/open-terminal/docker-compose.yml up
|
docker compose -f /usr/local/etc/open-terminal/docker-compose.yml up
|
||||||
owner: root
|
owner: root
|
||||||
mode: "0755"
|
mode: "0755"
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user