runcloud 0.1.20 → 0.1.21
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/commands/sandbox.js +4 -2
- package/dist/version.js +1 -1
- package/package.json +1 -1
package/dist/commands/sandbox.js
CHANGED
|
@@ -10,6 +10,7 @@ import { printJson, StatusLine, style } from '../terminal.js';
|
|
|
10
10
|
import { noteDeprecated, registerAccessCommands } from './boxAccess.js';
|
|
11
11
|
import { renderSandbox, renderSandboxList, } from './sandboxOutput.js';
|
|
12
12
|
const MAX_SANDBOX_DISK_GIB = 2048;
|
|
13
|
+
const DEFAULT_SANDBOX_TIMEOUT_SECONDS = 300;
|
|
13
14
|
const DEFAULT_BOX_CPU_CORES = 2;
|
|
14
15
|
const DEFAULT_BOX_MEMORY_MIB = 24 * 1024;
|
|
15
16
|
const SANDBOX_POLL_INTERVAL_MS = 1_000;
|
|
@@ -283,7 +284,7 @@ export function registerSandbox(program) {
|
|
|
283
284
|
.option('--memory <mb>', 'memory allocation in MiB', parseMemoryMb)
|
|
284
285
|
.option('--disk <gb>', 'root disk capacity in GiB', parseDiskGb)
|
|
285
286
|
.option('--idle-pause <seconds>', 'pause after inactivity; 0 keeps it running', parseIdlePauseSeconds)
|
|
286
|
-
.option('--timeout <seconds>', 'maximum sandbox lifetime; 0
|
|
287
|
+
.option('--timeout <seconds>', 'maximum sandbox lifetime; defaults to 300, or 0 for persistent sandboxes', parseTimeoutSeconds)
|
|
287
288
|
.option('--persistent', 'never pause when idle (same as --idle-pause 0)', false)
|
|
288
289
|
.option('--expose <port>', 'publish a guest port at <name>-box.run.cloud; implies --persistent', parsePort)
|
|
289
290
|
.option('--secret-group <group>', 'attach a secret group; repeatable and ORDER MATTERS (a later group wins on a name collision)', collectRepeatable, [])
|
|
@@ -315,7 +316,8 @@ export function registerSandbox(program) {
|
|
|
315
316
|
body.memory = memory;
|
|
316
317
|
if (opts.disk !== undefined)
|
|
317
318
|
body.disk = opts.disk;
|
|
318
|
-
|
|
319
|
+
const persistent = exposed || opts.persistent || opts.idlePause === 0;
|
|
320
|
+
body.timeoutSeconds = opts.timeout ?? (persistent ? 0 : DEFAULT_SANDBOX_TIMEOUT_SECONDS);
|
|
319
321
|
if (exposed || opts.persistent)
|
|
320
322
|
body.idlePauseSeconds = 0;
|
|
321
323
|
else if (opts.idlePause !== undefined)
|
package/dist/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const CLI_VERSION = '0.1.
|
|
1
|
+
export const CLI_VERSION = '0.1.21';
|