Skip to content

Commit adb741e

Browse files
vsilentCopilot
andcommitted
docs: add local mode section to DAG pipes guides
- Part 1: Local Mode section with workflow, target switching, command table - Part 1: Updated command reference with deploy and target commands - Part 3: Added /instances/local and /instances/{id}/deploy endpoints Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 399c4ed commit adb741e

2 files changed

Lines changed: 72 additions & 0 deletions

File tree

docs/DAG_PIPES_PART1_CLI_GUIDE.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ stacker login
3030
stacker status
3131
```
3232

33+
> **💡 No cloud deployment yet?** You can experiment locally first — see [Local Mode](#local-mode-experimental) below.
34+
3335
---
3436

3537
## Example 1: Contact Form → Telegram + Slack
@@ -211,6 +213,8 @@ stacker pipe trigger <slack-pipe-id> \
211213
| `stacker pipe trigger <id>` | Run the pipe once manually |
212214
| `stacker pipe history <id>` | View past executions |
213215
| `stacker pipe replay <exec-id>` | Re-run a past execution |
216+
| `stacker pipe deploy <id> --deployment <hash>` | Promote local pipe to remote |
217+
| `stacker target [local\|cloud\|server]` | Switch deployment target mode |
214218

215219
### Useful flags
216220

@@ -255,6 +259,72 @@ stacker pipe trigger <id> --data '{"name":"test","email":"test@test.com","messag
255259

256260
---
257261

262+
## Local Mode (Experimental)
263+
264+
Local mode lets you design, test, and iterate on pipes **without a cloud deployment**. Pipes run against your local Docker containers.
265+
266+
### Setting Up Local Mode
267+
268+
```bash
269+
# Switch to local mode
270+
stacker target local
271+
272+
# Verify active target
273+
stacker target
274+
# Output: Active target: local
275+
276+
# All pipe commands now show [local] prefix
277+
stacker pipe scan website
278+
# [local] ✓ 3 containers discovered
279+
```
280+
281+
### Local Workflow
282+
283+
```bash
284+
# 1. Discover local containers (uses docker ps)
285+
stacker pipe scan website
286+
287+
# 2. Create a pipe — no deployment hash needed
288+
stacker pipe create website telegram
289+
# [local] ✓ Pipe instance created (id: abc-123)
290+
291+
# 3. Trigger locally (executes via docker exec)
292+
stacker pipe trigger abc-123 --data '{"name":"test","email":"test@test.com"}'
293+
294+
# 4. Check history
295+
stacker pipe history abc-123
296+
297+
# 5. When ready — promote to a remote deployment
298+
stacker pipe deploy abc-123 --deployment <your-deployment-hash>
299+
# ✓ Local pipe promoted to remote deployment
300+
# Remote instance ID: def-456
301+
# Use 'stacker pipe activate def-456' to start the remote pipe.
302+
```
303+
304+
### Switching Targets
305+
306+
```bash
307+
stacker target local # local Docker containers
308+
stacker target cloud # cloud deployment (from prior deploy)
309+
stacker target server # dedicated server deployment
310+
stacker target # show current
311+
```
312+
313+
### What Works Locally
314+
315+
| Command | Local Behavior |
316+
|---------|---------------|
317+
| `pipe scan` | Runs `docker ps` to discover containers |
318+
| `pipe create` | Creates pipe with `is_local=true`, no deployment hash |
319+
| `pipe list` | Shows your local pipes only |
320+
| `pipe trigger` | Executes via `docker exec` / HTTP |
321+
| `pipe history` | Shows execution history |
322+
| `pipe deploy` | Promotes local pipe → remote deployment |
323+
| `pipe activate/deactivate` | Remote only (use after deploy) |
324+
| `pipe replay` | Remote only |
325+
326+
---
327+
258328
## What's Next?
259329

260330
- **[Part 2: Visual Editor](./DAG_PIPES_PART2_WEB_EDITOR.md)** — Build pipes with drag-and-drop in your browser

docs/DAG_PIPES_PART3_API_DEEP_DIVE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,8 +315,10 @@ curl -sf -X POST "$BASE/pipes/instances/$INSTANCE/dag/execute" \
315315
|--------|------|-------------|
316316
| `POST` | `/api/v1/pipes/instances` | Create instance |
317317
| `GET` | `/api/v1/pipes/instances/{deployment_hash}` | List by deployment |
318+
| `GET` | `/api/v1/pipes/instances/local` | List local instances |
318319
| `GET` | `/api/v1/pipes/instances/detail/{id}` | Get instance |
319320
| `PUT` | `/api/v1/pipes/instances/{id}/status` | Update status |
321+
| `POST` | `/api/v1/pipes/instances/{id}/deploy` | Promote local → remote |
320322
| `DELETE` | `/api/v1/pipes/instances/{id}` | Delete instance |
321323

322324
### Executions

0 commit comments

Comments
 (0)