Skip to content

Commit fa3b401

Browse files
ppiegazedocsy
andcommitted
docs: document tracked local runs (--tracked / --tracked-strict)
Regen #1424 published --tracked, --tracked-strict and flyte create config --local-tracked in the generated CLI reference, but no narrative page mentions them. A reader searching the user guide for "tracked" finds nothing, and running-locally describes local runs as leaving no trace on the control plane, which --tracked changes. Document tracking as a modifier on local execution rather than a fourth run mode, since --tracked implies --local and the task still executes in the local Python process: - run-command-options: a --tracked / --tracked-strict section covering what is reported (actions, attempts, phases, inputs, outputs, reports, cache status), what is not (logs stay in the terminal), the best-effort reporting policy and why strict mode exists, the run-name contract (<=30 chars, no leading u or r, auto-named local-<id>), and the local.tracked config key. - running-locally: a "Track local runs in the console" section, plus a note on the "What works locally" table, which otherwise implies local runs are invisible to the control plane. - run-modes/_index: the union comparison table listed "No (TUI only)" under Flyte UI for local execution, which is no longer accurate. Gated to the union variant: flyteorg/flyte carries only the flyteidl2 protos and generated stubs for TrackedRunService, with no server implementation. It is implemented in the Union control plane. NOT FOR MERGE until tracked runs is released. Drafted under the publish gate. Co-Authored-By: docsy <docsy@union.ai> Signed-off-by: Peeter Piegaze <1153481+ppiegaze@users.noreply.github.com>
1 parent 10aac29 commit fa3b401

3 files changed

Lines changed: 86 additions & 1 deletion

File tree

content/user-guide/get-started/run-modes/_index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ The same task code runs unchanged across all three modes. Start with local execu
4848
|--------|-------------------|--------|--------|
4949
| **⚡️ Execution** | In-process Python | Containerized, local Docker | Containerized, cloud |
5050
| **🐳 Docker required** | No | Yes | No (remote build) |
51-
| **💻 Flyte UI** | No (TUI only) | Yes (`localhost:30080`) | Yes |
51+
| **💻 Flyte UI** | TUI, or the console with `--tracked` | Yes (`localhost:30080`) | Yes |
5252
| **📦 Container images** | Ignored | Built locally | Built locally or remotely |
5353
| **🔀 Parallelism** | Sequential | Cluster-level | Cluster-level |
5454
| **⭐️ Best for** | Fast iteration, debugging | Testing container builds, full Flyte features | Production, GPUs, scale |

content/user-guide/get-started/run-modes/running-locally.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,26 @@ persists the inputs and outputs of every task run locally, so you can always go
115115
flyte start tui
116116
```
117117

118+
{{< variant union >}}
119+
{{< markdown >}}
120+
121+
## Track local runs in the console
122+
123+
A local run normally leaves no trace on the control plane. Add `--tracked` and the run still executes on your machine, but its progress is reported to {{< key product_name >}} so you can watch it in the console next to your remote runs:
124+
125+
```bash
126+
flyte run --tracked hello.py main
127+
```
128+
129+
The command prints a console link when the run starts. Tracking covers the run's actions and attempts, their phases, and their inputs, outputs, reports and cache status. Logs are not reported, so `print()` output stays in your terminal.
130+
131+
Reporting never gets in the way of the run itself: if the control plane is unreachable, the failure is logged and your local run finishes normally.
132+
133+
Use `flyte create config --local-tracked` to track every local run without passing the flag. For the full option reference, including strict reporting and run-name rules, see [Run command options](../../tasks/task-deployment/run-command-options).
134+
135+
{{< /markdown >}}
136+
{{< /variant >}}
137+
118138
---
119139

120140
## What works locally
@@ -130,6 +150,16 @@ Most Flyte features work in both local and remote execution. The table below sum
130150
| **Plugins** | Same decorators and APIs as remote. Secrets come from environment variables. | [Integrations](../../../api-reference/integrations/_index) |
131151
| **Secrets** | Read from `.env` files or environment variables. No `flyte create secret` needed. | [Secrets](../../tasks/task-configuration/secrets) |
132152

153+
{{< variant union >}}
154+
{{< markdown >}}
155+
156+
> [!NOTE] Visibility is the exception
157+
> With `--tracked`, a local run also reports its state to the control plane and appears in the console.
158+
> See [Track local runs in the console](#track-local-runs-in-the-console).
159+
160+
{{< /markdown >}}
161+
{{< /variant >}}
162+
133163
---
134164

135165
## Local to devbox/remote

content/user-guide/tasks/task-deployment/run-command-options.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,19 @@ The `flyte run` command provides the following options:
2727
| `--run-project` | | text | *from config* | Execute deployed task in this project (`deployed-task` only). |
2828
| `--run-domain` | | text | *from config* | Execute deployed task in this domain (`deployed-task` only). |
2929

30+
{{< variant union >}}
31+
{{< markdown >}}
32+
33+
These additional options are available on {{< key product_name >}}:
34+
35+
| Option | Short | Type | Default | Description |
36+
|--------------------|-------|------|---------|--------------------------------------------------------------------------|
37+
| `--tracked` | | flag | `false` | Run the task locally while reporting run state to the control plane. |
38+
| `--tracked-strict` | | flag | `false` | Fail the run if reporting fails. Requires `--tracked`. |
39+
40+
{{< /markdown >}}
41+
{{< /variant >}}
42+
3043
## `--project`, `--domain`
3144

3245
**`flyte run --domain <DOMAIN> --project <PROJECT> <PATH>|deployed-task <TASK_NAME>`**
@@ -78,6 +91,48 @@ flyte run my_example.py my_task --input "test_data"
7891
- **Resource constraints**: When remote resources are unavailable or expensive
7992
- **Data locality**: When working with large local datasets
8093

94+
{{< variant union >}}
95+
{{< markdown >}}
96+
97+
## `--tracked`, `--tracked-strict`
98+
99+
**`flyte run --tracked <PATH> <TASK_NAME>`**
100+
101+
The `--tracked` option runs the task on your machine, exactly as `--local` does, while reporting the run's progress to the control plane so that it appears in the {{< key product_name >}} console alongside your remote runs. It implies `--local`, so you do not need to pass both:
102+
103+
```bash
104+
flyte run --tracked my_example.py my_task --input "test_data"
105+
```
106+
107+
Because the run is reported to the control plane, `--tracked` needs an endpoint, project and domain in your configuration, and it cannot be combined with a remote run.
108+
109+
Tracking reports the run's actions and attempts, their phases, and their inputs, outputs, reports and cache status. Logs are not reported: your task's output stays in the terminal where you launched the run.
110+
111+
Reporting is best-effort by design. If the control plane is slow or unreachable, the failure is logged and the local run continues to completion, so tracking never blocks or fails work that would otherwise have succeeded. To debug reporting itself, add `--tracked-strict`, which turns any reporting failure into a loud run failure:
112+
113+
```bash
114+
flyte run --tracked --tracked-strict my_example.py my_task
115+
```
116+
117+
`--tracked-strict` is only meaningful together with `--tracked`; enabling it on its own raises an error.
118+
119+
### Naming a tracked run
120+
121+
Tracked runs are named `local-<id>` unless you pass `--name`. A name you supply must be at most 30 characters and must not begin with `u` or `r`, both of which are reserved for runs the platform names itself. A name that breaks either rule fails before the run starts.
122+
123+
### Tracking every local run
124+
125+
To track local runs without passing the flag each time, write the setting into your config file:
126+
127+
```bash
128+
flyte create config --local-tracked
129+
```
130+
131+
This sets the `local.tracked` key, after which `flyte run --local` reports to the control plane on its own. The matching key for strict mode is `local.tracked_strict`.
132+
133+
{{< /markdown >}}
134+
{{< /variant >}}
135+
81136
## `--copy-style`
82137

83138
**`flyte run --copy-style [loaded_modules|all|none] <PATH> <TASK_NAME>`**

0 commit comments

Comments
 (0)