comparison mrjunejune/test/production_inference_bundle_test.sh @ 268:f7b1188d5fb1

support repo rules Copilot bundle path Match both +_repo_rules2+ and +http_archive+ Copilot CLI repository layouts during deployment and production startup. Co-authored-by: Copilot <[email protected]>
author MrJuneJune <me@mrjunejune.com>
date Fri, 07 Aug 2026 13:02:41 -0700
parents a78f5986011f
children 13d61401c57d
comparison
equal deleted inserted replaced
267:a78f5986011f 268:f7b1188d5fb1
39 fi 39 fi
40 40
41 entrypoint="$(find -L "$bundle" -type f -name production_entrypoint.sh -print -quit)" 41 entrypoint="$(find -L "$bundle" -type f -name production_entrypoint.sh -print -quit)"
42 bash -n "$entrypoint" 42 bash -n "$entrypoint"
43 grep -q 'mrjunejune_server_binary' "$entrypoint" 43 grep -q 'mrjunejune_server_binary' "$entrypoint"
44 grep -q "copilot_cli_linux_x86_64/copilot" "$entrypoint" 44 grep -q "+_repo_rules2+copilot_cli_linux_x86_64/copilot" "$entrypoint"
45 grep -q "+http_archive+copilot_cli_linux_x86_64/copilot" "$entrypoint"
45 grep -q "rules_python++python+python_3_11_x86_64-unknown-linux-gnu/bin/python3" "$entrypoint" 46 grep -q "rules_python++python+python_3_11_x86_64-unknown-linux-gnu/bin/python3" "$entrypoint"
46 if grep -q '+http_archive+copilot_cli_linux_x86_64' "$entrypoint"; then
47 echo "Production entrypoint hardcodes one Bazel repository prefix" >&2
48 exit 1
49 fi
50 if grep -q 'MRJUNEJUNE_ALLOW_.*INFERENCE' "$entrypoint"; then 47 if grep -q 'MRJUNEJUNE_ALLOW_.*INFERENCE' "$entrypoint"; then
51 echo "Production entrypoint must not override guest policy from .config" >&2 48 echo "Production entrypoint must not override guest policy from .config" >&2
52 exit 1 49 exit 1
53 fi 50 fi
54 51
55 sidecar="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/copilot_sidecar.zip' -print -quit)" 52 sidecar="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/copilot_sidecar.zip' -print -quit)"
56 litellm="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/litellm_proxy.zip' -print -quit)" 53 litellm="$(find -L "$bundle" -type f -path '*/mrjunejune/inference/litellm_proxy.zip' -print -quit)"
57 copilot_cli="$(find -L "$bundle" -type f -path '*/+http_archive+copilot_cli_linux_x86_64/copilot' -print -quit)" 54 copilot_cli="$(
55 find -L "$bundle" -type f \
56 \( \
57 -path '*+_repo_rules2+copilot_cli_linux_x86_64/copilot' -o \
58 -path '*+http_archive+copilot_cli_linux_x86_64/copilot' \
59 \) -print -quit
60 )"
58 python="$(find -L "$bundle" -type f -path '*/rules_python++python+python_3_11_*/bin/python3' -print -quit)" 61 python="$(find -L "$bundle" -type f -path '*/rules_python++python+python_3_11_*/bin/python3' -print -quit)"
59 state="$(mktemp -d)" 62 state="$(mktemp -d)"
60 trap 'rm -rf "$state"' EXIT 63 trap 'rm -rf "$state"' EXIT
61 64
62 sidecar_files="$(unzip -Z1 "$sidecar")" 65 sidecar_files="$(unzip -Z1 "$sidecar")"