Skip to content

Commit 66938e4

Browse files
authored
Merge pull request #37 from NREL/updates
Improve CLI usability, documentation
2 parents f91fb8d + c25d1ab commit 66938e4

32 files changed

+1457
-992
lines changed

CLAUDE.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ cd server
7878

7979
# Build and run server (requires DATABASE_URL in .env)
8080
cargo build --release
81-
cargo run --bin torc-server
81+
cargo run --bin torc-server -- run
8282

8383
# Run tests
8484
cargo test
@@ -291,7 +291,7 @@ List endpoints support `offset` and `limit` query parameters:
291291

292292
**Server SQL Queries**:
293293
```bash
294-
RUST_LOG=sqlx=debug cargo run --bin torc-server
294+
RUST_LOG=sqlx=debug cargo run --bin torc-server -- run
295295
```
296296

297297
**Client Verbose Output**:
@@ -317,13 +317,13 @@ sqlite3 server/db/sqlite/dev.db
317317

318318
## Development Workflow
319319

320-
1. **Start Server** (standalone binary): `cargo run --bin torc-server`
320+
1. **Start Server** (standalone binary): `cargo run --bin torc-server -- run`
321321
2. **Build Unified CLI**: `cargo build --release --bin torc --features "client,tui,plot_resources"`
322322
3. **Quick Execution**: `torc run examples/sample_workflow.yaml` OR `torc submit examples/sample_workflow.yaml`
323323
4. **Or Explicit**: `torc workflows create examples/sample_workflow.yaml``torc workflows run <id>`
324324
5. **Monitor**: `torc workflows status <id>` or `torc tui`
325325

326-
**Note**: The server is always run as a standalone binary (`torc-server`), not through the unified CLI.
326+
**Note**: The server is always run as a standalone binary (`torc-server run`), not through the unified CLI.
327327

328328
## CLI Commands Quick Reference
329329

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ hdrhistogram = "7.5"
3131
signal-hook = "0.3"
3232
libc = "0.2"
3333
file-rotate = "0.7"
34-
clap = { version = "4.4", features = ["derive", "env"] }
34+
clap = { version = "4.4", features = ["derive", "env", "color"] }
3535
clap_complete = "4.4"
3636
tokio = { version = "1.47", features = ["rt-multi-thread", "macros", "net", "signal"] }
3737
url = "2.5"

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,9 @@ The unified `torc` CLI provides all workflow management, execution, and monitori
4646
4747
```bash
4848
# 1. Start the Torc server (standalone binary)
49-
torc-server
49+
torc-server run
5050
# Or with options:
51-
torc-server --url localhost --port 8080 --threads 8 --database path/to/db.sqlite
51+
torc-server run --url localhost --port 8080 --threads 8 --database path/to/db.sqlite
5252
5353
# 2. Use the unified CLI for all client operations
5454
# Create a workflow from a specification file

docs/src/SUMMARY.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
- [Creating Workflows](./how-to/creating-workflows.md)
3232
- [Working with Slurm](./how-to/slurm.md)
3333
- [Job Checkpointing](./how-to/checkpointing.md)
34-
- [Managing Resources](./how-to/resources.md)
3534
- [Resource Monitoring](./how-to/resource-monitoring.md)
3635
- [Web Dashboard](./how-to/dashboard.md)
3736
- [Debugging Workflows](./how-to/debugging.md)
@@ -45,6 +44,8 @@
4544
- [CLI Reference](./reference/cli.md)
4645
- [Workflow Specification Formats](./reference/workflow-formats.md)
4746
- [Job Parameterization](./reference/parameterization.md)
47+
- [Resource Requirements](./reference/resources.md)
48+
- [Resource Monitoring](./reference/resource-monitoring.md)
4849
- [OpenAPI Specification](./reference/openapi.md)
4950
- [Configuration](./reference/configuration.md)
5051
- [Security](./reference/security.md)

docs/src/how-to/README.md

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
# How-To Guides
22

3-
This section provides problem-oriented guides for accomplishing specific tasks with Torc. Each guide walks through a concrete use case with step-by-step instructions.
3+
This section provides task-oriented guides for accomplishing specific goals with Torc. Each guide shows you how to complete a concrete task.
44

55
**Topics covered:**
66

7-
- Creating workflows using different methods
8-
- Working with Slurm clusters
9-
- Checkpointing jobs during wall-time timeouts
10-
- Managing compute resources
11-
- Configuring resource requirements
12-
- Debugging workflow failures with log files
13-
- Monitoring workflow execution
14-
- Deploying and operating the server in production
15-
- Configuring logging and daemonization
16-
- Setting up authentication
7+
- [Creating Workflows](./creating-workflows.md) - Different methods for creating workflows
8+
- [Working with Slurm](./slurm.md) - Running workflows on Slurm clusters
9+
- [Job Checkpointing](./checkpointing.md) - Saving progress during wall-time timeouts
10+
- [Resource Monitoring](./resource-monitoring.md) - Tracking CPU and memory usage
11+
- [Web Dashboard](./dashboard.md) - Using the web-based monitoring interface
12+
- [Debugging Workflows](./debugging.md) - Troubleshooting workflow failures
13+
- [Authentication](./authentication.md) - Setting up user authentication
14+
- [Shell Completions](./shell-completions.md) - Enabling tab completion
15+
- [Server Deployment](./server-deployment.md) - Running the server in production

docs/src/how-to/authentication.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@ bob:$2b$12$zyxwvutsrqponmlkjihgfedcba0987654321ZYXWVUTSRQPONMLK
5050

5151
```bash
5252
# Optional authentication (backward compatible mode)
53-
torc-server --auth-file /path/to/htpasswd
53+
torc-server run --auth-file /path/to/htpasswd
5454

5555
# Required authentication (all requests must authenticate)
56-
torc-server --auth-file /path/to/htpasswd --require-auth
56+
torc-server run --auth-file /path/to/htpasswd --require-auth
5757

5858
# Can also use environment variable
5959
export TORC_AUTH_FILE=/path/to/htpasswd
60-
torc-server
60+
torc-server run
6161
```
6262

6363
**Authentication Modes:**
@@ -129,7 +129,7 @@ Basic authentication sends base64-encoded credentials (easily decoded). **Always
129129

130130
```bash
131131
# Start server with HTTPS
132-
torc-server --https --auth-file /path/to/htpasswd --require-auth
132+
torc-server run --https --auth-file /path/to/htpasswd --require-auth
133133

134134
# Client connects via HTTPS
135135
torc --url https://torc.example.com/torc-service/v1 --username alice workflows list
@@ -169,10 +169,10 @@ Monitor authentication events in server logs:
169169

170170
```bash
171171
# Run server with debug logging for auth events
172-
torc-server --log-level debug --auth-file /path/to/htpasswd
172+
torc-server run --log-level debug --auth-file /path/to/htpasswd
173173

174174
# Or use RUST_LOG for granular control
175-
RUST_LOG=torc::server::auth=debug torc-server --auth-file /path/to/htpasswd
175+
RUST_LOG=torc::server::auth=debug torc-server run --auth-file /path/to/htpasswd
176176
```
177177

178178
## Common Workflows
@@ -184,7 +184,7 @@ RUST_LOG=torc::server::auth=debug torc-server --auth-file /path/to/htpasswd
184184
torc-htpasswd add --file dev_htpasswd --password devpass developer
185185

186186
# 2. Start server (auth optional)
187-
torc-server --auth-file dev_htpasswd --database dev.db
187+
torc-server run --auth-file dev_htpasswd --database dev.db
188188

189189
# 3. Use client without auth (still works)
190190
torc workflows list
@@ -205,7 +205,7 @@ chmod 600 /etc/torc/htpasswd
205205
chown torc-server:torc-server /etc/torc/htpasswd
206206

207207
# 3. Start server with required auth and HTTPS
208-
torc-server \
208+
torc-server run \
209209
--https \
210210
--auth-file /etc/torc/htpasswd \
211211
--require-auth \
@@ -238,16 +238,16 @@ torc workflows start "${WORKFLOW_ID}"
238238

239239
```bash
240240
# 1. Start: No authentication
241-
torc-server --database prod.db
241+
torc-server run --database prod.db
242242

243243
# 2. Add authentication file (optional mode)
244-
torc-server --auth-file /etc/torc/htpasswd --database prod.db
244+
torc-server run --auth-file /etc/torc/htpasswd --database prod.db
245245

246246
# 3. Monitor logs, ensure clients are authenticating
247247
# Look for "User 'X' authenticated successfully" messages
248248

249249
# 4. Once all clients authenticate, enable required auth
250-
torc-server --auth-file /etc/torc/htpasswd --require-auth --database prod.db
250+
torc-server run --auth-file /etc/torc/htpasswd --require-auth --database prod.db
251251
```
252252

253253
## Troubleshooting
@@ -284,7 +284,7 @@ torc-htpasswd add --file /path/to/htpasswd alice
284284

285285
**Solution:** This is normal in optional auth mode. To require auth:
286286
```bash
287-
torc-server --auth-file /path/to/htpasswd --require-auth
287+
torc-server run --auth-file /path/to/htpasswd --require-auth
288288
```
289289

290290
### Password Prompting in Non-Interactive Sessions

0 commit comments

Comments
 (0)