Commit Graph

41 Commits

Author SHA1 Message Date
Timur Gordon
2625534152 cleanup and refactor 2025-11-13 14:41:30 +01:00
Timur Gordon
4b516d9d7e update readme 2025-11-12 12:15:46 +01:00
Timur Gordon
285199edac feat: add get_all_runner_status to WASM client and use it to show real runner status in dropdown 2025-11-11 15:09:19 +01:00
Timur Gordon
2ca593510c Add debug logging to WASM client Authorization header 2025-11-11 11:54:09 +01:00
Timur Gordon
77e32b360c Unify authentication: store secrets as API keys
- Secrets are now added to ApiKeyStore on supervisor initialization
- Removed duplicate authentication logic in verify_api_key
- Single source of truth: all authentication goes through ApiKeyStore
- Admin/user/register secrets are treated as API keys with appropriate scopes
- Simplified auth_verify - no special case handling needed
2025-11-07 00:42:05 +01:00
Timur Gordon
d6184e7507 Treat secrets as API keys - unify authentication
- Updated verify_api_key() to check secrets first (admin, user, register)
- Secrets are now treated as API keys with appropriate scopes
- All OpenRPC methods now work with secrets (register_runner, list_runners, etc.)
- Simplified auth_verify since verify_api_key handles everything
- Admin UI now fully functional with admin secret from .env
2025-11-07 00:38:33 +01:00
Timur Gordon
43ad9b60aa Fix auth_verify to accept admin/user/register secrets directly
- Check secrets (admin_secrets, user_secrets, register_secrets) before API keys
- Allow UI to authenticate with the secrets provided in .env
- Secrets now work as expected for authentication
- API keys still supported as fallback for backward compatibility
2025-11-07 00:33:09 +01:00
Timur Gordon
43750b32d7 Fix Admin UI status detection to catch port binding errors
- Increase sleep time to 2 seconds to allow error detection
- Check log file for 'Address already in use' error
- Show helpful message to run --kill-ports when port is in use
- Kill the failed process to prevent zombie processes
2025-11-07 00:26:07 +01:00
Timur Gordon
4f4d1c0832 Add --kill-ports flag and improve summary output
- Added --kill-ports flag to kill processes on supervisor and admin UI ports
- Simplified summary: show Admin UI status inline (green URL or red error)
- Combined log viewing into single command
- Removed redundant error message during startup
2025-11-07 00:24:46 +01:00
Timur Gordon
0df5956575 Improve run script output with better error messages and summary
- Show helpful error message when Admin UI fails with log location
- Add summary section with all URLs and log file locations
- Better visual separation with dividers
- Clear instructions for viewing logs
2025-11-07 00:21:30 +01:00
Timur Gordon
278ba18d20 Add support for pre-configured runners from environment variables
- Added RUNNERS env var to .env.example (comma-separated runner names)
- Updated supervisor binary to accept --runners flag
- Runners are automatically registered on startup using first admin secret
- Updated run.sh to pass RUNNERS from env to supervisor binary
2025-11-07 00:15:22 +01:00
Timur Gordon
609af6ec15 Refactor supervisor to use environment variables and simplify binary
- Created scripts/generate_secret.sh to generate supervisor secrets
- Added .env.example with all configuration options
- Created scripts/environment.sh to load env vars from .env
- Updated scripts/run.sh to use env vars and pass as flags
- Simplified supervisor binary:
  - Removed bootstrap-admin-key and config file support
  - Made admin-secret required
  - Minimal output (only URLs)
  - Clean startup with no verbose logging
- Updated .gitignore for .env and log files
2025-11-07 00:08:32 +01:00
Timur Gordon
8a02fffcca Update build/test scripts with clean progress indicators and minimal output 2025-11-06 23:55:17 +01:00
Timur Gordon
bbced35996 Update build and test scripts to handle all three crates (core, client, ui) 2025-11-06 23:40:09 +01:00
Timur Gordon
a65c721c64 Clean up documentation: consolidate docs in docs/ directory, simplify README 2025-11-06 23:36:10 +01:00
Timur Gordon
6d518599b8 Restructure: move src to core/ crate, move cmd/supervisor.rs to core/src/bin/supervisor.rs, create workspace 2025-11-06 23:30:18 +01:00
Timur Gordon
0a617ad359 Add restructure documentation 2025-11-06 14:11:09 +01:00
Timur Gordon
4a5f19e091 Restructure: move clients/openrpc to client/ and clients/admin-ui to ui/ 2025-11-06 14:07:55 +01:00
Timur Gordon
af5cd30516 Switch hero-job dependencies to Git URLs in main supervisor package 2025-11-06 13:49:00 +01:00
Timur Gordon
8e79c343a7 Switch hero-supervisor dependency to Git URL in openrpc client 2025-11-06 13:48:29 +01:00
Timur Gordon
56a7e00edc Switch hero-job dependency to Git URL in openrpc client 2025-11-06 13:47:27 +01:00
Timur Gordon
c960322a8a Fix WASM client: send timeout as u64 instead of Duration object
- Changed timeout field from {secs, nanos} object to plain u64 number
- Fixes 'Invalid params' error when calling job.run from WASM
- Job struct expects timeout as u64 (seconds), not a Duration struct
- Fixed in both run_job and create_job_with_secret methods
2025-11-04 17:16:15 +01:00
Timur Gordon
1a23a97e38 Fix WASM client: use correct method name 'job.run' instead of 'jobs.run'
- Changed method call from 'jobs.run' to 'job.run' to match OpenRPC spec
- This fixes 'Method not found' errors when calling run_job from WASM
- Native client was already using correct method name
2025-11-04 17:13:01 +01:00
Timur Gordon
b8ef14d06c Simplify build.sh and update run.sh for self-contained execution
- Simplified build.sh to just build in release mode with warning suppression
- Updated run.sh to build first, then start supervisor and admin UI together
- Run script now starts both supervisor API and admin UI in background
- Added proper cleanup handler for graceful shutdown
- Removed admin UI compilation errors by fixing JsValue handling
- Added list_jobs method to WASM client for admin UI compatibility
2025-11-04 17:05:01 +01:00
Timur Gordon
3356a03895 Use hero-job crate instead of runner_rust for job types 2025-11-04 13:44:01 +01:00
Timur Gordon
49d36485d0 Update admin UI with real API integration and secret management 2025-10-31 02:29:29 +01:00
Timur Gordon
e493085892 Use git dependency for runner_rust instead of path
This allows supervisor to be used as a git dependency by other projects
2025-10-28 12:28:40 +01:00
Timur Gordon
f249c8b49b Implement comprehensive admin UI with job management and API key display
Admin UI Features:
- Complete job lifecycle: create, run, view status, view output, delete
- Job table with sorting, filtering, and real-time status updates
- Status polling with countdown timers for running jobs
- Job output modal with result/error display
- API keys management: create keys, list keys with secrets visible
- Sidebar toggle between runners and keys views
- Toast notifications for errors
- Modern dark theme UI with responsive design

Supervisor Improvements:
- Fixed job status persistence using client methods
- Refactored get_job_result to use client.get_status, get_result, get_error
- Changed runner_rust dependency from git to local path
- Authentication system with API key scopes (admin, user, register)
- Job listing with status fetching from Redis
- Services module for job and auth operations

OpenRPC Client:
- Added auth_list_keys method for fetching API keys
- WASM bindings for browser usage
- Proper error handling and type conversions

Build Status:  All components build successfully
2025-10-28 03:32:25 +01:00
Timur Gordon
5f5dd35dbc fix: resolve duplicate LogInfo type and method name issues
- Removed duplicate LogInfo type definition for WASM
- Fixed run_job client method to call 'job.run' instead of 'run_job'
- Removed unused imports (wasm_bindgen, PathBuf)
- Admin UI now builds successfully

All components working:
- OpenRPC client compiles for both native and WASM
- Admin UI builds without errors
- Method names aligned between client and server
2025-10-27 15:42:27 +01:00
Timur Gordon
674ae22f91 fix: add run_job alias and update get_runner_status to use params
- Added run_job method as alias for job.run for backward compatibility
- Updated get_runner_status to accept RunnerManagementParams with secret
- Both methods now properly handle secret-based authentication
- Fixes 'Method not found' and parameter mismatch errors
2025-10-27 14:59:14 +01:00
Timur Gordon
9b3477d6d2 feat: align OpenRPC server with simplified client API
- Updated RegisterRunnerParams to only require name (queue = name)
- Added AddRunnerParams with RunnerConfig for add_runner method
- Updated RunnerManagementParams and StopRunnerParams with secrets
- Added add_runner method to OpenRPC trait and implementation
- Removed duplicate AddRunnerParams definition
- Updated client register_runner to send params as JSON object
- Added TODO comments for moving secrets to HTTP headers
2025-10-27 14:48:46 +01:00
Timur Gordon
a47157aa71 fix: keep OpenRPC ServerHandle alive to prevent server shutdown
The ServerHandle was being dropped immediately after spawning, causing the
OpenRPC server to shut down. Now we properly await handle.stopped() to keep
the server running.
2025-10-27 14:34:22 +01:00
Timur Gordon
98b2718d58 feat: simplify OpenRPC API and reorganize examples
- Simplified RunnerConfig to just name, command, and optional env
- Removed RunnerType and ProcessManagerType enums
- Removed db_path, redis_url, binary_path from config
- Made runner name also serve as queue name (no separate queue param)
- Added secret-based authentication to all runner management methods
- Created comprehensive osiris_openrpc example
- Archived old examples to _archive/
- Updated client API to match simplified supervisor interface
2025-10-27 14:20:40 +01:00
Timur Gordon
ef56ed0290 Fix git dependencies 2025-10-20 22:27:46 +02:00
Timur Gordon
d968dcfa5d Use git dependency for runner_rust 2025-10-20 22:25:49 +02:00
Timur Gordon
e2971a335c Production deployment with zinit config 2025-10-20 22:24:48 +02:00
Timur Gordon
e7c377460e supervisor minor fixed 2025-09-02 09:15:24 +02:00
Timur Gordon
77b4c66a10 fix mycelium impl 2025-09-01 16:34:24 +02:00
Timur Gordon
44b1dd4249 remove unused dep and move job out 2025-09-01 16:21:31 +02:00
Timur Gordon
ef17d36300 update api, fix tests and examples 2025-08-27 10:07:53 +02:00
Timur Gordon
767c66fb6a initial commit 2025-08-26 14:49:21 +02:00