instant (dev) sandbox (#171)

* instant (dev) sandbox

* leave Dockerfile as is to pass deploy test

* fix comma

* fix prod build

* do not use "images exists" which docker does not support

* separate dev-mode flag

* Merge remote-tracking branch 'origin/main' into instant_sandbox
This commit is contained in:
Olcan
2025-04-25 10:58:23 -07:00
committed by GitHub
parent eea524f6bb
commit 320f54e205
5 changed files with 86 additions and 25 deletions

View File

@@ -22,10 +22,23 @@ fi
CMD=$(scripts/sandbox_command.sh)
IMAGE=gemini-code-sandbox
WORKDIR=/sandbox/$(basename "$PWD")
CLI_PATH=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli
DEBUG_PORT=9229
PROJECT=$(basename "$PWD")
WORKDIR=/sandbox/$PROJECT
CLI_PATH=/usr/local/share/npm-global/lib/node_modules/\@gemini-code/cli
# if project is gemini-code, then run CLI from $WORKDIR/packages/cli
# note this means the global installation is not required in this case
if [[ "$PROJECT" == "gemini-code" ]]; then
CLI_PATH="$WORKDIR/packages/cli"
elif [ -n "${DEBUG:-}" ]; then
# refuse to debug using global installation
# (requires a separate attach config in launch.json, see comments there around remoteRoot)
echo "ERROR: debugging is sandbox is not supported when target/root is not gemini-code"
exit 1
fi
# use interactive tty mode and auto-remove container on exit
run_args=(-it --rm)