Add an API and CLI#18
Merged
Merged
Conversation
- holoptycho/server/: AppState (state.py), Holoscan runner thread (runner.py), FastAPI endpoints /run /stop /status /logs /model (api.py), Azure ML + trtexec model swap (model_manager.py) - holoptycho/cli/main.py: Typer-based hp CLI with start/stop/status/logs/model commands - pixi.toml: add fastapi, uvicorn, httpx, typer, azure-ai-ml, azure-identity deps; add start-api task (localhost:8000) - pyproject.toml: add hp entry point, register server/cli subpackages - tests/test_api.py, tests/test_cli.py: 25 tests, all passing (no GPU required)
- PtychoApp/PtychoSimulApp accept engine_path param (fallback to hardcoded default) - runner.start() accepts engine_path, resolves: arg > state.current_engine_path > default - API reads HOLOPTYCHO_ENGINE_PATH env var at startup to pre-populate state - POST /run accepts optional engine_path in request body - hp start --engine-path flag for per-run override - README updated with HOLOPTYCHO_ENGINE_PATH usage
- model folder (ENGINE_CACHE_DIR=/models) is source of truth - swap_model checks local cache first; only pulls from Azure ML if not cached - list_models returns combined local engines + Azure ML models with cached flag - Azure ML gracefully unavailable if env vars not set - Remove HOLOPTYCHO_ENGINE_PATH and --engine-path (model folder covers this) - hp model list shows local and Azure sections separately - README updated with local-first model workflow
Restart stops the running app, waits for the runner thread to exit (up to 30s), then relaunches with the same mode and config. Works from running, finished, or error states. Returns 400 if no previous run exists.
hp model set now only updates state.current_engine_path (and pulls/compiles from Azure ML if not cached). The sentinel file mechanism is removed from model_manager. The new engine is picked up by runner.start() on the next hp start or hp restart.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add an API and CLI for the Holoscan pipeline so that we can monitor and configure it from the workstation.
This also provides an interface to connect a GUI to.
This PR also adds an AGENTS.md so that we can use opencode to help manage the holoscan deployment.