Files
EvoScientist-Multi/start-langgraph.sh
T
m4 c683f6e739
Docker / build (push) Has been cancelled
Build / build (push) Has been cancelled
Lint / ruff (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.11) (push) Has been cancelled
Test / pytest (ubuntu-latest, 3.12) (push) Has been cancelled
Test / pytest (windows-latest, 3.11) (push) Has been cancelled
Test / pytest (windows-latest, 3.12) (push) Has been cancelled
feat: prepare EvoScientist 0.3.0
Add bounded document ingestion, controlled web search, recoverable session support, subagent timeouts, and the native sandbox runtime contract. Unify package versioning and add release-focused regression coverage.
2026-09-03 06:55:56 +08:00

52 lines
1.8 KiB
Bash
Executable File

#!/usr/bin/env bash
set -euo pipefail
PROJECT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" && pwd)"
LANGGRAPH_CONFIG="${PROJECT_DIR}/EvoScientist/langgraph_dev/langgraph.json"
HOST="${EVOSCIENTIST_LANGGRAPH_HOST:-127.0.0.1}"
PORT="${EVOSCIENTIST_LANGGRAPH_DEV_PORT:-3076}"
WEB_ENV="${PROJECT_DIR}/../Ai4Sci-Web/.env"
N_JOBS="${EVOSCIENTIST_LANGGRAPH_JOBS_PER_WORKER:-6}"
if [[ ! -x "${PROJECT_DIR}/.venv/bin/langgraph" ]]; then
echo "LangGraph executable not found: ${PROJECT_DIR}/.venv/bin/langgraph" >&2
echo "Run 'uv sync' in ${PROJECT_DIR} first." >&2
exit 1
fi
cd "${PROJECT_DIR}"
# Ask before stopping the process listening on PORT. Matching every connection
# would also terminate Gateway while it is connected to this Runtime.
PIDS="$(lsof -tiTCP:"${PORT}" -sTCP:LISTEN 2>/dev/null || true)"
if [[ -n "${PIDS}" ]]; then
echo "Port ${PORT} is already in use by PID(s): ${PIDS}" >&2
ANSWER=""
read -r -p "Kill the process(es) using port ${PORT}? [y/N] " ANSWER || true
case "${ANSWER}" in
[yY]|[yY][eE][sS])
echo "Killing process(es) on port ${PORT}: ${PIDS}"
kill ${PIDS}
sleep 1
;;
*)
echo "LangGraph not started; process(es) on port ${PORT} were left running." >&2
exit 1
;;
esac
fi
# The Web Gateway always supplies a verified conversation workspace scope.
export EVOSCIENTIST_DEPLOY_MODE="${EVOSCIENTIST_DEPLOY_MODE:-full}"
export EVOSCIENTIST_WORKSPACE_DIR="${EVOSCIENTIST_WORKSPACE_DIR:-${PROJECT_DIR}/../.ai4sci/workspace}"
exec uv run --env-file "${WEB_ENV}" langgraph dev \
--config "${LANGGRAPH_CONFIG}" \
--host "${HOST}" \
--port "${PORT}" \
--no-browser \
--no-reload \
--allow-blocking \
--n-jobs-per-worker "${N_JOBS}"