From 1c557595f3a84ff21334882aacc5cb22452eeb8d Mon Sep 17 00:00:00 2001 From: Marcos Felipe Date: Sun, 25 Oct 2026 17:59:38 +0000 Subject: [PATCH 1/2] fix(openviking): drop the Alpine install option Alpine cannot install this application, and no release fixes that: none of the 61 openviking versions on PyPI publishes a musllinux wheel. Every release ships the same five: manylinux x86_64, manylinux aarch64, macOS x86_64, macOS arm64, Windows. tree-sitter-language-pack (pinned by openviking) is the same story - only the pre-1.0 0.13.0 ever had musllinux; every 1.x is manylinux/macOS/ Windows/sdist. So on musl uv builds both projects from the sdists: openviking is a ~645-crate Rust workspace with lto = true, plus the tree-sitter grammar crates. Measured on an Alpine 3.24 container: 15m52s for the install, 13m58s of it inside cargo, and it needs 3 GB RAM and 20 GB disk (the default 8 GB dies with "No space left on device"). Every step also needs another system tool: rustup/build-base, perl for the vendored OpenSSL, patchelf for maturin's library bundling, cmake, kernel headers. And even then the container does not come up. openviking's setup.py extracts only ragfs_python.abi3.so out of the maturin wheel and drops the accompanying ragfs_python.libs/ directory, so the auditwheel-rewritten DT_NEEDED (libgcc_s-.so.1) cannot be resolved: ImportError: ragfs_python native library is not available: Rust binding not available uvicorn.error - ERROR - Application startup failed. Exiting. On manylinux none of this happens (glibc's libgcc_s is whitelisted, so nothing gets bundled or mangled), which is why the Debian path installs from wheels in about two minutes and works. Changes: - ct/openviking.sh: no OS menu, var_os defaults to debian, Debian-only resource defaults, and the update path is folded into update_script() the way every other single-OS script in this repo does it (update_deb_based/update_alpine/ run_os_update removed). - install/openviking-install.sh: setup_alpine() removed; the Debian steps are top-level again (setup_deb_based/run_os_setup dropped) to match the repo layout. The health check goes from 30x2s to 60x2s: 60 seconds is tight for a 314-package venv start on a small container. - json/openviking.json: the alpine install method is removed; only the default Debian 13 entry stays. The Alpine path can come back if upstream starts publishing musllinux wheels (maturin --compatibility musllinux_1_2) and stops dropping ragfs_python.libs/ from the wheel. --- ct/openviking.sh | 61 +++++-------------------------- install/openviking-install.sh | 69 ++++++----------------------------- json/openviking.json | 12 ------ 3 files changed, 22 insertions(+), 120 deletions(-) diff --git a/ct/openviking.sh b/ct/openviking.sh index ff044e9734..f87ae14de0 100644 --- a/ct/openviking.sh +++ b/ct/openviking.sh @@ -12,32 +12,24 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_ APP="OpenViking" var_tags="${var_tags:-ai;memory;rag}" +var_cpu="${var_cpu:-2}" +var_ram="${var_ram:-2048}" +var_disk="${var_disk:-8}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" var_arm64="${var_arm64:-yes}" var_unprivileged="${var_unprivileged:-1}" -if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then - var_os=$(msg_menu "Choose the container OS" \ - "debian" "Debian 13 (recommended)" \ - "alpine" "Alpine 3.24 (smaller footprint)") -fi - -if [[ "${var_os:-}" == "alpine" ]]; then - var_cpu="${var_cpu:-1}" - var_ram="${var_ram:-1024}" - var_disk="${var_disk:-8}" - var_version="${var_version:-3.24}" -else - var_cpu="${var_cpu:-2}" - var_ram="${var_ram:-2048}" - var_disk="${var_disk:-8}" - var_version="${var_version:-13}" -fi header_info "$APP" variables color catch_errors -update_deb_based() { +function update_script() { + header_info + check_container_storage + check_container_resources + if [[ ! -d /opt/openviking ]]; then msg_error "No ${APP} Installation Found!" exit @@ -62,39 +54,6 @@ update_deb_based() { msg_ok "Started Service" msg_ok "Updated successfully!" fi -} - -update_alpine() { - if [[ ! -d /opt/openviking ]]; then - msg_error "No ${APP} Installation Found!" - exit - fi - - msg_info "Updating Alpine Packages" - $STD apk -U upgrade - msg_ok "Updated Alpine Packages" - - if check_for_gh_release "openviking-server" "volcengine/OpenViking"; then - msg_info "Stopping Service" - $STD rc-service openviking stop - msg_ok "Stopped Service" - - msg_info "Updating ${APP}" - $STD uv pip install --python /opt/openviking/bin/python --upgrade openviking - msg_ok "Updated ${APP}" - - msg_info "Starting Service" - $STD rc-service openviking start - msg_ok "Started Service" - msg_ok "Updated successfully!" - fi -} - -function update_script() { - header_info - check_container_storage - check_container_resources - run_os_update exit } diff --git a/install/openviking-install.sh b/install/openviking-install.sh index dc764dc6e5..b5ed467068 100644 --- a/install/openviking-install.sh +++ b/install/openviking-install.sh @@ -63,7 +63,7 @@ EOF _ov_wait_ready() { local ready=0 - for _ in {1..30}; do + for _ in {1..60}; do if curl -fsS -o /dev/null "http://127.0.0.1:1933/health"; then ready=1 break @@ -71,20 +71,19 @@ _ov_wait_ready() { sleep 2 done if [[ "$ready" -ne 1 ]]; then - msg_error "OpenViking did not become healthy within 60 seconds — check 'systemctl status openviking' (Debian) or 'rc-service openviking status' (Alpine)" + msg_error "OpenViking did not become healthy within 120 seconds — check 'systemctl status openviking'" exit 1 fi } -setup_deb_based() { - msg_info "Installing Dependencies" - $STD apt install -y openssl - msg_ok "Installed Dependencies" +msg_info "Installing Dependencies" +$STD apt install -y openssl +msg_ok "Installed Dependencies" - _ov_install_server +_ov_install_server - msg_info "Creating Service" - cat </etc/systemd/system/openviking.service +msg_info "Creating Service" +cat </etc/systemd/system/openviking.service [Unit] Description=OpenViking HTTP Server After=network.target @@ -101,53 +100,9 @@ RestartSec=5 [Install] WantedBy=multi-user.target EOF - systemctl enable -q --now openviking - _ov_wait_ready - msg_ok "Created Service" -} - -setup_alpine() { - msg_info "Installing Dependencies" - $STD apk add openssl - msg_ok "Installed Dependencies" - - _ov_install_server - - msg_info "Creating Service" - cat <<'EOF' >/etc/init.d/openviking -#!/sbin/openrc-run -name="OpenViking" -description="OpenViking - a self-evolving context database for AI agents" - -command="/opt/openviking/bin/openviking-server" -command_user="root" -supervisor=supervise-daemon -output_log="/var/log/openviking.log" -error_log="/var/log/openviking.log" -pidfile="/run/${RC_SVCNAME}.pid" -respawn_delay=10 - -depend() { - need net - after firewall -} - -start_pre() { - checkpath -d -m 0750 -o root:root /opt/openviking_data - checkpath -f -m 0640 "$output_log" -} -EOF - chmod +x /etc/init.d/openviking - cat </etc/conf.d/openviking -export OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf -EOF - $STD rc-update add openviking default - $STD rc-service openviking start - _ov_wait_ready - msg_ok "Created Service" -} - -run_os_setup +systemctl enable -q --now openviking +_ov_wait_ready +msg_ok "Created Service" msg_info "Running OpenViking Doctor" if OPENVIKING_CONFIG_FILE=/opt/openviking_data/ov.conf /opt/openviking/bin/openviking-server doctor >/dev/null 2>&1; then @@ -158,4 +113,4 @@ fi motd_ssh customize -cleanup_lxc \ No newline at end of file +cleanup_lxc diff --git a/json/openviking.json b/json/openviking.json index 0ba4c34381..1be4dee2e8 100644 --- a/json/openviking.json +++ b/json/openviking.json @@ -30,18 +30,6 @@ "os": "Debian", "version": "13" } - }, - { - "type": "alpine", - "script": "ct/openviking.sh", - "config_path": "/opt/openviking_data/ov.conf", - "resources": { - "cpu": 1, - "ram": 1024, - "hdd": 8, - "os": "Alpine", - "version": "3.24" - } } ], "default_credentials": { From 5e4de19321380818c60591b822bd8351804c1c56 Mon Sep 17 00:00:00 2001 From: Marcos Felipe Date: Sun, 25 Oct 2026 18:52:22 +0000 Subject: [PATCH 2/2] refactor(openviking): flatten the install script to the repo layout AGENTS.md section 5 allows exactly one function per script pair - update_script() in the CT script - and no helpers of your own. The install script still carried _ov_install_server() and _ov_wait_ready(), which came in with the original script and predate this PR's changes. Both are inlined: dependencies, uv, venv, config, unit file, health loop, doctor, in that order, top to bottom. No behaviour change: same commands, same order, same 120 second health budget. --- install/openviking-install.sh | 65 ++++++++++++++++------------------- 1 file changed, 29 insertions(+), 36 deletions(-) diff --git a/install/openviking-install.sh b/install/openviking-install.sh index b5ed467068..8d8ecc8a70 100644 --- a/install/openviking-install.sh +++ b/install/openviking-install.sh @@ -13,21 +13,24 @@ setting_up_container network_check update_os -_ov_install_server() { - PYTHON_VERSION="3.12" setup_uv +msg_info "Installing Dependencies" +$STD apt install -y openssl +msg_ok "Installed Dependencies" + +PYTHON_VERSION="3.12" setup_uv - msg_info "Installing OpenViking" - $STD uv venv --python 3.12 /opt/openviking - $STD uv pip install --python /opt/openviking/bin/python openviking - cat <~/.openviking-server +msg_info "Installing OpenViking" +$STD uv venv --python 3.12 /opt/openviking +$STD uv pip install --python /opt/openviking/bin/python openviking +cat <~/.openviking-server $(get_latest_github_release "volcengine/OpenViking") EOF - msg_ok "Installed OpenViking" +msg_ok "Installed OpenViking" - msg_info "Configuring OpenViking" - ROOT_API_KEY=$(openssl rand -hex 32) - mkdir -p /opt/openviking_data - cat </opt/openviking_data/ov.conf +msg_info "Configuring OpenViking" +ROOT_API_KEY=$(openssl rand -hex 32) +mkdir -p /opt/openviking_data +cat </opt/openviking_data/ov.conf { "server": { "host": "0.0.0.0", @@ -57,30 +60,8 @@ EOF } } EOF - chmod 600 /opt/openviking_data/ov.conf - msg_ok "Configured OpenViking" -} - -_ov_wait_ready() { - local ready=0 - for _ in {1..60}; do - if curl -fsS -o /dev/null "http://127.0.0.1:1933/health"; then - ready=1 - break - fi - sleep 2 - done - if [[ "$ready" -ne 1 ]]; then - msg_error "OpenViking did not become healthy within 120 seconds — check 'systemctl status openviking'" - exit 1 - fi -} - -msg_info "Installing Dependencies" -$STD apt install -y openssl -msg_ok "Installed Dependencies" - -_ov_install_server +chmod 600 /opt/openviking_data/ov.conf +msg_ok "Configured OpenViking" msg_info "Creating Service" cat </etc/systemd/system/openviking.service @@ -101,7 +82,19 @@ RestartSec=5 WantedBy=multi-user.target EOF systemctl enable -q --now openviking -_ov_wait_ready + +ready=0 +for _ in {1..60}; do + if curl -fsS -o /dev/null "http://127.0.0.1:1933/health"; then + ready=1 + break + fi + sleep 2 +done +if [[ "$ready" -ne 1 ]]; then + msg_error "OpenViking did not become healthy within 120 seconds — check 'systemctl status openviking'" + exit 1 +fi msg_ok "Created Service" msg_info "Running OpenViking Doctor"