cassian-cli 0.3.5 → 0.3.6
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/init.d.ts +0 -1
- package/dist/commands/init.js +7 -10
- package/dist/commands/up.js +4 -4
- package/dist/index.js +0 -2
- package/dist/types.d.ts +1 -1
- package/package.json +1 -1
package/dist/commands/init.d.ts
CHANGED
package/dist/commands/init.js
CHANGED
|
@@ -64,8 +64,7 @@ function promptChoice(rl, question, choices, fallback) {
|
|
|
64
64
|
});
|
|
65
65
|
}
|
|
66
66
|
function buildYaml(opts) {
|
|
67
|
-
const
|
|
68
|
-
? `\nstorage:\n${opts.storage.map(p => ` - ${p}`).join("\n")}\n` : "";
|
|
67
|
+
const storageLine = opts.storage ? "\nstorage: true\n" : "";
|
|
69
68
|
const excludeLines = opts.exclude.length
|
|
70
69
|
? `\nworkspace:\n exclude:\n${opts.exclude.map(p => ` - "${p}"`).join("\n")}\n` : "";
|
|
71
70
|
return `name: ${opts.name}
|
|
@@ -75,7 +74,7 @@ gpu:
|
|
|
75
74
|
type: ${opts.gpuType}
|
|
76
75
|
|
|
77
76
|
disk: ${opts.diskSize}
|
|
78
|
-
${
|
|
77
|
+
${storageLine}${excludeLines}`;
|
|
79
78
|
}
|
|
80
79
|
export async function init(options = {}) {
|
|
81
80
|
if (existsSync("cassian.yaml")) {
|
|
@@ -89,7 +88,7 @@ export async function init(options = {}) {
|
|
|
89
88
|
gpuType: options.gpu || "rtx3090",
|
|
90
89
|
gpuCount: parseInt(options.gpuCount || "1"),
|
|
91
90
|
diskSize: options.disk || "50G",
|
|
92
|
-
storage:
|
|
91
|
+
storage: true,
|
|
93
92
|
exclude: ["node_modules/", ".venv/", "__pycache__/", "*.pyc", "wandb/"],
|
|
94
93
|
});
|
|
95
94
|
writeFileSync("cassian.yaml", yaml);
|
|
@@ -127,12 +126,10 @@ export async function init(options = {}) {
|
|
|
127
126
|
{ label: "500 GB", value: "500G" },
|
|
128
127
|
], "50G");
|
|
129
128
|
console.log();
|
|
130
|
-
console.log(dim("
|
|
131
|
-
console.log(dim("
|
|
132
|
-
const
|
|
133
|
-
const storage =
|
|
134
|
-
? storageRaw.split(",").map(s => s.trim().replace(/\/+$/, "/")).filter(Boolean)
|
|
135
|
-
: [];
|
|
129
|
+
console.log(dim(" Cloud storage gives you unlimited persistent space at /workspace/storage"));
|
|
130
|
+
console.log(dim(" Great for datasets, model weights, and large files"));
|
|
131
|
+
const storageAnswer = await prompt(rl, ` Enable cloud storage? ${dim("[Y/n]")}: `, "Y");
|
|
132
|
+
const storage = storageAnswer.toLowerCase() !== "n";
|
|
136
133
|
console.log();
|
|
137
134
|
console.log(dim(" Folders to exclude (build artifacts, can be recreated)"));
|
|
138
135
|
const excludeRaw = await prompt(rl, ` Exclude ${dim("[node_modules/, .venv/, __pycache__/, *.pyc, wandb/]")}: `, "");
|
package/dist/commands/up.js
CHANGED
|
@@ -58,10 +58,10 @@ export async function up() {
|
|
|
58
58
|
info("Disk", config.disk);
|
|
59
59
|
}
|
|
60
60
|
else if (config.volumes?.length) {
|
|
61
|
-
info("
|
|
61
|
+
info("Disk", config.volumes.map((v) => `${v.size} at ${v.mount}`).join(", "));
|
|
62
62
|
}
|
|
63
|
-
if (config.storage
|
|
64
|
-
info("Storage",
|
|
63
|
+
if (config.storage) {
|
|
64
|
+
info("Storage", "enabled (/workspace/storage)");
|
|
65
65
|
}
|
|
66
66
|
console.log();
|
|
67
67
|
const vm = dev.vm;
|
|
@@ -125,7 +125,7 @@ export async function up() {
|
|
|
125
125
|
},
|
|
126
126
|
workspace: {
|
|
127
127
|
no_sync: config.workspace?.no_sync || [],
|
|
128
|
-
storage: config.storage
|
|
128
|
+
storage: config.storage === true ? ["storage"] : (Array.isArray(config.storage) ? config.storage : config.workspace?.storage || []),
|
|
129
129
|
exclude: config.workspace?.exclude || config.workspace?.syncignore || [],
|
|
130
130
|
},
|
|
131
131
|
});
|
package/dist/index.js
CHANGED
|
@@ -88,14 +88,12 @@ program
|
|
|
88
88
|
.option("--gpu <type>", "GPU type (e.g. h100-sxm, a100-sxm, rtx3090)")
|
|
89
89
|
.option("--gpu-count <n>", "Number of GPUs")
|
|
90
90
|
.option("--disk <size>", "Disk size (e.g. 50G, 200G)")
|
|
91
|
-
.option("--storage <folders>", "Comma-separated storage folders (e.g. datasets/,models/)")
|
|
92
91
|
.option("-y, --yes", "Skip all prompts, use defaults")
|
|
93
92
|
.action((opts) => init({
|
|
94
93
|
name: opts.name,
|
|
95
94
|
gpu: opts.gpu,
|
|
96
95
|
gpuCount: opts.gpuCount,
|
|
97
96
|
disk: opts.disk,
|
|
98
|
-
storage: opts.storage,
|
|
99
97
|
yes: opts.yes,
|
|
100
98
|
}));
|
|
101
99
|
program.parse();
|
package/dist/types.d.ts
CHANGED