-
Notifications
You must be signed in to change notification settings - Fork 27
fix: Fix build script bugs #137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -0,0 +1,49 @@ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| #!/bin/bash | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Exit on any error, undefined variable, or error in a pipeline | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -e | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -u | ||||||||||||||||||||||||||||||||||||||||||||||||||
| set -o pipefail | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Convenience script to build a release virtual environment and start the Deephaven server. | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # This script automates the process of: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # 1. Creating a temporary installer virtual environment | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # 2. Building the release virtual environment with deephaven-ib, deephaven-server, and ibapi | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # 3. Starting the Deephaven server | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # Press Ctrl-C to stop the server when done. | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Display Java home (required for Deephaven) | ||||||||||||||||||||||||||||||||||||||||||||||||||
| if [ -z "${JAVA_HOME:-}" ]; then | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "Error: JAVA_HOME is not set. Deephaven requires Java. Please set JAVA_HOME before running this script." >&2 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| exit 1 | ||||||||||||||||||||||||||||||||||||||||||||||||||
| fi | ||||||||||||||||||||||||||||||||||||||||||||||||||
| echo "JAVA_HOME=${JAVA_HOME}" | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Clean up any existing virtual environments | ||||||||||||||||||||||||||||||||||||||||||||||||||
| deactivate 2>/dev/null || true # Deactivate if already in a venv | ||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf .venv-installer | ||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf venv-release-dhib* | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Create temporary installer virtual environment | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # This small venv is only used to run the dhib_env.py script | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python3.12 -m venv .venv-installer | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| source .venv-installer/bin/activate | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Install dependencies needed to run dhib_env.py | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python -m pip install --upgrade pip | ||||||||||||||||||||||||||||||||||||||||||||||||||
| pip install -r requirements_dhib_env.txt | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Build the release virtual environment | ||||||||||||||||||||||||||||||||||||||||||||||||||
| # This creates venv-release-dhib-<version> with all required packages | ||||||||||||||||||||||||||||||||||||||||||||||||||
| python ./dhib_env.py release | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Clean up temporary installer venv | ||||||||||||||||||||||||||||||||||||||||||||||||||
| deactivate | ||||||||||||||||||||||||||||||||||||||||||||||||||
| rm -rf .venv-installer | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| # Activate the release virtual environment and start Deephaven server | ||||||||||||||||||||||||||||||||||||||||||||||||||
| source ./venv-release-dhib*/bin/activate | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| source ./venv-release-dhib*/bin/activate | |
| venv_activate_candidates=( ./venv-release-dhib*/bin/activate ) | |
| # Handle cases where the glob does not match or matches multiple environments | |
| if [ "${#venv_activate_candidates[@]}" -eq 1 ] && [ "${venv_activate_candidates[0]}" = "./venv-release-dhib*/bin/activate" ]; then | |
| echo "Error: No release virtual environment found matching ./venv-release-dhib*/bin/activate" >&2 | |
| exit 1 | |
| fi | |
| if [ "${#venv_activate_candidates[@]}" -eq 0 ]; then | |
| echo "Error: No release virtual environment found matching ./venv-release-dhib*/bin/activate" >&2 | |
| exit 1 | |
| elif [ "${#venv_activate_candidates[@]}" -gt 1 ]; then | |
| echo "Error: Multiple release virtual environments found. Please remove duplicates:" >&2 | |
| printf ' %s\n' "${venv_activate_candidates[@]}" >&2 | |
| exit 1 | |
| fi | |
| if [ ! -f "${venv_activate_candidates[0]}" ]; then | |
| echo "Error: Expected activate script not found at ${venv_activate_candidates[0]}" >&2 | |
| exit 1 | |
| fi | |
| source "${venv_activate_candidates[0]}" |
Uh oh!
There was an error while loading. Please reload this page.