envloop-cli 2.1.0__py3-none-any.whl → 2.3.1__py3-none-any.whl

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.
envloop/cli_errors.py CHANGED
@@ -56,7 +56,7 @@ _register("RUNNER_PACKAGE_INVALID", "The Runner package directory is invalid. It
56
56
  _register("RUNNER_REVISION_INVALID", "Use the full lowercase 40- or 64-character source commit, or a local branch or tag name, as --revision and a NAMESPACE/NAME Runner name.")
57
57
  _register("RUNNER_REVISION_UNRESOLVED", "--revision names no local branch or tag in the Git checkout that holds DIRECTORY, or Git is unavailable. Fetch or create the branch, or pass the full source commit.")
58
58
  _register("RUNNER_PACKAGE_UNCOMMITTED", "DIRECTORY differs from the --revision commit: it has uncommitted changes, untracked files or ignored files, all of which would be published. Commit or remove them, or pass a full commit you vouch for.")
59
- _register("RUNNER_SOURCE_REF_INVALID", "Use a branch or tag name such as main or v1 with --source-ref-kind branch, tag or commit; HEAD, latest, default, release, '..', spaces and ~^:?*[\\ are not allowed.")
59
+ _register("RUNNER_COMMIT_METADATA_INVALID", "Git author and message must be single-line text of at most 256 and 4096 characters, respectively.")
60
60
  _register("RUNNER_REVISION_CONFLICT", "The platform catalog holds different package or index hashes for this Runner revision. Publish a new revision instead of changing an existing one.")
61
61
  _register("RECIPE_PACKAGE_INVALID RECIPE_DECLARATION_INVALID RECIPE_INVALID", "--directory must hold recipe.toml with schema_version = \"envloop.recipe/v3\" and the tables [recipe] name, types; [runner] name, abi; [source] paths, optional exclude and optional repository (a https://github.com/OWNER/REPO URL if given; omit it for a local-only repository); optional [inputs], [params], [outputs] and [dependencies]. No other top-level tables or keys are allowed.")
62
62
  _register("RECIPE_PACKAGE_SCHEMA_RETIRED", "recipe.toml uses the retired envloop.recipe-publication/v3 format. Rewrite it as schema_version = \"envloop.recipe/v3\" with [recipe], [runner] and [source] tables and add entrypoint.sh next to it; published Recipes stay readable.")
envloop_asset/assets.py CHANGED
@@ -9,9 +9,10 @@ from envloop.http import RemoteError, WaitTimeoutError
9
9
  KINDS = ('dataset', 'checkpoint', 'recipe', 'profile')
10
10
 
11
11
 
12
- def precise_ref(ref: str) -> str:
12
+ def precise_ref(ref: str, *, allow_name: bool = False) -> str:
13
13
  if (not isinstance(ref, str) or not ref or len(ref) > 8192 or any(ord(c) < 32 for c in ref)
14
- or '/' in ref and not ref.startswith('envloop://') and ('@' not in ref or not ref.rpartition('@')[2])):
14
+ or '/' in ref and not ref.startswith('envloop://') and (
15
+ '@' not in ref and not allow_name or '@' in ref and not ref.rpartition('@')[2])):
15
16
  raise ValueError('REF must be an opaque resource ID or a name with an explicit version (NAME@VERSION)')
16
17
  return ref
17
18
 
@@ -89,7 +90,7 @@ class Assets:
89
90
  def get(self, ref: str, *, type: str | None = None) -> dict[str, Any]:
90
91
  if type not in (None, *KINDS):
91
92
  raise ValueError('select a user asset type')
92
- path = scope(self.transport) + '/assets/' + quote(precise_ref(ref), safe='')
93
+ path = scope(self.transport) + '/assets/' + quote(precise_ref(ref, allow_name=type in ('recipe', 'profile')), safe='')
93
94
  value = envelope(self.transport.request('GET', path + ('?' + urlencode({'type': type}) if type else '')))
94
95
  if value['asset'] is None or value['asset'].get('type') not in KINDS or type is not None and value['asset'].get('type') != type:
95
96
  raise RemoteError('INVALID_RESPONSE')
@@ -46,8 +46,8 @@ def list_layout(items: list[dict[str, Any]], args: argparse.Namespace) -> tuple[
46
46
  # Like el dataset list: STATUS / UNAVAILABLE REASON appear when the page reports them, so a
47
47
  # Revision that differs between shared copies (RUNNER_REVISION_AMBIGUOUS) is visible in the table.
48
48
  states = tuple(field for field in ('status', 'unavailable_reason') if any(field in item for item in items))
49
- headers = ('NAME', 'REVISION', 'SOURCE REF', 'VISIBILITY', *(field.replace('_', ' ').upper() for field in states), *LIFECYCLE)
50
- render = lambda item: (item.get('name'), item.get('revision'), item.get('source_ref'),
49
+ headers = ('NAME', 'REVISION', 'AUTHOR', 'MESSAGE', 'VISIBILITY', *(field.replace('_', ' ').upper() for field in states), *LIFECYCLE)
50
+ render = lambda item: (item.get('name'), item.get('revision'), item.get('author'), item.get('message'),
51
51
  item.get('visibility'), *(item.get(field) for field in states), *lifecycle(item))
52
52
  empty = 'No runners found.'
53
53
  elif args.group == 'dataset' and args.action == 'list':
envloop_asset/client.py CHANGED
@@ -252,7 +252,7 @@ class Runners:
252
252
  return self._server.list_runners(limit=limit, cursor=cursor)
253
253
 
254
254
  def get(self, asset_id: str):
255
- """Read a Runner Asset resource by ID or immutable ANS URI."""
255
+ """Read a Runner by ID, fixed URI or registered NAME[@REVISION]; the API resolves latest."""
256
256
  from envloop_asset.execution_content import ExecutionContent
257
257
  resource = ExecutionContent(self._server, 'runner').get(asset_id)
258
258
  if resource.get('type') != 'runner':
@@ -281,32 +281,29 @@ class Runners:
281
281
  from .execution_content import ExecutionContent
282
282
  return download_content(ExecutionContent(self._server,'runner'),ref,output,file_id=file_id,**selection)
283
283
 
284
- def create(self, directory: str | Path, *, revision: str, name: str | None = None,
285
- executables: Sequence[str] | None = None, source_ref: str | None = None,
286
- source_ref_kind: str = 'branch', dry_run: bool = False):
284
+ def create(self, directory: str | Path, *, revision: str = 'main', name: str | None = None,
285
+ executables: Sequence[str] | None = None, dry_run: bool = False):
287
286
  """Create an immutable Runner revision from a local package directory."""
288
287
  return self._publish(directory, revision=revision, name=name, executables=executables,
289
- source_ref=source_ref, source_ref_kind=source_ref_kind, dry_run=dry_run)
288
+ dry_run=dry_run)
290
289
 
291
- def update(self, asset_id: str, directory: str | Path, *, revision: str, name: str | None = None,
292
- executables: Sequence[str] | None = None, source_ref: str | None = None,
293
- source_ref_kind: str = 'branch', dry_run: bool = False):
290
+ def update(self, asset_id: str, directory: str | Path, *, revision: str = 'main', name: str | None = None,
291
+ executables: Sequence[str] | None = None, dry_run: bool = False):
294
292
  """Publish a new immutable revision of the same Runner, preserving historical bytes."""
295
293
  return self._publish(directory, revision=revision, name=name, executables=executables,
296
- source_ref=source_ref, source_ref_kind=source_ref_kind, dry_run=dry_run, asset_id=asset_id)
294
+ dry_run=dry_run, asset_id=asset_id)
297
295
 
298
296
  def _publish(self, directory: str | Path, *, revision: str, name: str | None = None,
299
- executables: Sequence[str] | None = None, source_ref: str | None = None,
300
- source_ref_kind: str = 'branch', dry_run: bool = False, asset_id: str | None = None):
297
+ executables: Sequence[str] | None = None, dry_run: bool = False, asset_id: str | None = None):
301
298
  """Publish a Runner package directory as the immutable revision NAME@REVISION.
302
299
 
303
300
  This is the Runner domain publication API with the native manifest built
304
301
  from `directory` (runner.toml plus its main.py or main.sh entrypoint): the
305
302
  platform stores the bytes, derives the package and index SHA-256, creates the
306
303
  Runner asset on first use and registers the revision. `revision` is the full
307
- source commit. `source_ref` (for example `main`) then points that name at the
308
- revision through POST /v1/runners/{name}/revisions, so `NAME@main` resolves to
309
- it. Returns `{'asset': publication, 'runner': catalog revision}`; a dry run
304
+ source commit or a local branch/tag, resolved once to its full commit. Branch
305
+ and tag names remain selectable after registration. Author and message
306
+ come from this commit; a detached package leaves unknown metadata empty. Returns `{'asset': publication, 'runner': catalog revision}`; a dry run
310
307
  returns the server's validation result without publishing.
311
308
  """
312
309
  from envloop.http import RemoteError
@@ -314,15 +311,22 @@ class Runners:
314
311
  from envloop_asset.runner_packages import (
315
312
  REFERENCE_KEYS,
316
313
  REVISION,
317
- SOURCE_REF_KINDS,
314
+ commit_metadata,
315
+ resolve_source_revision,
318
316
  runner_package,
319
- source_ref_valid,
320
317
  )
321
318
 
322
- if not isinstance(revision, str) or not REVISION.fullmatch(revision) or name is not None and not isinstance(name, str):
319
+ if not isinstance(revision, str) or name is not None and not isinstance(name, str):
323
320
  raise RemoteError('RUNNER_REVISION_INVALID')
324
- if source_ref is not None and (not source_ref_valid(source_ref) or source_ref_kind not in SOURCE_REF_KINDS):
325
- raise RemoteError('RUNNER_SOURCE_REF_INVALID')
321
+ requested_revision = None
322
+ if not REVISION.fullmatch(revision):
323
+ if len(revision) >= 40 and all(character in '0123456789abcdefABCDEF' for character in revision):
324
+ raise RemoteError('RUNNER_REVISION_INVALID')
325
+ selected = revision
326
+ revision, kind = resolve_source_revision(directory, selected)
327
+ prefix = 'refs/heads/' if kind == 'branch' else 'refs/tags/'
328
+ requested_revision = selected if selected.startswith(prefix) else prefix + selected
329
+ metadata = commit_metadata(directory, revision)
326
330
  name, manifest, files, executables = runner_package(directory, name=name, executables=executables)
327
331
  ref = f'envloop://runners/{name}@{revision}'
328
332
  data = ExecutionContent(self._server, 'runner')
@@ -339,11 +343,11 @@ class Runners:
339
343
  or any(not isinstance(pinned.get(key), str) for key in REFERENCE_KEYS)):
340
344
  raise RemoteError('INVALID_RESPONSE')
341
345
  reference = {key: pinned[key] for key in REFERENCE_KEYS}
342
- if source_ref is None:
346
+ if requested_revision is None and not metadata:
343
347
  runner = self._server.get_runner_revision(name, revision)
344
348
  else:
345
349
  runner = self._server.register_runner_revision(
346
- name, {**reference, 'source_ref': source_ref, 'source_ref_kind': source_ref_kind})
350
+ name, {**reference, **metadata, **({'requested_revision': requested_revision} if requested_revision else {})})
347
351
  # Both catalog views must name the same stored bytes.
348
352
  if not isinstance(runner, dict) or any(runner.get(key) != value for key, value in reference.items()):
349
353
  raise RemoteError('RUNNER_REVISION_CONFLICT')
@@ -16,6 +16,11 @@ class ExecutionContent(AssetTransfer):
16
16
  path = scope(self.transport) + ('/runners' if self.kind == 'runner' else '/trials/artifacts')
17
17
  return path if asset_id is None else path + '/' + quote(precise_ref(asset_id),safe='')
18
18
 
19
+ @override
20
+ def get(self, asset_id: str) -> dict[str, Any]:
21
+ ref = precise_ref(asset_id, allow_name=self.kind == 'runner')
22
+ return self.transport.request('GET', self._path() + '/' + quote(ref, safe=''))
23
+
19
24
  @override
20
25
  def list(self, *, type: Any = None, **filters: Any) -> dict[str, Any]:
21
26
  if type not in (None,self.kind):
@@ -12,7 +12,7 @@ from pathlib import Path
12
12
  from typing import Any
13
13
 
14
14
  from envloop.http import RemoteError
15
- from envloop_asset.runner_packages import REVISION, source_ref_valid
15
+ from envloop_asset.runner_packages import REVISION, revision_valid
16
16
 
17
17
  DECLARATION = 'recipe.toml'
18
18
  GIT_TIMEOUT = 60
@@ -56,7 +56,7 @@ class _Repository:
56
56
  if found.returncode == 0 and found.stdout.decode().strip() == ref:
57
57
  return ref, 'commit'
58
58
  raise RemoteError('RECIPE_REVISION_UNRESOLVED')
59
- if not source_ref_valid(ref):
59
+ if not revision_valid(ref):
60
60
  raise RemoteError('RECIPE_REVISION_INVALID')
61
61
  for kind, prefix in (('branch', 'refs/heads/'), ('tag', 'refs/tags/')):
62
62
  found = self.git('rev-parse', '--verify', '--quiet', f'{prefix}{ref}^{{commit}}')
@@ -26,8 +26,11 @@ def add_resource_commands(groups: "argparse._SubParsersAction[argparse.ArgumentP
26
26
  if kind == 'checkpoint':
27
27
  command.add_argument('--job-id')
28
28
  command.add_argument('--trial-id')
29
- command = actions.add_parser('get', help='Read one exact version without downloading files')
30
- command.add_argument('ref', metavar='REF', help=DATASET_REF_HELP if kind == 'dataset' else None)
29
+ command = actions.add_parser('get', help='Read a version without downloading files')
30
+ command.add_argument('ref', metavar='REF', help=(DATASET_REF_HELP if kind == 'dataset' else
31
+ 'NAME, NAME@latest, NAME@VERSION, opaque asset ID or fixed ANS URI; '
32
+ 'omitted version selects the newest accessible publication'
33
+ if kind in ('recipe', 'profile') else None))
31
34
  command.add_argument('--json', action='store_true')
32
35
  for action in ('create','update'):
33
36
  command = actions.add_parser(action, help='Create an immutable version' if action == 'create' else 'Publish a new version from an owned exact source')
@@ -141,7 +144,9 @@ def add_runner_commands(groups: "argparse._SubParsersAction[argparse.ArgumentPar
141
144
  command.add_argument('--ref')
142
145
  for action in ('get','delete'):
143
146
  command = actions.add_parser(action)
144
- command.add_argument('asset_id', metavar='RUNNER_REF')
147
+ command.add_argument('asset_id', metavar='RUNNER_REF',
148
+ help=('Runner ID, fixed ANS URI or NAME[@REVISION]; omitted revision and @latest select the newest accessible publication'
149
+ if action == 'get' else 'Runner ID, fixed ANS URI or NAME@REVISION'))
145
150
  if action == 'delete':
146
151
  command.add_argument('--dry-run', action='store_true')
147
152
  command.add_argument('--json', action='store_true')
@@ -300,10 +305,6 @@ def runner_package_arguments(command: argparse.ArgumentParser):
300
305
  command.add_argument('--name', help='NAMESPACE/NAME; must equal [runner] name in runner.toml (default: that name)')
301
306
  command.add_argument('--executable', action='append', dest='executables', metavar='PATH',
302
307
  help='Declare an executable file; repeat for each. Default: files with an execute bit')
303
- command.add_argument('--source-ref', metavar='REF', help='Also point this branch or tag name (for example main) at the revision, '
304
- 'so NAME@REF resolves to it (default: the branch or tag given as --revision)')
305
- command.add_argument('--source-ref-kind', choices=['branch', 'tag', 'commit'],
306
- help='Kind of --source-ref (default: branch, or the kind of the --revision branch or tag)')
307
308
  command.add_argument('--dry-run', action='store_true', help='Validate the package and authorization without publishing')
308
309
 
309
310
 
@@ -323,26 +324,20 @@ def publish_runner(client: Any, args: argparse.Namespace):
323
324
  import sys
324
325
 
325
326
  from envloop.http import RemoteError
326
- from envloop_asset.runner_packages import REVISION, resolve_source_revision
327
+ from envloop_asset.runner_packages import REVISION
327
328
 
328
- revision, source_ref, source_ref_kind = args.revision, args.source_ref, args.source_ref_kind
329
- if not REVISION.fullmatch(revision):
330
- revision, kind = resolve_source_revision(args.directory, args.revision)
331
- if source_ref is None:
332
- source_ref, source_ref_kind = args.revision, kind
333
- print(f'resolved {kind} {args.revision} to {revision}', file=sys.stderr)
334
329
  try:
335
330
  operation = client.runners.create if args.action == 'create' else client.runners.update
336
331
  positional = (args.directory,) if args.action == 'create' else (args.asset_id, args.directory)
337
- result = operation(*positional, revision=revision, name=args.name,
338
- executables=args.executables, source_ref=source_ref,
339
- source_ref_kind=source_ref_kind or 'branch', dry_run=args.dry_run)
332
+ result = operation(*positional, revision=args.revision, name=args.name,
333
+ executables=args.executables, dry_run=args.dry_run)
340
334
  except RemoteError as error:
341
335
  if error.code in {'ACCESS_DENIED', 'ASSET_ACCESS_REQUIRED'} and not error.hint:
342
336
  error.hint = RUNNER_WRITE_HINT
343
337
  raise
344
338
  if not args.dry_run:
345
339
  runner = result['runner']
346
- moved = f"; {runner['source_ref']} now resolves to it" if runner.get('source_ref') else ''
347
- print(f"{'created' if args.action == 'create' else 'updated'} {runner['uri']} (package sha256 {runner['sha256']}){moved}", file=sys.stderr)
340
+ if not REVISION.fullmatch(args.revision):
341
+ print(f'resolved revision {args.revision} to {runner["revision"]}', file=sys.stderr)
342
+ print(f"{'created' if args.action == 'create' else 'updated'} {runner['uri']} (package sha256 {runner['sha256']})", file=sys.stderr)
348
343
  return result
@@ -15,13 +15,12 @@ from envloop.http import RemoteError
15
15
  NAME = re.compile(r'[a-zA-Z0-9][a-zA-Z0-9._-]*/[a-zA-Z0-9][a-zA-Z0-9._-]*')
16
16
  REVISION = re.compile(r'[a-f0-9]{40}|[a-f0-9]{64}')
17
17
  SEGMENT = re.compile(r'[A-Za-z0-9_][A-Za-z0-9_.-]*')
18
- SOURCE_REF_KINDS = ('branch', 'tag', 'commit')
19
18
  MAX_FILES = 100
20
19
  MAX_BYTES = 8 * 1024 * 1024
21
20
  REFERENCE_KEYS = ('uri', 'name', 'revision', 'sha256', 'index_sha256')
22
21
 
23
22
 
24
- def source_ref_valid(value: Any) -> bool:
23
+ def revision_valid(value: Any) -> bool:
25
24
  return (isinstance(value, str) and bool(value) and value not in ('HEAD', 'latest', 'default', 'release')
26
25
  and not re.search(r'@\{|[~^:?*\[\\\s]', value) and '..' not in value and not value.startswith('-'))
27
26
 
@@ -88,7 +87,7 @@ def resolve_source_revision(directory: str | Path, ref: str) -> tuple[str, str]:
88
87
  the bytes of that commit: tracked changes, untracked files and ignored files
89
88
  are refused rather than published under the commit's name.
90
89
  """
91
- if not source_ref_valid(ref):
90
+ if not revision_valid(ref):
92
91
  raise RemoteError('RUNNER_REVISION_INVALID')
93
92
  root = Path(directory).absolute()
94
93
  if root.is_symlink() or not root.is_dir():
@@ -101,7 +100,10 @@ def resolve_source_revision(directory: str | Path, ref: str) -> tuple[str, str]:
101
100
  raise RemoteError('RUNNER_REVISION_UNRESOLVED') from None
102
101
 
103
102
  for kind, prefix in (('branch', 'refs/heads/'), ('tag', 'refs/tags/')):
104
- resolved = git('rev-parse', '--verify', '--quiet', f'{prefix}{ref}^{{commit}}')
103
+ if ref.startswith(('refs/heads/', 'refs/tags/')) and not ref.startswith(prefix):
104
+ continue
105
+ selector = ref if ref.startswith(prefix) else prefix + ref
106
+ resolved = git('rev-parse', '--verify', '--quiet', f'{selector}^{{commit}}')
105
107
  if resolved.returncode == 0 and REVISION.fullmatch(commit := resolved.stdout.strip()):
106
108
  break
107
109
  else:
@@ -111,3 +113,24 @@ def resolve_source_revision(directory: str | Path, ref: str) -> tuple[str, str]:
111
113
  if changed.returncode != 0 or extra.returncode != 0 or extra.stdout.strip():
112
114
  raise RemoteError('RUNNER_PACKAGE_UNCOMMITTED')
113
115
  return commit, kind
116
+
117
+
118
+ def commit_metadata(directory: str | Path, revision: str) -> dict[str, str]:
119
+ """Read display metadata from the selected commit; a detached package has none."""
120
+ try:
121
+ result = subprocess.run(['git', '-C', str(Path(directory).absolute()), 'show', '--no-patch',
122
+ '--no-notes', '--format=%an%x00%s', revision, '--'],
123
+ capture_output=True, text=True, errors='replace', timeout=30)
124
+ except (OSError, subprocess.TimeoutExpired):
125
+ return {}
126
+ if result.returncode != 0:
127
+ return {}
128
+ values = result.stdout.rstrip('\n').split('\x00', 1)
129
+ if len(values) != 2:
130
+ return {}
131
+ metadata = dict(zip(('author', 'message'), values, strict=True))
132
+ for key, limit in (('author', 256), ('message', 4096)):
133
+ value = metadata[key]
134
+ if len(value) > limit or re.search(r'[\x00-\x1f\x7f]', value):
135
+ raise RemoteError('RUNNER_COMMIT_METADATA_INVALID')
136
+ return {key: value for key, value in metadata.items() if value.strip()}
envloop_asset/transfer.py CHANGED
@@ -353,13 +353,15 @@ class AssetTransfer:
353
353
  # keep one materialization coordinator. Older Hub readers are serial.
354
354
  materialization_options: dict[str, Any] = (
355
355
  {'max_workers': 1} if 'max_workers' in inspect.signature(download_directory).parameters else {})
356
+ materialization_options.update({'config': config} if config is not None else {})
357
+ materialization_options.update(task_selection)
356
358
  materialize_started = time.perf_counter()
357
359
  materialize_cpu_started = time.thread_time()
358
360
  query_count = len(timings['queries'])
359
361
  validation_before_materialize = timings['plan_validation_seconds']
360
362
  try:
361
363
  target = download_directory(plan, Path(destination), uri=uri, split=split, content_digest=content_digest, read_url=read,
362
- **materialization_options, **({'config': config} if config is not None else {}), **task_selection)
364
+ **materialization_options)
363
365
  except (ANSError, InvalidManifest, ValueError, TypeError, KeyError):
364
366
  raise RemoteError('ASSET_INTEGRITY_FAILED', 409) from None
365
367
  finally:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: envloop-cli
3
- Version: 2.1.0
3
+ Version: 2.3.1
4
4
  Summary: EnvLoop CLI and Python SDK for jobs, training, checkpoints and inference
5
5
  Project-URL: Homepage, https://envloop.ai
6
6
  Project-URL: Documentation, https://docs.envloop.ai
@@ -10,7 +10,7 @@ Project-URL: Agent instructions, https://docs.envloop.ai/skill.md
10
10
  Requires-Python: >=3.12
11
11
  Provides-Extra: asset
12
12
  Requires-Dist: boto3==1.44.3; extra == 'asset'
13
- Requires-Dist: envloop-envhub==1.23.0; extra == 'asset'
13
+ Requires-Dist: envloop-envhub==2.3.1; extra == 'asset'
14
14
  Provides-Extra: chat
15
15
  Requires-Dist: openai==3.55.1; extra == 'chat'
16
16
  Provides-Extra: default
@@ -26,30 +26,16 @@ commands are equivalent. The Python import package is `envloop`.
26
26
 
27
27
  ## Release compatibility
28
28
 
29
- This page describes the current client source. Published 1.33.0 includes
30
- `runner list|get|create|update|delete`, replacing the `list|register` commands in
31
- 1.32.0. The enhancements below are not in published 1.33.0 and await a new
32
- release. Check your installed `el --version` and `el COMMAND --help` before
33
- following an example; the source package version alone does not identify
34
- unreleased features.
35
-
36
- | Unreleased source enhancement | Published 1.33.0 |
37
- | --- | --- |
38
- | `el job chat JOB_ID [PROMPT]` and the `chat` extra | not available |
39
- | Explicit `--json` for `el runner get\|create\|update\|delete` | These commands already output JSON; omit `--json` |
40
- | `el dataset create --format harbor --update-digests` | not available; set `[[tasks]] digest` values by hand |
41
- | `el trial artifact download TRIAL_ID --output DIRECTORY` | positional `DIRECTORY` only |
42
-
43
- Execution also requires a matching platform, project permissions and published
44
- Runners; package installation alone does not establish those prerequisites. See the
29
+ Check your installed `el --version` and `el COMMAND --help` when following an
30
+ example. Upgrade an older installation with `uv tool upgrade envloop-cli`, or
31
+ `python -m pip install --upgrade envloop-cli` in your SDK environment. See the
45
32
  [PyPI release history](https://pypi.org/project/envloop-cli/#history) for published versions.
46
33
 
47
- Profile v4 requires platform support from [EnvPlatform #1489](https://github.com/EnvLoop/EnvPlatform/pull/1489).
48
- Running a v6 Runner in a Sandbox also requires the bootstrap fix in
49
- [EnvPlatform #1490](https://github.com/EnvLoop/EnvPlatform/pull/1490).
50
- Platform 1.71.0 contains neither change: upgrading the CLI alone does not enable
51
- these features on that server version. Existing historical Profile formats remain
52
- available while waiting for a compatible platform release.
34
+ Job execution needs project permissions, readable published Runners and a
35
+ platform that supports the selected Profile and Runner formats. If the platform
36
+ rejects a format, ask your project administrator which published versions it
37
+ supports. Use `envloop-cli[chat]` for the Job chat examples below and
38
+ `envloop-cli[asset]` for ANS parsing and verified content transfers.
53
39
 
54
40
  ## Install
55
41
 
@@ -238,8 +224,8 @@ el job list --type sandbox
238
224
  el job log JOB_ID --follow
239
225
  ```
240
226
 
241
- The platform resolves `base` to the registered `envloop/base@main` source ref and
242
- freezes its immutable Revision. The Sandbox image defaults to the registered Runner image;
227
+ The platform resolves `base` to the newest accessible successfully published `envloop/base` Revision and
228
+ freezes its immutable identity. The Sandbox image defaults to the registered Runner image;
243
229
  `--image` accepts an image name, tag or digest. Bench and Sandbox submissions can request a
244
230
  platform-enabled provider by name. In a request file, `provider` is a
245
231
  top-level field alongside `spec` and optional `overrides` in an `envloop.job/v2`
@@ -250,7 +236,7 @@ Failures include a code, readable explanation, HTTP status when available, and
250
236
  recovery guidance without echoing arbitrary response bodies or credentials.
251
237
 
252
238
  Bench/Sandbox Harbor Recipes accept `--harbor_env docker|process` with a canonical
253
- JobSpec (`spec.schema = "envloop.job/v1"`) or a named `--profile`:
239
+ JobSpec (`spec.schema = "envloop.job/v2"`) or a named `--profile`:
254
240
 
255
241
  ```bash
256
242
  el job submit --type sandbox --spec REQUEST.json --harbor_env process
@@ -374,7 +360,9 @@ Availability requires matching platform support and approved content in your pro
374
360
 
375
361
  Datasets, Checkpoints, Recipes and Profiles share `list`, `get`, `create`, `update`, `delete`
376
362
  and `set-visibility`. Every list row is an immutable version. A REF is an opaque resource ID,
377
- a fixed ANS URI supported by that type, or `namespace/name@version`; a bare name is rejected.
363
+ a fixed ANS URI supported by that type, or `namespace/name@version`. Recipe/Profile `get` also accepts
364
+ bare names or `@latest`, resolved by the platform to the newest accessible successful publication.
365
+ Dataset/Checkpoint names require explicit versions; mutation sources remain exact.
378
366
  `get/create/update` return `{ "asset": RECORD_OR_NULL, "operation": OPERATION_OR_NULL }`.
379
367
  Records share `asset_id/type/name/version/owner/visibility/acl_revision/status`; type details,
380
368
  files, model identity and provenance stay in `asset.details`.
@@ -398,7 +386,10 @@ el dataset set-visibility example/eval@1.0 --visibility internal --expected-acl-
398
386
 
399
387
  `--file` supplies a complete declaration; `--patch` is Profile update's explicit patch mode.
400
388
  An update creates a new immutable version owned by the current Project and leaves Profile defaults
401
- and submitted Job references unchanged. Profile default changes use `set-default REF --expected-version V`.
389
+ and submitted Job references unchanged. Profile default metadata changes use `set-default REF --expected-version V` and do not affect latest selection.
390
+ Runner/Recipe references in a Profile may omit the version or use `@latest`; Profile publication retains
391
+ those author references. Each new Job freezes the concrete URI, revision, hashes and owner; retries
392
+ with the same request ID retain the first choice.
402
393
  Profile supports private/public; other user content also supports internal. The returned ACL scope
403
394
  states whether sharing affects a name's versions or one saved record. Every visibility write requires
404
395
  an explicit `--expected-acl-revision`.
@@ -411,8 +402,9 @@ ID is never substituted for a real asset ID. Use `RESOURCE upload get OPERATION_
411
402
  only publication commit; there is no separate upload create command. Failed or timed-out operations
412
403
  exit nonzero while preserving their safe receipt. Storage credentials are not printed.
413
404
 
414
- Dataset downloads require an explicit split and accept config, content digest and paired task ID/tree
415
- digest selectors. Downloads verify manifests, sizes, SHA-256, safe paths and executable bits. Use
405
+ Dataset downloads require an explicit split and accept content digest and paired task ID/tree
406
+ digest selectors. Directory downloads with an explicit config selector are currently unsupported
407
+ by the pinned ANS dependency. Downloads verify manifests, sizes, SHA-256, safe paths and executable bits. Use
416
408
  `download REF --file-id FILE_ID --output FILE --resume` for a resumable single file. File selection
417
409
  is separate from `get`; Profile uses a redacted `export` instead of a content download.
418
410
 
@@ -4,7 +4,7 @@ envloop/auth_cli.py,sha256=xxMxvsBeeIRht0fWaXSV7tstMKlCzqBBVBcXEvNpwGU,17874
4
4
  envloop/auth_login.py,sha256=uOqPHqgzi0Y5eDMiZJH-EI_HxY55F9bRr8CoBb8OHfk,7231
5
5
  envloop/auth_workspace.py,sha256=g92Dok4eSp6P-Du5qkwzZG4JDeSrdYTXJbn5WCzCFMo,14927
6
6
  envloop/cli.py,sha256=aOgpG-JnBvjviBOizqgQQhm8by8EZvSJblNKebLhTVc,16165
7
- envloop/cli_errors.py,sha256=_1ZvVu69fyrVZYz7aD-PPFa7R7iEfGZvONO52bfhC1E,48392
7
+ envloop/cli_errors.py,sha256=sXVeYa5LRuV4RsQE7vdoY5CHcTIwnAgEvVb9V_UiS_I,48330
8
8
  envloop/cli_output.py,sha256=s5LwMHhDIbD6cqvmRYvIFTkgGehbUe4NJcmf6R-8BV0,6135
9
9
  envloop/client.py,sha256=Bj0oY1NPPRWpf5IOnXmoWKIKPXusUsrMK-IXOwcEgME,3293
10
10
  envloop/config.py,sha256=1Wr2lNdNNZzsQDPNGsk-TsnEUvDqOtocy9TgUpmOZO0,22494
@@ -19,42 +19,42 @@ envloop/terminal.py,sha256=YcUXw0qfLki0I10Ul3nF73pylq-OJ4SJMPh_FMV0kZE,3698
19
19
  envloop/utils/__init__.py,sha256=huB3qPQuKNr3JxfH3Ys09YWFtHiDamCHFsBa4epANgQ,25
20
20
  envloop/utils/logging.py,sha256=rXN0qyxhfGEq4vWXxjwfaczPPZf_7atnOkkBTgNNRPc,1017
21
21
  envloop_asset/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
22
- envloop_asset/assets.py,sha256=12S_SP5GY-4Sf1dyBaFA_gHEUEwu8qq784yORC3YlG8,32127
22
+ envloop_asset/assets.py,sha256=H6hstDNz8SdLLi6RXSrR23uh5rRqku7DQkb9r5ojTgc,32249
23
23
  envloop_asset/checkpoint_download.py,sha256=86pq8IXoJCEP6dVaLtgocp8b8rTyuEccK_ecOQLGiec,4622
24
24
  envloop_asset/checkpoint_upload.py,sha256=BwvLDb862B15MJGjr1lTTu8H6GIyDN5wsVcyoD30WRA,5317
25
25
  envloop_asset/cli.py,sha256=mISKgX1xz6UjSwP_4TQeOm89ugmcKctsZUC9DpWpcIw,3776
26
- envloop_asset/cli_output.py,sha256=cdHvncKxHnLpKp7-QaNAFFaaWEI6AO-wgTpHMbSopYI,5613
27
- envloop_asset/client.py,sha256=QJvs617WFCD67-r9R8VC1Dx5-1yaa6z0Bs_eSqVnTUA,20306
26
+ envloop_asset/cli_output.py,sha256=XKw5LRuQdorldl2ifJr-R1FDRJbSD2vthGz9GhIWw_U,5637
27
+ envloop_asset/client.py,sha256=IzvxmznkDtrDB2qFDsjOGrTNXWJXdNO3zVmKulz3zfg,20491
28
28
  envloop_asset/dataset_upload.py,sha256=G1lwQvqsqD5d-U80hYzCb83dvfPz73Yg4_7JKh3Mrys,19574
29
29
  envloop_asset/direct_artifact.py,sha256=1564EPw64MbGiUfMGRFfqHvyocxwA0gx1V5lhaH-jhM,10774
30
30
  envloop_asset/direct_checkpoint.py,sha256=sL00wpBfax75G5hYzwJimZ4hE2BeRbpOUntzWEoM9Yw,8718
31
31
  envloop_asset/direct_publication.py,sha256=zKBoAWnR6CGzdvsKS5ZZPLWAFDwiC0VFHLp9TxYE2O4,4103
32
32
  envloop_asset/direct_storage.py,sha256=z3dZFlrPUFbLzOWVbN4PS1R_kHYkdJXjvIz0QsJjY70,13207
33
33
  envloop_asset/direct_worker_artifact.py,sha256=LS5SuglxglbrkDxbr8AhLvJ5KFS1IWKAG5bprqKcd1Q,4631
34
- envloop_asset/execution_content.py,sha256=rP_blkZet1ZualA--a7vwZnz1r5jwD87mFtyDN7S3cQ,916
34
+ envloop_asset/execution_content.py,sha256=hqdjOyKpip3l6iJv1DX2oZ8NtDhMKuctNlNiPkJ7TUg,1140
35
35
  envloop_asset/http.py,sha256=v0gLHZFnsjaPnx5Jg3I-ktn-O7rCPu8UnB10zEGhMqg,7965
36
36
  envloop_asset/navigation_resources.py,sha256=puEAFr6biykIZPpqlowZ-BbRkh0miEp2OdTRP_P8ZkY,14167
37
37
  envloop_asset/profile_updates.py,sha256=M0KWqznDY6-MPPfjGNeL4FVTR86_yCRq6OyUJc-tUVY,3387
38
38
  envloop_asset/publication_cli.py,sha256=Ey9e8IxobZyHbYHKB_a5fucYXXZFWjYY4ZpuFdG9gm0,3709
39
39
  envloop_asset/publications.py,sha256=Xn794hX1n7nHwqQJzOzlmFFgIlA9h1XNDRAm5DZiBJM,9183
40
40
  envloop_asset/r2_upload.py,sha256=m-L1Z7L7fQvJNVA9pGzwSGGOTv1_COC5OVSjUIQfxMU,1605
41
- envloop_asset/recipe_packages.py,sha256=S2MIIhqitZQjB822PPXlpNIfpCGGBa-6nA9hlhkKtKk,5961
41
+ envloop_asset/recipe_packages.py,sha256=HA7RT2T6Lt94cl5_4ye3wPxxQd8lCo2_HdAeuq3yQvQ,5957
42
42
  envloop_asset/recipes.py,sha256=We2TZWdRl-ialV-uLFvUSvJng9P2HGquqGtqKYKllgs,1442
43
- envloop_asset/resource_cli.py,sha256=JIbgXG1UY8JsvrcaeGFFMVpL4F5vu3M-Wue6EN6d2w8,20946
44
- envloop_asset/runner_packages.py,sha256=ZY6XWI3yCwsrVnyeq8xXP46uc59s7WqajR0_qNGH6U4,5474
43
+ envloop_asset/resource_cli.py,sha256=ivKLF0XWppAixgyCvAS6EVp7CyQms4MGChF-NJ6L6OY,20544
44
+ envloop_asset/runner_packages.py,sha256=ve4UIUBBxoJ6h7LOSpiP6Tox00nak2v6K95hZ0VqvVM,6639
45
45
  envloop_asset/tags.py,sha256=wFP0Rg-avOmYkpyYqNGdJrnGreHEli-O5_eH9Liat6c,2016
46
- envloop_asset/transfer.py,sha256=OK__2bDd_Yiy1FRgVaWuKSOl_ss1KBUp9FWtXEvJ99E,53161
46
+ envloop_asset/transfer.py,sha256=sXK6kHwI5587OUo3GrFqS7TRpJTR7ytoAxHTIF4OIDk,53233
47
47
  envloop_asset/upload_strategy.py,sha256=RP-mNtM4yHQ0YmwocsTKD7MOS2asCoWnI44AtCI9LVw,605
48
48
  envloop_chat/__init__.py,sha256=pEW8SHBlrQr2_9UFm45unSUg-GP6rY04V3O27bspOuQ,75
49
49
  envloop_chat/cli.py,sha256=aUoflpsBWl-U4vrzZP4xsZrvc0md-zuSsCB6APeIk8Q,5783
50
50
  envloop_chat/client.py,sha256=CUCG0jBXJplsXsDNOdu-R-v9O-dVrMMVycNMZUS5b9M,7215
51
51
  envloop_experiment/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
52
- envloop_experiment/cli.py,sha256=kWXlcY_cznUB3D1y6OInkZebjBa0fjQ6V9ciWtkOiAY,43336
52
+ envloop_experiment/cli.py,sha256=BDmxdTxiUo8cxOkSa8Hxd61ns_mXIkNn6SbDmn-0HwA,43363
53
53
  envloop_experiment/cli_output.py,sha256=aM6eajuMDheWb2GA956UE0_y-6_tC0MCdC23ulROHi4,5196
54
- envloop_experiment/client.py,sha256=XKoeoIz4OZgbLh55CqvZmnWKEcnk-jMsI6XQ9SQHTC8,41757
54
+ envloop_experiment/client.py,sha256=9V3GRxOc7Fru7dgOUtZsqW-zjwnzb4PQghh5XyVCwsU,41772
55
55
  envloop_experiment/decision.py,sha256=HJTj-jSJJ5kcxQQzFXwrA9IICWXA6zSNBFL9EbbrxqI,918
56
56
  envloop_experiment/http.py,sha256=wQ81Pz_daVRGFDIZQnIgTKRyOWWBgxF8xi4kM9UE6tQ,6970
57
- envloop_experiment/inference.py,sha256=qSObsdo9suHhG5i_xlCh6-lt-NJkhQzAoF9KzCdVWws,5640
57
+ envloop_experiment/inference.py,sha256=GPg1LNPk1-ce1txSJWTkJ0qhNXxhFfP0cBwNt_fyQJ4,5662
58
58
  envloop_experiment/job_cost.py,sha256=gZB69-pdsJM4wManw44AIS9T3ZtsxxQTqrJs-cHjwJU,2214
59
59
  envloop_experiment/job_logs.py,sha256=RLipbj89e5hQdBeXtszsxSYYw7By1hscwSTGFQzQ3Qw,1340
60
60
  envloop_experiment/job_spec_cli.py,sha256=2q-_Txt0xkeBEjeWfoY9tkWhJnf2ZNhueAk9s4ahNYQ,14468
@@ -68,14 +68,14 @@ envloop_experiment/train.py,sha256=qfB9fA2D0vV17GlBuxNsnNhSo1eZRy49855PR-H3ARM,5
68
68
  envloop_experiment/train_log_cli.py,sha256=jCu7c0DGzy0La8tigJVDjuQHROaw6kfclU64QYsRVj0,6622
69
69
  envloop_experiment/train_metrics_cli.py,sha256=AXq5UPf_Xa4RCxAwZNvz8VZKghN1k3dhxbAXXxMmLlY,6522
70
70
  envloop_experiment/train_progress.py,sha256=9YO6CkTc7-LCpUpY8juf6GPF58kCU2rxc4iZjPoRQ58,3508
71
- envloop_experiment/train_runner_cli.py,sha256=N7sSkc4WlNQkMMCU9DoINVm_beyXzLybnjp6fD68sS4,3804
71
+ envloop_experiment/train_runner_cli.py,sha256=XJ-woz80M6ngsArlyP-dVT4CeTeT-O2PXKP5vcSQriE,3811
72
72
  envloop_experiment/training/__init__.py,sha256=IEQWbCHe-zZ2e7JQxOrFOdYlSQxMfOceCZUf_KeszBk,221
73
73
  envloop_rsi_loop/__init__.py,sha256=nKDGmzFNAQv2mq16YijiI3Q-gDL_smNyZD-AQaqoz7Y,68
74
74
  envloop_rsi_loop/cli.py,sha256=egat_Keygh9V1VAYgfEmqBKDmntCWe7ES_SFjhh26Yg,4102
75
75
  envloop_rsi_loop/cli_output.py,sha256=o5XzAkcddBOZ2h_AQ-pUPqJIWUOIMfZPWaPxqm0AtUM,4840
76
76
  envloop_rsi_loop/loop_cli.py,sha256=V_LEyWTsps2G1UNuMiWhrDDRdO0H4Z1bXGuWsYTOo0c,4491
77
77
  envloop_rsi_loop/loops.py,sha256=MGVe3uXxGlnzT_Sc7OHU97kyYA_FSFpXIUtlpXQ8ha0,8924
78
- envloop_cli-2.1.0.dist-info/METADATA,sha256=aw0BZHd1UhFjz9apkQky6oecRzX7WpSn6QVideTN7qw,22759
79
- envloop_cli-2.1.0.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
- envloop_cli-2.1.0.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
- envloop_cli-2.1.0.dist-info/RECORD,,
78
+ envloop_cli-2.3.1.dist-info/METADATA,sha256=H1BJYg_dzkWmquE1nRSG3n0niuiHK8U9gOzLyV9P8fU,22479
79
+ envloop_cli-2.3.1.dist-info/WHEEL,sha256=2iZrJkDIkeDh0k9SikKMqFuRP-ua6mb4Ir1AsER4BEw,87
80
+ envloop_cli-2.3.1.dist-info/entry_points.txt,sha256=8aXOpgtVk4GndhChA4XNecShkb1w0xGHBHrKla78ofI,67
81
+ envloop_cli-2.3.1.dist-info/RECORD,,
envloop_experiment/cli.py CHANGED
@@ -67,7 +67,7 @@ def log_page_size(value: str):
67
67
 
68
68
  def runner_arguments(submit: argparse.ArgumentParser):
69
69
  submit.add_argument("--runner", metavar="NAME[@REVISION]",
70
- help="Bench/Train/Inference: namespace/name@REVISION; Sandbox: registered Runner name (for example base)")
70
+ help="Registered Runner NAME or NAME@REVISION; omitted revision and @latest select the newest accessible publication")
71
71
  submit.add_argument("--job-id", help="Bench/Sandbox: caller-selected Job ID")
72
72
  submit.add_argument("--tag", help="Bench/Sandbox: run label")
73
73
  submit.add_argument("--priority", type=int, help="Bench/Sandbox/Train recipe: waiting priority; explicit value overrides spec (server default: 0)")
@@ -148,7 +148,7 @@ def add_commands(groups: "argparse._SubParsersAction[argparse.ArgumentParser]"):
148
148
  job_submit.add_argument("--attempts", type=int)
149
149
  job_submit.add_argument("--request-id", help="idempotency key; overrides request_id in --spec")
150
150
  job_submit.add_argument("--profile", type=profile_reference, metavar="NAME[@VERSION]",
151
- help="named runtime Profile; omitted version prefers default, then newest unarchived creation")
151
+ help="named runtime Profile; omitted version and @latest select the newest accessible unarchived publication")
152
152
  job_submit.add_argument('--input', action='append', default=[], metavar='NAME=URI|NAME=ASSET_ID',
153
153
  help='Bind an ANS input slot of a named Train/Bench/Sandbox Profile; repeatable. '
154
154
  'A Dataset URI alone uses the default config and the train split; a Asset ID (data_…) '
@@ -388,16 +388,16 @@ class Trials:
388
388
 
389
389
 
390
390
  def runner_selector(value: str):
391
- """Require an explicit, portable revision; resolution belongs to the API."""
391
+ """Pass a registered name or portable revision; latest resolution belongs to the API."""
392
392
  if not isinstance(value, str):
393
393
  raise ValueError("runner requires name@revision")
394
394
  name, separator, revision = value.partition("@")
395
- if (not separator or not name or "/" not in name or not revision
395
+ if (not name or "/" not in name or separator and not revision
396
396
  or value != value.strip() or any(char.isspace() for char in value)
397
397
  or revision in {"HEAD", "FETCH_HEAD", "ORIG_HEAD", "MERGE_HEAD", "CHERRY_PICK_HEAD", "REVERT_HEAD"}
398
398
  or revision.startswith("-") or ".." in revision or revision == "@" or "@{" in revision
399
399
  or any(char in revision for char in "~^:{}?*[\\")):
400
- raise ValueError("runner requires name@revision with an explicit commit, tag or branch")
400
+ raise ValueError("runner requires namespace/name with optional latest, commit, tag or branch")
401
401
  return value
402
402
 
403
403
 
@@ -26,8 +26,8 @@ def validate_submission(body: Any):
26
26
  raise ValueError('fixed-input inference cannot mix legacy or runtime fields')
27
27
  runner = spec['runner']
28
28
  if (not isinstance(runner, str)
29
- or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*@[^\s@]+', runner)):
30
- raise ValueError('runner requires namespace/name@revision')
29
+ or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*(?:@[^\s@]+)?', runner)):
30
+ raise ValueError('runner requires namespace/name with an optional revision')
31
31
  if not isinstance(spec.get('name'), str) or not spec['name'].strip():
32
32
  raise ValueError('fixed-input inference requires name')
33
33
  profile = spec.get('profile')
@@ -44,8 +44,8 @@ def runner_request(args: argparse.Namespace):
44
44
  from envloop_experiment.client import runner_selector
45
45
  from envloop_experiment.sandbox import validate_image
46
46
 
47
- if not args.runner or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*@[^\s@]+', args.runner):
48
- raise ValueError('Train Runner requires --runner namespace/name@REVISION')
47
+ if not args.runner or not re.fullmatch(r'[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9][A-Za-z0-9._-]*(?:@[^\s@]+)?', args.runner):
48
+ raise ValueError('Train Runner requires --runner namespace/name[@REVISION]')
49
49
  runner = runner_selector(args.runner)
50
50
  if args.docker is not None and args.image is not None:
51
51
  raise ValueError('--docker and --image cannot be combined')