Add llama.cpp monitor dropshell template with GPU dashboard
All checks were successful
Test and Publish Templates / test-and-publish (push) Successful in 9s

This commit is contained in:
2026-03-15 13:11:53 +13:00
parent 23ec097b39
commit 1a6f71dbdc
10 changed files with 578 additions and 0 deletions

31
llamacpp-monitor/start.sh Executable file
View File

@@ -0,0 +1,31 @@
#!/bin/bash
source "${AGENT_PATH}/common.sh"
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
_check_required_env_vars "CONTAINER_NAME" "LLAMA_SERVER_URL" "MONITOR_PORT" "IMAGE_REGISTRY" "IMAGE_REPO" "IMAGE_TAG"
DOCKER_RUN_CMD="docker run -d \
--restart unless-stopped \
--name ${CONTAINER_NAME} \
-p ${MONITOR_PORT}:${MONITOR_PORT} \
-e LLAMA_SERVER_URL=${LLAMA_SERVER_URL} \
-e MONITOR_PORT=${MONITOR_PORT} \
-v ${SCRIPT_DIR}/monitor.py:/app/monitor.py:ro \
${IMAGE_REGISTRY}/${IMAGE_REPO}:${IMAGE_TAG} \
python3 /app/monitor.py"
echo "Starting container ${CONTAINER_NAME}..."
if ! _create_and_start_container "$DOCKER_RUN_CMD" "$CONTAINER_NAME"; then
if _is_container_exists $CONTAINER_NAME; then
echo "Attempting to get logs from failed container..."
_get_container_logs $CONTAINER_NAME
fi
_die "Failed to start container ${CONTAINER_NAME}"
fi
if ! _is_container_running "$CONTAINER_NAME"; then
_get_container_logs $CONTAINER_NAME
_die "Container ${CONTAINER_NAME} is not running after start attempt"
fi
echo "Service ${CONTAINER_NAME} started on port ${MONITOR_PORT}."