Skip to content

Commit 8e5ba2d

Browse files
committed
feat(jobs): add log tail API and CLI
Signed-off-by: Ryan S <267728323+ironcommit@users.noreply.github.com>
1 parent 0286eaf commit 8e5ba2d

46 files changed

Lines changed: 1819 additions & 427 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎docs/cli/reference.mdx‎

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1667,6 +1667,7 @@ nemo files otlp logs query [OPTIONS] NAME
16671667
* `--filters`: Key-value filters to apply to the query
16681668
* `--limit <INTEGER>`: Maximum number of results to return
16691669
* `--page-cursor`: Cursor for pagination
1670+
* `--tail <INTEGER>`: Number of newest log lines to return
16701671

16711672
**Help:**
16721673

@@ -3926,6 +3927,7 @@ nemo jobs [OPTIONS] COMMAND [ARGS]...
39263927
* `get`: Get a platform job by name.
39273928
* `update-status-details`: Update the status details of a platform job.
39283929
* `watch`: Watch a platform job until it reaches a terminal status.
3930+
* `tail`: Print the newest lines from a platform job log.
39293931
* `results`: Manage results
39303932
* `steps`: Manage steps
39313933
* `tasks`: Manage tasks
@@ -4056,6 +4058,7 @@ nemo jobs get-logs [OPTIONS] NAME
40564058
* `--limit <INTEGER>`: Maximum number of logs to return
40574059
* `--page-cursor`: Page cursor
40584060
* `--step-id`: Filter logs by step name
4061+
* `--tail <INTEGER>`: Number of newest log lines to return
40594062
* `--task-id`: Filter logs by task ID
40604063
* `--all-pages`: Fetch all pages
40614064

@@ -4315,6 +4318,32 @@ nemo jobs watch [OPTIONS] NAME
43154318

43164319
* `--help, -h`: Show this message and exit.
43174320

4321+
#### nemo jobs tail
4322+
4323+
Print the newest lines from a platform job log.
4324+
4325+
**Usage:**
4326+
4327+
```shell
4328+
nemo jobs tail [OPTIONS] NAME
4329+
```
4330+
4331+
**Arguments:**
4332+
4333+
* `<NAME>`: Name of the platform job whose logs to tail
4334+
4335+
**Options:**
4336+
4337+
* `-n, --lines <INTEGER RANGE>`: Number of lines to show [default: 100]
4338+
* `--workspace`: Workspace containing the job
4339+
* `--attempt-id <INTEGER>`: Filter logs to an attempt ID
4340+
* `--step-id`: Filter logs to a step ID
4341+
* `--task-id`: Filter logs to a task ID
4342+
4343+
**Help:**
4344+
4345+
* `--help, -h`: Show this message and exit.
4346+
43184347
#### nemo jobs results
43194348

43204349
Manage results

‎docs/set-up/manage-jobs.mdx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,22 @@ description: ""
99

1010
This section describes how to configure jobs in NeMo Platform. The Jobs service is responsible for scheduling batch jobs, collecting telemetry and managing job results.
1111

12+
## Viewing Job Logs
13+
14+
Use `nemo jobs get-logs` to inspect paginated job logs:
15+
16+
```bash
17+
nemo jobs get-logs <job-name> --workspace default --limit 100
18+
```
19+
20+
Use `nemo jobs tail` when you only need the newest lines from a long or running job:
21+
22+
```bash
23+
nemo jobs tail <job-name> --workspace default -n 500
24+
```
25+
26+
Both commands support `--attempt-id`, `--step-id`, and `--task-id` to narrow the log output.
27+
1228
## Execution Profiles
1329

1430
You can configure jobs to run on different hardware by specifying an execution profile. This allows you to define different compute resources and job execution backends for different job types and use cases.

‎openapi/ga/individual/platform.openapi.yaml‎

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎openapi/ga/openapi.yaml‎

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎openapi/openapi.yaml‎

Lines changed: 23 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/nemo_platform_ext/src/nemo_platform_ext/cli/commands/api/files/otlp/logs.py‎

Lines changed: 2 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎packages/nemo_platform_ext/src/nemo_platform_ext/cli/commands/api/jobs/__init__.py‎

Lines changed: 35 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)