replicas-cli 0.3.535 → 0.3.537
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +48 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -22638,15 +22638,23 @@ var init_chat_fork = __esm({
|
|
|
22638
22638
|
});
|
|
22639
22639
|
|
|
22640
22640
|
// ../shared/src/credential-refresh.ts
|
|
22641
|
-
var engineCredentialRefreshFailureSchema;
|
|
22641
|
+
var restingCredentialsSchema, engineCredentialRefreshFailureSchema;
|
|
22642
22642
|
var init_credential_refresh = __esm({
|
|
22643
22643
|
"../shared/src/credential-refresh.ts"() {
|
|
22644
22644
|
"use strict";
|
|
22645
22645
|
init_zod();
|
|
22646
22646
|
init_workspace_credentials();
|
|
22647
|
+
init_credentials();
|
|
22648
|
+
restingCredentialsSchema = external_exports.object({
|
|
22649
|
+
count: external_exports.number(),
|
|
22650
|
+
/** Set when every one of them is in this scope. */
|
|
22651
|
+
scope: external_exports.enum(CREDENTIAL_SCOPE).optional(),
|
|
22652
|
+
resetsAt: external_exports.string()
|
|
22653
|
+
});
|
|
22647
22654
|
engineCredentialRefreshFailureSchema = external_exports.object({
|
|
22648
22655
|
code: external_exports.string(),
|
|
22649
|
-
credential: workspaceCredentialSelectionSchema.optional()
|
|
22656
|
+
credential: workspaceCredentialSelectionSchema.optional(),
|
|
22657
|
+
resting: restingCredentialsSchema.optional()
|
|
22650
22658
|
});
|
|
22651
22659
|
}
|
|
22652
22660
|
});
|
|
@@ -24551,7 +24559,7 @@ var init_gpu = __esm({
|
|
|
24551
24559
|
init_compute();
|
|
24552
24560
|
COMPUTE_SANDBOX_WORKDIR = COMPUTE_SANDBOX_WORKDIRS.gpu;
|
|
24553
24561
|
SECTION6 = `### GPU sandboxes
|
|
24554
|
-
Run GPU workloads (training, inference, CUDA builds, rendering) on cloud GPU sandboxes with \`replicas gpu\`. The workspace itself has no GPU.
|
|
24562
|
+
Run GPU workloads (training, inference, CUDA builds, rendering) on cloud GPU sandboxes with \`replicas gpu\`. The workspace itself has no GPU, but GPU sandboxes are available when a task needs one.
|
|
24555
24563
|
|
|
24556
24564
|
**Reference:** \`references/GPU.md\`
|
|
24557
24565
|
|
|
@@ -24589,6 +24597,41 @@ replicas gpu delete
|
|
|
24589
24597
|
- \`--port 8000\` on create exposes a container port as a public HTTPS URL (shown by \`list\`).
|
|
24590
24598
|
- \`--env KEY=value\` passes secrets such as \`HF_TOKEN\`; never bake them into files you push.
|
|
24591
24599
|
|
|
24600
|
+
## GPU-accelerated browser
|
|
24601
|
+
|
|
24602
|
+
The workspace's browser renders WebGL in software. Chrome in a GPU sandbox also uses software rendering unless it gets the flags below. If you need a page rendered on a real GPU, push a production build and serve it inside the sandbox. The sandbox carries no Replicas login, so it can only open a preview URL (\`references/PREVIEWS.md\`) created without \`--authenticated\`, which anyone with the link can open: ask the user before making a private app public that way, and never recreate an existing authenticated preview without the flag. Then run Playwright in a GPU sandbox:
|
|
24603
|
+
|
|
24604
|
+
\`\`\`bash
|
|
24605
|
+
mkdir -p /tmp/gpu-browser && cd /tmp/gpu-browser
|
|
24606
|
+
cat > fps.mjs <<'EOF'
|
|
24607
|
+
import { chromium } from 'playwright';
|
|
24608
|
+
import { mkdirSync } from 'node:fs';
|
|
24609
|
+
// Without these flags Chrome falls back to SwiftShader, a software renderer.
|
|
24610
|
+
const browser = await chromium.launch({ args: ['--use-angle=vulkan', '--enable-features=Vulkan', '--ignore-gpu-blocklist'] });
|
|
24611
|
+
const page = await browser.newPage({ viewport: { width: 1280, height: 720 } });
|
|
24612
|
+
await page.goto(process.argv[2], { waitUntil: 'networkidle' });
|
|
24613
|
+
const result = await page.evaluate(async () => {
|
|
24614
|
+
const gl = document.createElement('canvas').getContext('webgl');
|
|
24615
|
+
const info = gl?.getExtension('WEBGL_debug_renderer_info');
|
|
24616
|
+
const renderer = info ? gl.getParameter(info.UNMASKED_RENDERER_WEBGL) : 'no WebGL';
|
|
24617
|
+
const frames = [];
|
|
24618
|
+
await new Promise((done) => {
|
|
24619
|
+
const tick = (t) => { frames.push(t); frames.at(-1) - frames[0] < 5000 ? requestAnimationFrame(tick) : done(); };
|
|
24620
|
+
requestAnimationFrame(tick);
|
|
24621
|
+
});
|
|
24622
|
+
const gaps = frames.slice(1).map((t, i) => t - frames[i]).sort((a, b) => a - b);
|
|
24623
|
+
return { renderer, fps: Math.round((frames.length - 1) / 5), p95FrameMs: Math.round(gaps[Math.floor(gaps.length * 0.95)]) };
|
|
24624
|
+
});
|
|
24625
|
+
console.log(JSON.stringify(result));
|
|
24626
|
+
mkdirSync('outputs', { recursive: true });
|
|
24627
|
+
await page.screenshot({ path: 'outputs/frame.png' });
|
|
24628
|
+
await browser.close();
|
|
24629
|
+
EOF
|
|
24630
|
+
replicas gpu run --image mcr.microsoft.com/playwright:v1.49.0-noble --pull outputs -- "npm i playwright@1.49.0 >/dev/null && node fps.mjs https://<preview-url>/<page>"
|
|
24631
|
+
\`\`\`
|
|
24632
|
+
|
|
24633
|
+
Check that \`renderer\` names the NVIDIA GPU; one naming SwiftShader means the page ran in software. \`fps\` counts the browser's frame callbacks, which is the most the page can draw; a game that skips frames draws fewer, so read its own frame counter (or count calls to its render function) when it has one. Add the interactions the page needs (clicks, waits for a scene to load) before measuring, and keep the Playwright package version matching the image tag.
|
|
24634
|
+
|
|
24592
24635
|
## Choosing hardware and images
|
|
24593
24636
|
|
|
24594
24637
|
- GPUs, picked with \`--gpu\`: ${GPU_TYPES.join(", ")} (default ${DEFAULT_GPU_TYPE}). Add a count for multi-GPU, e.g. \`H100:4\` (max ${COMPUTE_SANDBOX_LIMITS.maxGpuCount}). Pick the smallest GPU that fits: T4/L4 for small models and smoke tests, A100/H100 for real training.
|
|
@@ -24605,7 +24648,7 @@ replicas gpu delete
|
|
|
24605
24648
|
GPU_ABILITY = {
|
|
24606
24649
|
label: "GPU sandboxes",
|
|
24607
24650
|
description: "Run training, inference, and other GPU workloads on cloud GPUs with `replicas gpu`.",
|
|
24608
|
-
bullet: "- Running GPU workloads (training, inference, CUDA, rendering) on cloud GPU sandboxes with `replicas gpu`",
|
|
24651
|
+
bullet: "- Running GPU workloads (training, inference, CUDA, rendering) on cloud GPU sandboxes with `replicas gpu` (this workspace has no GPU of its own)",
|
|
24609
24652
|
section: SECTION6,
|
|
24610
24653
|
referenceFile: { name: "GPU.md", content: REFERENCE6 }
|
|
24611
24654
|
};
|
|
@@ -40337,7 +40380,7 @@ var CLI_VERSION;
|
|
|
40337
40380
|
var init_cli_version = __esm({
|
|
40338
40381
|
"../shared/src/cli-version.ts"() {
|
|
40339
40382
|
"use strict";
|
|
40340
|
-
CLI_VERSION = "0.3.
|
|
40383
|
+
CLI_VERSION = "0.3.537";
|
|
40341
40384
|
}
|
|
40342
40385
|
});
|
|
40343
40386
|
|