trainfabric 0.1.14 → 0.1.16

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.
Files changed (2) hide show
  1. package/dist/index.cjs +14 -6
  2. package/package.json +1 -1
package/dist/index.cjs CHANGED
@@ -8799,11 +8799,16 @@ var import_node_fs = __toESM(require("node:fs"), 1);
8799
8799
  var import_node_os = __toESM(require("node:os"), 1);
8800
8800
  var import_node_path2 = __toESM(require("node:path"), 1);
8801
8801
  function collectRuntimeFiles(repoPath) {
8802
- const candidates = ["training.yaml", "train.runtime.yaml", "pyproject.toml", "requirements.txt", "environment.yml", "Dockerfile", "train.py"];
8802
+ const manifestFiles = /* @__PURE__ */ new Set(["training.yaml", "train.runtime.yaml", "pyproject.toml", "requirements.txt", "environment.yml", "Dockerfile"]);
8803
8803
  const ignoredDirectories = /* @__PURE__ */ new Set([".git", ".hg", ".svn", "node_modules", ".venv", "venv", "__pycache__", ".mypy_cache", ".pytest_cache", "dist", "build"]);
8804
8804
  const found = [];
8805
+ const maxFiles = 256;
8806
+ const maxFileBytes = 256 * 1024;
8807
+ function shouldIncludeFile(fileName) {
8808
+ return manifestFiles.has(fileName) || fileName.endsWith(".py");
8809
+ }
8805
8810
  function walk(currentPath) {
8806
- if (found.length >= 64) {
8811
+ if (found.length >= maxFiles) {
8807
8812
  return;
8808
8813
  }
8809
8814
  for (const entry of import_node_fs.default.readdirSync(currentPath, { withFileTypes: true })) {
@@ -8815,11 +8820,11 @@ function collectRuntimeFiles(repoPath) {
8815
8820
  }
8816
8821
  continue;
8817
8822
  }
8818
- if (!entry.isFile() || !candidates.includes(entry.name)) {
8823
+ if (!entry.isFile() || !shouldIncludeFile(entry.name)) {
8819
8824
  continue;
8820
8825
  }
8821
8826
  const stat = import_node_fs.default.statSync(absolute);
8822
- if (stat.size > 256 * 1024) {
8827
+ if (stat.size > maxFileBytes) {
8823
8828
  continue;
8824
8829
  }
8825
8830
  found.push({
@@ -8922,7 +8927,7 @@ function buildComputeSpec(options) {
8922
8927
 
8923
8928
  // src/index.ts
8924
8929
  var DEFAULT_TRAINFABRIC_API_URL2 = "https://api.trainfabric.com";
8925
- var CLI_VERSION = "0.1.14";
8930
+ var CLI_VERSION = "0.1.16";
8926
8931
  var CONFIG_DIR = import_node_path3.default.join(import_node_os2.default.homedir(), ".trainfabric");
8927
8932
  var CONFIG_PATH = import_node_path3.default.join(CONFIG_DIR, "config.json");
8928
8933
  var FALLBACK_SECRET_PATH = import_node_path3.default.join(CONFIG_DIR, "session.enc");
@@ -9292,6 +9297,9 @@ function assertQuoteOptions(bundle, options) {
9292
9297
  return;
9293
9298
  }
9294
9299
  const constraints = [];
9300
+ if (options.mode) {
9301
+ constraints.push(`mode=${options.mode}`);
9302
+ }
9295
9303
  if (options.accelerator) {
9296
9304
  constraints.push(`accelerator=${options.accelerator}`);
9297
9305
  }
@@ -9304,7 +9312,7 @@ function assertQuoteOptions(bundle, options) {
9304
9312
  throw new Error(
9305
9313
  `No quote options were returned for the requested run under the current hardware constraints (${constraints.join(
9306
9314
  ", "
9307
- )}). Omit --accelerator or increase --min-memory.`
9315
+ )}). Try a different --mode, omit --accelerator, adjust --min-memory if it excludes available GPUs, or retry when capacity changes.`
9308
9316
  );
9309
9317
  }
9310
9318
  function filterQuoteBundleForRequestedMode(bundle, options) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "trainfabric",
3
- "version": "0.1.14",
3
+ "version": "0.1.16",
4
4
  "description": "Trainfabric CLI for launching GPU training jobs on the hosted Trainfabric backend.",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs",