mirror of
https://github.com/openclaw/openclaw.git
synced 2026-07-21 02:06:43 +00:00
feat: allow custom sandbox image tags (#99915)
* feat: allow custom sandbox image tags * test: align Crabbox default acceptance
This commit is contained in:
@@ -4,7 +4,7 @@ set -euo pipefail
|
||||
ROOT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
source "$ROOT_DIR/scripts/lib/docker-build.sh"
|
||||
|
||||
IMAGE_NAME="openclaw-sandbox:bookworm-slim"
|
||||
IMAGE_NAME="${OPENCLAW_SANDBOX_IMAGE:-openclaw-sandbox:bookworm-slim}"
|
||||
|
||||
docker_build_exec -t "${IMAGE_NAME}" -f "$ROOT_DIR/scripts/docker/sandbox/Dockerfile" "$ROOT_DIR"
|
||||
echo "Built ${IMAGE_NAME}"
|
||||
|
||||
@@ -172,6 +172,14 @@ function runCleanupDefaultPlatform(env: Record<string, string>, hostArch: string
|
||||
}
|
||||
|
||||
describe("docker build helper", () => {
|
||||
it("allows deployments to build an immutable sandbox image tag", () => {
|
||||
const script = readFileSync("scripts/sandbox-setup.sh", "utf8");
|
||||
|
||||
expect(script).toContain(
|
||||
'IMAGE_NAME="${OPENCLAW_SANDBOX_IMAGE:-openclaw-sandbox:bookworm-slim}"',
|
||||
);
|
||||
});
|
||||
|
||||
it("forces BuildKit for centralized Docker builds", () => {
|
||||
const helper = readFileSync(HELPER_PATH, "utf8");
|
||||
|
||||
|
||||
@@ -378,7 +378,7 @@ describe("package acceptance workflow", () => {
|
||||
);
|
||||
});
|
||||
|
||||
it("keeps default Crabbox capacity on the Azure credit-backed lane", () => {
|
||||
it("defaults Crabbox proof to Blacksmith while keeping direct jobs on Azure", () => {
|
||||
const crabboxConfig = parse(readFileSync(CRABBOX_CONFIG, "utf8")) as {
|
||||
aws?: { region?: string };
|
||||
capacity?: {
|
||||
@@ -388,22 +388,30 @@ describe("package acceptance workflow", () => {
|
||||
regions?: string[];
|
||||
};
|
||||
jobs?: {
|
||||
changed?: { command?: string; market?: string; shell?: boolean; type?: string };
|
||||
prewarm?: { market?: string; type?: string };
|
||||
changed?: {
|
||||
command?: string;
|
||||
market?: string;
|
||||
provider?: string;
|
||||
shell?: boolean;
|
||||
type?: string;
|
||||
};
|
||||
prewarm?: { market?: string; provider?: string; type?: string };
|
||||
};
|
||||
provider?: string;
|
||||
ssh?: { port?: string; user?: string };
|
||||
};
|
||||
|
||||
expect(crabboxConfig.provider).toBe("azure");
|
||||
expect(crabboxConfig.provider).toBe("blacksmith-testbox");
|
||||
expect(crabboxConfig.capacity?.market).toBe("on-demand");
|
||||
expect(crabboxConfig.capacity?.fallback).toBeUndefined();
|
||||
expect(crabboxConfig.capacity?.regions).toBeUndefined();
|
||||
expect(crabboxConfig.capacity?.availabilityZones).toBeUndefined();
|
||||
expect(crabboxConfig.aws?.region).toBe("eu-west-1");
|
||||
expect(crabboxConfig.jobs?.prewarm?.market).toBe("on-demand");
|
||||
expect(crabboxConfig.jobs?.prewarm?.provider).toBe("azure");
|
||||
expect(crabboxConfig.jobs?.prewarm?.type).toBe("Standard_D4ads_v6");
|
||||
expect(crabboxConfig.jobs?.changed?.market).toBe("on-demand");
|
||||
expect(crabboxConfig.jobs?.changed?.provider).toBe("azure");
|
||||
expect(crabboxConfig.jobs?.changed?.type).toBe("Standard_D4ads_v6");
|
||||
expect(crabboxConfig.jobs?.changed?.shell).toBe(true);
|
||||
expect(crabboxConfig.jobs?.changed?.command).toContain("set -euo pipefail");
|
||||
@@ -2140,7 +2148,7 @@ describe("package artifact reuse", () => {
|
||||
"uses: openclaw/clawhub/.github/workflows/package-publish.yml@d8096dfc039e86ab942ddf9ef117d04849fd84c1",
|
||||
);
|
||||
expect(clawHubWorkflow).toContain(
|
||||
"family: ${{ contains(fromJson('[\"@openclaw/acpx\",\"@openclaw/diffs\",\"@openclaw/feishu\",\"@openclaw/qqbot\"]'), matrix.plugin.packageName) && 'bundle-plugin' || '' }}",
|
||||
'family: ${{ contains(fromJson(\'["@openclaw/acpx","@openclaw/diffs","@openclaw/feishu","@openclaw/qqbot"]\'), matrix.plugin.packageName) && \'bundle-plugin\' || \'\' }}',
|
||||
);
|
||||
expect(clawHubWorkflow).toContain("dry_run:");
|
||||
expect(clawHubWorkflow).toContain("default: false");
|
||||
|
||||
Reference in New Issue
Block a user