-
-
Notifications
You must be signed in to change notification settings - Fork 146
native service execution (container-free) - working #177
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
…unch previous commit is a bit closer to stable (but not actually stable)
…ose for native run cases
|
progress! native harbor up / downthis code as of 14b9093 can now bring native ollama up and down on macos with: goalThe goal is basically stick as close as possible to how docker and harbor works, while keeping the fact that code is running natively as transparent as possible through the harbor api. That should give a big speedup on a bunch of apps and allow some flexibility when installing and testing! work to do, any suggestions?still lots of details to work out though. Right now I'm planning each native service to have a corresponding proxy service (a small lightweight proxy container) to try and get the dependencies filled and bridge between the local host and docker. If there are alternative design suggestions lmk. Here are the current drafts of config/setup files:
|
feat: add exclusion flag support to Deno compose file merger Add support for -x/--exclude flags in the Deno composition system to enable selective exclusion of service-defining compose files while preserving cross-service integration files. Changes: - Enhanced mergeComposeFiles.js with -x/--exclude argument parsing - Updated resolveComposeFiles() in docker.js to skip compose.<service>.yml files - Added routine_compose_with_options() in harbor.sh to parse exclusion flags - Implemented structured argument passing from Bash CLI to Deno routines - Added service name validation and debug logging Technical Details: - Exclusion only affects exact matches (compose.<service>.yml) - Cross-service files (compose.x.*) and capability files remain included - Maintains backward compatibility with existing compose workflows - Uses structured argument format: -x service1 service2 -- other_options This enables the foundation for hybrid orchestration by allowing selective exclusion of container definitions while maintaining service integrations.
…ked! note: may need to check compose.x.* files and config.*.json files for regressions
- Fix critical bug where harbor list returned empty due to pipe subshell preventing associative array updates - Refactor _harbor_get_all_possible_services to capture output before processing, avoiding pipe subshells - Remove debug logging and clean up service discovery code paths - Consolidate all compose operations into single mergeComposeFiles.js Deno routine - Implement robust bash-to-JS interface with get_available_services() and build_compose_command() - Break circular dependency in _harbor_get_docker_services_list by calling Deno routine directly - Ensure DRY architecture with single source of truth for service discovery and compose operations Resolves: harbor list now correctly displays all 138 services in sorted order Resolves: harbor list --active correctly detects no running services Resolves: harbor cmd <service> properly generates compose commands with file merging Based on: native-services branch orchestration system refactor Testing: Verified service discovery, active detection, and compose command generation
…very - Fix associative array pipe/subshell issue in _harbor_get_all_possible_services - Replace raw docker compose usage with Harbor's composition logic in _harbor_get_docker_services_list - Break circular dependency in _harbor_get_running_service_runtime by using direct docker ps - Ensure robust service discovery for both native and container services - Maintain Harbor's sophisticated file merging and capability detection Fixes: harbor list displaying incomplete service lists Fixes: infinite loop in service discovery during harbor list --active Resolves: #hybrid-orchestration-service-discovery
…ugfix harbor env vars pass to *_native.sh
…to native-services
|
I found some more bugs I plan to continue addressing them. |
- Add -c/--container flag to force container execution (pairs with -n/--native) - Remove broken fallback that bypassed wave system when dependency resolution failed - Fix double execution of startupOrder.js dependency resolver - Improve error messages for circular dependencies and missing Deno - Delete 259 lines of deprecated dependency code The wave system now handles all startup scenarios. Removed fallback couldn't fix the dependency issues that triggered it, instead masking problems by starting services without proper ordering.
- Move venv activation immediately after creation for each Python version branch - Remove redundant python_executable variable (uv handles this) - Simplify uv sync and tool install commands (remove unnecessary flags) - Set HARBOR_PYTHON_VERSION when using default Python - Fix command logging to show actual command being executed These changes make the setup more robust and less prone to Python version mismatches.
Replace venv activation with uv run for reliable Python environment management. Fixes ModuleNotFoundError when system speaches exists but is broken. - Remove 'uv tool install .' (was installing globally) - Use 'uv run' instead of venv activation + direct execution - Add project directory detection for correct environment - Fix model command: 'list' → 'ls' - Ensure setup runs when project directory is missing
Add organized test structure for Harbor native services: - tests/test_native_services.sh: native service functionality tests - tests/test_harbor_core.sh: basic Harbor infrastructure tests - tests/test_native_integration.sh: end-to-end integration tests - tests/run_tests.sh: unified test runner for shell and Deno tests - routines/tests/: Deno tests for startup computation and dependency extraction - tests/README.md: test organization and usage documentation
…licts - Add harbor_down cleanup before test execution - Replace hardcoded port 8080 with dynamic get_service_port() function - Use harbor url command to discover actual service ports - Fix WebUI, speaches, and ollama port detection in all test functions
Proposal: The Harbor Hybrid Runtime - An Architectural Roadmap
Proposed Harbor CLI update to allow directly installed services to run without a container. This is to solve critical performance bottlenecks (especially for Apple Silicon users) and harbor command line functionality gaps while preserving the existing stability and ease of use of the container-based system as much as possible.
Upate 2025-06-27 native services are now working! (ollama and speaches)
This pull request is not yet working: I'm checking if the conceptual idea is acceptable before I make too many changes.On macos in particular there is no support for gpu-passthrough of containers, services that need gpus have to run natively to get the best performance (often ~1000x speedup), and existing hacks like setting the uri actually lead a container to still be launched which can lead to conflicts.
Key Advantages:
1. Core Feature: Native Service Execution
This architecture will empower Harbor to manage services as native host processes, running directly on your machine alongside traditional Docker containers.
ollamaon Apple Silicon Macs, this means a potential 10x+ performance increase by bypassing Docker's virtualization limitations.<service_name>_native.yml: A "contract" file that declares the service's native properties (e.g., the command to run, the port to use).<service_name>_native.sh: A "bootstrap" script that handles the logic of starting the native application, ensuring a clean and configurable launch.2. Planned Capability: Intelligent Execution & User Control
The new architecture will feature a smart, multi-layered system for choosing how services run, providing a seamless "it just works" experience with options for expert control.
3. Planned Capability: Robust Hybrid Dependency Management
The architecture's cornerstone is a system that makes dependencies between native and containerized services reliable and automatic.
webui) candepend_ona native service (ollama). The system will guarantee thewebuicontainer waits until the nativeollamaprocess is fully healthy before starting.4. High-Impact Command Enhancements
The most frequently used commands will be upgraded to be fully "hybrid-aware," creating a unified and intuitive user experience.
harbor up&harbor down: These orchestrators are the most significant change. They will manage the complete lifecycle of the hybrid stack, correctly starting, stopping, and waiting for both native processes and containers in the proper dependency order.harbor ps: The output will be transformed into a unified status dashboard, showing all active services at a glance and clearly labeling them as(native)or(container).harbor logs <service>: This will become a universal tool for debugging. It will seamlessly stream logs from a container or tail the log file of a native process with the same, simple command.harbor run <service>&harbor shell <service>: These commands will be enhanced to provide the most logical experience based on the service's configuration. Arunon a native service will use the local toolchain; ashellon a native service will launch a new host shell, turning potential errors into helpful shortcuts.5. Expected Limitations and Trade-offs
To set clear expectations, this proposed architecture has the following inherent limitations:
brew install ollama). Harbor will manage the process, but not its installation. Theharbor doctorcommand will be enhanced to check for these dependencies.localhost), which could conflict with other non-Harbor applications the user is running.harbor ejectcommand, which produces a portabledocker-compose.ymlfile, will by design only include the definitions for container-based services. The ejected configuration will not be able to manage native processes.If someone else is interested to help get this running please lmk!