comparison mrjunejune/deploy.sh @ 267:a78f5986011f

discover bundled production runtimes Locate Bazel-packaged Copilot and Python binaries by stable suffix instead of hardcoding an external repository prefix. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Fri, 07 Aug 2026 12:58:55 -0700
parents efaf4c63cc94
children f7b1188d5fb1
comparison
equal deleted inserted replaced
266:efaf4c63cc94 267:a78f5986011f
17 "$staging/mrjunejune_server_binary" 17 "$staging/mrjunejune_server_binary"
18 sudo cp \ 18 sudo cp \
19 "$staging/mrjunejune/production_entrypoint.sh" \ 19 "$staging/mrjunejune/production_entrypoint.sh" \
20 "$staging/mrjunejune_server" 20 "$staging/mrjunejune_server"
21 21
22 copilot_cli="$(
23 sudo find -L "$staging" -type f \
24 -path '*/copilot_cli_linux_x86_64/copilot' -print -quit
25 )"
26 python_runtime="$(
27 sudo find -L "$staging" -type f \
28 -path '*/rules_python++python+python_3_11_x86_64-unknown-linux-gnu/bin/python3' \
29 -print -quit
30 )"
31 if [[ -z "$copilot_cli" ]]; then
32 echo "Deployment bundle does not contain the Copilot CLI" >&2
33 exit 1
34 fi
35 if [[ -z "$python_runtime" ]]; then
36 echo "Deployment bundle does not contain the Python runtime" >&2
37 exit 1
38 fi
39
22 required_runtime=( 40 required_runtime=(
23 "$staging/mrjunejune_server" 41 "$staging/mrjunejune_server"
24 "$staging/mrjunejune_server_binary" 42 "$staging/mrjunejune_server_binary"
25 "$staging/mrjunejune/inference_stack.sh" 43 "$staging/mrjunejune/inference_stack.sh"
26 "$staging/mrjunejune/inference_sidecar_launcher.sh" 44 "$staging/mrjunejune/inference_sidecar_launcher.sh"
27 "$staging/mrjunejune/inference/copilot_sidecar.zip" 45 "$staging/mrjunejune/inference/copilot_sidecar.zip"
28 "$staging/mrjunejune/inference/litellm_proxy.zip" 46 "$staging/mrjunejune/inference/litellm_proxy.zip"
29 "$staging/mrjunejune/inference/litellm_config.yaml" 47 "$staging/mrjunejune/inference/litellm_config.yaml"
30 "$staging/+http_archive+copilot_cli_linux_x86_64/copilot" 48 "$copilot_cli"
31 "$staging/rules_python++python+python_3_11_x86_64-unknown-linux-gnu/bin/python3" 49 "$python_runtime"
32 ) 50 )
33 for runtime_path in "${required_runtime[@]}"; do 51 for runtime_path in "${required_runtime[@]}"; do
34 if [[ ! -e "$runtime_path" ]]; then 52 if [[ ! -e "$runtime_path" ]]; then
35 echo "Deployment bundle is missing runtime: $runtime_path" >&2 53 echo "Deployment bundle is missing runtime: $runtime_path" >&2
36 exit 1 54 exit 1
39 57
40 sudo chmod +x \ 58 sudo chmod +x \
41 "$staging/mrjunejune_server" \ 59 "$staging/mrjunejune_server" \
42 "$staging/mrjunejune/inference_stack.sh" \ 60 "$staging/mrjunejune/inference_stack.sh" \
43 "$staging/mrjunejune/inference_sidecar_launcher.sh" \ 61 "$staging/mrjunejune/inference_sidecar_launcher.sh" \
44 "$staging/+http_archive+copilot_cli_linux_x86_64/copilot" 62 "$copilot_cli" \
63 "$python_runtime"
45 sudo chown -R mrjunejune_server:zenbu_team "$staging" 64 sudo chown -R mrjunejune_server:zenbu_team "$staging"
46 65
47 # Persistent database, config, and Copilot tokens stay outside the immutable 66 # Persistent database, config, and Copilot tokens stay outside the immutable
48 # bundle and survive swaps. 67 # bundle and survive swaps.
49 sudo mkdir -p /opt/data/mrjunejune/ 68 sudo mkdir -p /opt/data/mrjunejune/