From cde838e4351f018b0d56f994542e66dd2951cadf Mon Sep 17 00:00:00 2001 From: 21in7 Date: Thu, 18 Jun 2026 23:52:33 +0900 Subject: [PATCH] feat: add Hermes Agent in-container bootstrap script Adds scripts/hermes-bootstrap.sh which installs rootful Docker, writes docker-compose.yml (nousresearch/hermes-agent) with bind mounts for /data and /fast, and writes a .env template pointing at the litellm gateway (#117, 10.1.10.22:4000). Run once inside LXC #118 console after pct set has applied bind mounts and features. Co-Authored-By: Claude Sonnet 4.6 --- scripts/hermes-bootstrap.sh | 72 +++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100755 scripts/hermes-bootstrap.sh diff --git a/scripts/hermes-bootstrap.sh b/scripts/hermes-bootstrap.sh new file mode 100755 index 0000000..82eb451 --- /dev/null +++ b/scripts/hermes-bootstrap.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# Hermes Agent bootstrap — run INSIDE the hermes LXC (#118) console, once. +# Prereqs (already done): features nesting/keyctl set, /data and /fast bind mounts present. +set -euo pipefail + +LITELLM_BASE_URL="http://10.1.10.22:4000/v1" # litellm gateway (#117) +HERMES_DATA="/opt/hermes" # ~/.hermes equivalent on rootfs (fast) +COMPOSE_DIR="/opt/hermes-stack" + +echo "==> 1/5 Install rootful Docker + compose plugin" +apt-get update +apt-get install -y ca-certificates curl gnupg +install -m 0755 -d /etc/apt/keyrings +curl -fsSL https://download.docker.com/linux/debian/gpg -o /etc/apt/keyrings/docker.asc +chmod a+r /etc/apt/keyrings/docker.asc +. /etc/os-release +echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/debian ${VERSION_CODENAME} stable" \ + > /etc/apt/sources.list.d/docker.list +apt-get update +apt-get install -y docker-ce docker-ce-cli containerd.io docker-compose-plugin +systemctl enable --now docker +docker run --rm hello-world >/dev/null && echo " docker OK" + +echo "==> 2/5 Prepare data + workspace dirs" +mkdir -p "${HERMES_DATA}" "${COMPOSE_DIR}" +# /data (hdd, bulk) and /fast (2tb ssd) are the bind mounts from the LXC. +mkdir -p /data/workspace /fast/workspace + +echo "==> 3/5 Write docker-compose.yml" +cat > "${COMPOSE_DIR}/docker-compose.yml" < 4/5 Write .env (EDIT secrets before 'gateway run')" +if [ ! -f "${COMPOSE_DIR}/.env" ]; then + cat > "${COMPOSE_DIR}/.env" < 5/5 First-time interactive setup (model -> litellm, sandbox=local, connectors)" +echo " Run setup, then start the gateway:" +echo " cd ${COMPOSE_DIR}" +echo " docker compose run --rm hermes setup # pick provider=custom, base_url=${LITELLM_BASE_URL}, sandbox=local" +echo " docker compose up -d # start 'gateway run'" +echo " docker compose logs -f hermes" +echo "Done. (config.yaml lives under ${HERMES_DATA}; secrets stay in ${COMPOSE_DIR}/.env)"