global setup and configuration.
This commit is contained in:
+26
-30
@@ -5,53 +5,49 @@
|
||||
set -l resolver /home/jb/.local/bin/orca-nono-profile
|
||||
|
||||
if not test -x "$resolver"
|
||||
printf 'pi-orca: profile resolver is unavailable: %s\n' "$resolver" >&2
|
||||
exit 1
|
||||
printf 'pi-orca: profile resolver is unavailable: %s\n' "$resolver" >&2
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l profile ("$resolver" resolve "$PWD" 2>/dev/null)
|
||||
if test $status -ne 0; or test -z "$profile"
|
||||
printf 'pi-orca: could not resolve a trusted profile for %s\n' "$PWD" >&2
|
||||
exit 1
|
||||
printf 'pi-orca: could not resolve a trusted profile for %s\n' "$PWD" >&2
|
||||
exit 1
|
||||
end
|
||||
|
||||
if not /usr/bin/nono profile show "$profile" >/dev/null 2>&1
|
||||
printf 'pi-orca: resolved profile is unavailable: %s\n' "$profile" >&2
|
||||
exit 1
|
||||
printf 'pi-orca: resolved profile is unavailable: %s\n' "$profile" >&2
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -l node_executable /usr/bin/node
|
||||
set -l pi_agent_dir /home/jb/.pi/agent
|
||||
source /srv/data/code/harness-tools/scripts/pi-orca-runtime.fish
|
||||
configure_pi_orca_runtime "$profile"
|
||||
|
||||
# Native Node addons are ABI-specific. Keep the work profile's Node 22 package
|
||||
# tree separate from the default Node 26 package tree.
|
||||
if test "$profile" = pi-work
|
||||
set node_executable /home/jb/.local/share/fnm/node-versions/v22.23.2/installation/bin/node
|
||||
set pi_agent_dir /home/jb/.pi/profiles/cyone
|
||||
end
|
||||
set -l node_executable "$pi_orca_node_executable"
|
||||
set -l pi_agent_dir "$PI_CODING_AGENT_DIR"
|
||||
|
||||
if not test -x "$node_executable"
|
||||
printf 'pi-orca: Node runtime is unavailable: %s\n' "$node_executable" >&2
|
||||
exit 1
|
||||
printf 'pi-orca: Node runtime is unavailable: %s\n' "$node_executable" >&2
|
||||
exit 1
|
||||
end
|
||||
if not test -d "$pi_agent_dir"
|
||||
printf 'pi-orca: Pi agent directory is unavailable: %s\n' "$pi_agent_dir" >&2
|
||||
exit 1
|
||||
printf 'pi-orca: Pi agent directory is unavailable: %s\n' "$pi_agent_dir" >&2
|
||||
exit 1
|
||||
end
|
||||
|
||||
set -lx ORCA_NONO_PROFILE "$profile"
|
||||
set -lx PI_CODING_AGENT_DIR "$pi_agent_dir"
|
||||
|
||||
exec /usr/bin/systemd-run \
|
||||
--user \
|
||||
--scope \
|
||||
--collect \
|
||||
--quiet \
|
||||
--slice=orca-agents.slice \
|
||||
--property=CPUQuota=1600% \
|
||||
--property=MemoryHigh=48G \
|
||||
--property=MemoryMax=64G \
|
||||
--property=MemorySwapMax=8G \
|
||||
--property=TasksMax=8192 \
|
||||
--property=OOMPolicy=stop \
|
||||
-- /usr/bin/nono run --profile "$profile" -- "$node_executable" /home/jb/.bun/bin/pi $argv
|
||||
--user \
|
||||
--scope \
|
||||
--collect \
|
||||
--quiet \
|
||||
--slice=orca-agents.slice \
|
||||
--property=CPUQuota=1600% \
|
||||
--property=MemoryHigh=48G \
|
||||
--property=MemoryMax=64G \
|
||||
--property=MemorySwapMax=8G \
|
||||
--property=TasksMax=8192 \
|
||||
--property=OOMPolicy=stop \
|
||||
-- /usr/bin/nono run --profile "$profile" -- "$node_executable" /home/jb/.bun/bin/pi $argv
|
||||
|
||||
Reference in New Issue
Block a user