Files
deepseek-harness/scripts/offline/install-deps.sh
Coder ed152416d5
Some checks failed
CI / node 22.19 (push) Has been skipped
CI / node 26 (push) Has been skipped
CI / python 3.10 / keyless SDK (push) Has been skipped
CI / python runtime / release-shaped Linux x64 (push) Has been skipped
CI / windows node 24 / wine blocking (push) Has been skipped
CI / wine apt cache (push) Successful in 58s
CI / serial / linux (push) Has been skipped
Deploy documentation / build (push) Failing after 2m46s
Deploy documentation / deploy (push) Has been skipped
E2E (real DeepSeek API) / e2e (push) Failing after 1m18s
Sandbox / sandbox e2e (bwrap, ubuntu-latest) (push) Failing after 1m18s
Landlock Run / Matrix (push) Successful in 13s
Release (vendor) / Pack npm tarballs (push) Failing after 3m43s
Release (dsh) / Pack npm tarballs (push) Failing after 1m53s
Sandbox / sandbox e2e (landlock, ubuntu-24.04) (push) Failing after 1m51s
Release (vendor) / Publish to npm (push) Has been skipped
Release (dsh) / Publish to npm (push) Has been skipped
CI / node 24 / static (push) Has been cancelled
CI / node 24 / coverage (push) Has been cancelled
CI / node 24 / snapshots and artifacts (push) Has been cancelled
CI / windows node 24 / native complete (push) Has been cancelled
CI / serial / linux (self-hosted standby) (push) Has been cancelled
CI / serial / macos (push) Has been cancelled
CI / serial / windows (self-hosted standby) (push) Has been cancelled
CI / larger-runner-benchmark (16, linux, dsh-ubuntu-24-04-16core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (16, windows, dsh-windows-2025-16core, production-site) (push) Has been cancelled
CI / larger-runner-benchmark (32, linux, dsh-ubuntu-24-04-32core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (32, windows, dsh-windows-2025-32core, production-site) (push) Has been cancelled
CI / larger-runner-benchmark (4, linux, dsh-ubuntu-24-04-4core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (4, windows, dsh-windows-2025-4core, production-site) (push) Has been cancelled
CI / larger-runner-benchmark (64, linux, dsh-ubuntu-24-04-64core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (64, windows, dsh-windows-2025-64core, production-site) (push) Has been cancelled
CI / larger-runner-benchmark (8, linux, dsh-ubuntu-24-04-8core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (8, windows, dsh-windows-2025-8core, production-site) (push) Has been cancelled
CI / larger-runner-benchmark (96, linux, dsh-ubuntu-24-04-96core, typecheck) (push) Has been cancelled
CI / larger-runner-benchmark (96, windows, dsh-windows-2025-96core, production-site) (push) Has been cancelled
CI / consolidated-runner-benchmark (16, linux, dsh-ubuntu-24-04-16core, 16) (push) Has been cancelled
CI / consolidated-runner-benchmark (16, windows, dsh-windows-2025-16core, 2) (push) Has been cancelled
CI / consolidated-runner-benchmark (32, linux, dsh-ubuntu-24-04-32core, 32) (push) Has been cancelled
CI / consolidated-runner-benchmark (32, windows, dsh-windows-2025-32core, 2) (push) Has been cancelled
CI / consolidated-runner-benchmark (4, linux, dsh-ubuntu-24-04-4core, 4) (push) Has been cancelled
CI / consolidated-runner-benchmark (4, windows, dsh-windows-2025-4core, 2) (push) Has been cancelled
CI / consolidated-runner-benchmark (64, linux, dsh-ubuntu-24-04-64core, 32) (push) Has been cancelled
CI / consolidated-runner-benchmark (64, windows, dsh-windows-2025-64core, 2) (push) Has been cancelled
CI / consolidated-runner-benchmark (8, linux, dsh-ubuntu-24-04-8core, 8) (push) Has been cancelled
CI / consolidated-runner-benchmark (8, windows, dsh-windows-2025-8core, 2) (push) Has been cancelled
CI / consolidated-runner-benchmark (96, linux, dsh-ubuntu-24-04-96core, 32) (push) Has been cancelled
CI / consolidated-runner-benchmark (96, windows, dsh-windows-2025-96core, 2) (push) Has been cancelled
CI / all checks passed (push) Has been cancelled
Sandbox / sandbox e2e (seatbelt, macos-latest) (push) Has been cancelled
Sandbox / sandbox e2e (landlock, ubuntu-24.04-arm) (push) Has been cancelled
Landlock Run / ${{ matrix.platform }} (push) Has been cancelled
Landlock Run / darwin (no platform package — degradation proof) (push) Has been cancelled
feat: add searxng web-search provider, openrouter cost balance UI, offline scripts; update source-launch and docs
2026-08-20 13:01:40 +07:00

88 lines
2.9 KiB
Bash

#!/usr/bin/env bash
# Install from caches filled by download-deps.sh. Unpacks the official Node
# archive into .offline-cache/node/runtime and prepends it to PATH so the
# offline machine does not need a system Node. Fails if any lockfile package
# is missing from .offline-store (no registry access).
#
# Usage (repo root): bash scripts/offline/install-deps.sh [--build]
set -euo pipefail
ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
cd "$ROOT"
BUILD=0
for arg in "$@"; do
case "$arg" in
--build) BUILD=1 ;;
*)
echo "Unknown argument: $arg (expected --build)" >&2
exit 1
;;
esac
done
NODE_CACHE="$ROOT/.offline-cache/node"
META_PATH="$NODE_CACHE/runtime.json"
if [[ ! -f "$META_PATH" ]]; then
echo "Missing $META_PATH. Run scripts/offline/download-deps.sh on a networked machine first, then copy the checkout." >&2
exit 1
fi
NODE_VERSION="$(sed -n 's/.*"version":"\([^"]*\)".*/\1/p' "$META_PATH" | head -n 1)"
ARCHIVE_NAME="$(sed -n 's/.*"archive":"\([^"]*\)".*/\1/p' "$META_PATH" | head -n 1)"
PLATFORM="$(sed -n 's/.*"platform":"\([^"]*\)".*/\1/p' "$META_PATH" | head -n 1)"
ARCHIVE_PATH="$NODE_CACHE/$ARCHIVE_NAME"
RUNTIME_DIR="$NODE_CACHE/runtime"
NODE_PREFIX="$RUNTIME_DIR/node-v${NODE_VERSION}-${PLATFORM}"
if [[ ! -x "$NODE_PREFIX/bin/node" ]]; then
if [[ ! -f "$ARCHIVE_PATH" ]]; then
echo "Missing Node archive $ARCHIVE_PATH. Re-run download-deps.sh." >&2
exit 1
fi
rm -rf "$RUNTIME_DIR"
mkdir -p "$RUNTIME_DIR"
case "$ARCHIVE_PATH" in
*.tar.xz) tar -xJf "$ARCHIVE_PATH" -C "$RUNTIME_DIR" ;;
*.tar.gz) tar -xzf "$ARCHIVE_PATH" -C "$RUNTIME_DIR" ;;
*.zip) unzip -q "$ARCHIVE_PATH" -d "$RUNTIME_DIR" ;;
*)
echo "Unknown Node archive: $ARCHIVE_PATH" >&2
exit 1
;;
esac
fi
if [[ ! -x "$NODE_PREFIX/bin/node" ]]; then
echo "Unpacked Node is missing: $NODE_PREFIX/bin/node" >&2
exit 1
fi
export PATH="$NODE_PREFIX/bin:$PATH"
STORE_DIR="$ROOT/.offline-store"
COREPACK_HOME="$ROOT/.offline-cache/corepack"
if [[ ! -d "$STORE_DIR" ]]; then
echo "Missing $STORE_DIR. Run scripts/offline/download-deps.sh on a networked machine first, then copy the checkout." >&2
exit 1
fi
if [[ ! -d "$COREPACK_HOME" ]]; then
echo "Missing $COREPACK_HOME. Re-run download-deps.sh so Corepack pnpm is cached in-repo." >&2
exit 1
fi
export COREPACK_HOME
export COREPACK_ENABLE_NETWORK=0
PACKAGE_MANAGER="$(sed -n 's/.*"packageManager": "\(pnpm@[0-9.]*\)".*/\1/p' package.json | head -n 1)"
echo "Offline install $PACKAGE_MANAGER from $STORE_DIR (Node $(node --version))"
corepack pnpm install --offline --frozen-lockfile --store-dir "$STORE_DIR"
if [[ "$BUILD" -eq 1 ]]; then
echo 'Building host/client libs, then the web frontend'
npm run build:lib
corepack pnpm --dir apps/web run build
echo "Build complete. Start the UI with: $NODE_PREFIX/bin/corepack pnpm dsh web"
else
echo 'Install complete. For dsh web also run: bash scripts/offline/install-deps.sh --build'
fi