diff --git a/benchmarks/sandbox/providers.ts b/benchmarks/sandbox/providers.ts index 2048c655..3928ea06 100644 --- a/benchmarks/sandbox/providers.ts +++ b/benchmarks/sandbox/providers.ts @@ -57,7 +57,13 @@ export const providers: ProviderConfig[] = [ { name: 'cloud-run', requiredEnvVars: ['CLOUD_RUN_SANDBOX_URL', 'CLOUD_RUN_SANDBOX_SECRET'], - createCompute: () => cloudRun({ sandboxUrl: process.env.CLOUD_RUN_SANDBOX_URL!, sandboxSecret: process.env.CLOUD_RUN_SANDBOX_SECRET! }), + createCompute: () => cloudRun({ + sandboxUrl: process.env.CLOUD_RUN_SANDBOX_URL!, + sandboxSecret: process.env.CLOUD_RUN_SANDBOX_SECRET!, + executionMode: 'stateful', + write: true, + allowEgress: true, + }), }, { name: 'cloudflare', diff --git a/benchmarks/scripts/dax-benchmark.sh b/benchmarks/scripts/dax-benchmark.sh index 0689f765..fb8c5479 100755 --- a/benchmarks/scripts/dax-benchmark.sh +++ b/benchmarks/scripts/dax-benchmark.sh @@ -138,13 +138,27 @@ prepare() { case "$PKG_MANAGER" in apt) "${SUDO[@]}" apt-get update -qq - "${SUDO[@]}" env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq \ - bash build-essential ca-certificates curl git python3 python3-setuptools unzip + # python3-setuptools and unzip are missing from some minimal images (e.g. + # cloud-run's gVisor rootfs), and apt-get installs *nothing* when any + # argument is unknown, so drop unavailable ones instead of losing the + # whole transaction. unzip has a Python fallback in unpack_bun(). + local packages=(bash build-essential ca-certificates curl git python3) + local optional + for optional in python3-setuptools unzip; do + if apt-cache show "$optional" >/dev/null 2>&1; then + packages+=("$optional") + fi + done + "${SUDO[@]}" env DEBIAN_FRONTEND=noninteractive apt-get install -y -qq "${packages[@]}" ;; dnf) "${SUDO[@]}" dnf makecache --quiet "${SUDO[@]}" dnf install -y --allowerasing \ - bash gcc gcc-c++ make ca-certificates curl git python3 python3-setuptools unzip + bash gcc gcc-c++ make ca-certificates curl git python3 + local optional + for optional in python3-setuptools unzip; do + "${SUDO[@]}" dnf install -y --allowerasing "$optional" || true + done ;; apk) # build-base is Alpine's meta-package for gcc/g++/make/libc-dev. @@ -189,7 +203,20 @@ download_bun() { } unpack_bun() { - unzip -q -j "$ROOT/bun.zip" "$BUN_INTERNAL_PATH" -d "$BUN_INSTALL/bin" + if command -v unzip >/dev/null 2>&1; then + unzip -q -j "$ROOT/bun.zip" "$BUN_INTERNAL_PATH" -d "$BUN_INSTALL/bin" + else + # Fallback for minimal images without unzip (e.g. cloud-run's gVisor rootfs). + python3 - "$ROOT/bun.zip" "$BUN_INTERNAL_PATH" "$BUN_INSTALL/bin" <<'PY' +import os, shutil, sys, zipfile + +archive, member, dest_dir = sys.argv[1:4] +os.makedirs(dest_dir, exist_ok=True) +with zipfile.ZipFile(archive) as z, z.open(member) as src: + with open(os.path.join(dest_dir, 'bun'), 'wb') as dst: + shutil.copyfileobj(src, dst) +PY + fi chmod +x "$BUN_INSTALL/bin/bun" }