Move server venv setup to bootstrap, remove cross-platform pip freeze sync
Server venv is created during bootstrap via SSH (same package list, installed natively on Linux). Removes sync_data.sh section that copied pip freeze output across platforms (Windows/macOS freeze is incompatible with Linux).
This commit is contained in:
parent
22a1bb5847
commit
49adbe26ec
2 changed files with 9 additions and 18 deletions
|
|
@ -51,11 +51,16 @@ steps:
|
|||
- "rsync -avz --no-perms --no-group --progress {ssh_alias}:server/parquet/ ./server/parquet/"
|
||||
note: "Some folders may be empty if data sync hasn't run on the server yet. That's OK."
|
||||
|
||||
- name: "Set up Python venv"
|
||||
- name: "Set up Python venv (local and server)"
|
||||
description: |
|
||||
Set up local venv, then create a matching venv on the server via SSH.
|
||||
The server venv is needed for running scripts remotely (notifications, etc.).
|
||||
Install the SAME packages on both sides (do NOT copy pip freeze across platforms).
|
||||
commands:
|
||||
- "python3 -m venv .venv"
|
||||
- "source .venv/bin/activate"
|
||||
- "pip install pandas pyarrow duckdb pyyaml python-dotenv"
|
||||
- "ssh {ssh_alias} 'python3 -m venv ~/.venv && ~/.venv/bin/pip install --quiet pandas pyarrow duckdb pyyaml python-dotenv'"
|
||||
|
||||
- name: "Initialize DuckDB"
|
||||
condition: "only if server/scripts/setup_views.sh exists"
|
||||
|
|
|
|||
|
|
@ -491,23 +491,9 @@ else
|
|||
echo " [dry-run] Would sync corporate memory rules to .claude/rules/"
|
||||
fi
|
||||
|
||||
# Sync Python environment to server (only if dependencies changed)
|
||||
if [[ -z "$DRY_RUN" ]] && [[ -f "./.venv/bin/pip" ]]; then
|
||||
echo ""
|
||||
LOCAL_REQ="$(mktemp)"
|
||||
./.venv/bin/pip freeze > "$LOCAL_REQ"
|
||||
LOCAL_HASH=$(md5sum "$LOCAL_REQ" 2>/dev/null | cut -d' ' -f1 || md5 -q "$LOCAL_REQ" 2>/dev/null || echo "none")
|
||||
REMOTE_HASH=$(ssh $SSH_HOST "md5sum ~/.analyst_requirements.txt 2>/dev/null | cut -d' ' -f1 || echo 'missing'" 2>/dev/null || echo "missing")
|
||||
if [[ "$LOCAL_HASH" != "$REMOTE_HASH" ]]; then
|
||||
echo "Syncing Python environment to server..."
|
||||
scp "$LOCAL_REQ" "$SSH_HOST:~/.analyst_requirements.txt"
|
||||
ssh $SSH_HOST "test -d ~/.venv || python3 -m venv ~/.venv; ~/.venv/bin/pip install -r ~/.analyst_requirements.txt --quiet 2>&1 | tail -1"
|
||||
echo "Server Python environment synced"
|
||||
else
|
||||
echo "Server Python environment up to date"
|
||||
fi
|
||||
rm -f "$LOCAL_REQ"
|
||||
fi
|
||||
# Note: Python environment on server is set up during bootstrap (not synced).
|
||||
# Server venv is created via: ssh {alias} 'python3 -m venv ~/.venv && pip install ...'
|
||||
# This avoids cross-platform pip freeze issues (Windows/macOS -> Linux).
|
||||
|
||||
# Only update DuckDB and check freshness if NOT dry-run
|
||||
if [[ -z "$DRY_RUN" ]]; then
|
||||
|
|
|
|||
Loading…
Reference in a new issue