Commit Graph

291 Commits

Author SHA1 Message Date
53aa47f91e feat: Initial helm score using helm-wrapper-rs (#14)
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/14
Co-authored-by: Taha Hawa <taha@taha.dev>
Co-committed-by: Taha Hawa <taha@taha.dev>
2025-04-23 18:22:27 +00:00
8f470278a7 Merge pull request 'feat: introduce topology readiness and initialization' (#10) from feat/topologyDependencies into master
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/10
Reviewed-by: taha <taha@noreply.git.nationtech.io>
2025-04-23 15:58:31 +00:00
213fb25686 feat: Use inquire::Confirm instead of raw std::io::Read for K8sAnywhere installation confirmation prompt 2025-04-23 11:56:55 -04:00
45668638e1 feat: TUI does not require Topology to implement Debug anymore 2025-04-23 11:17:03 -04:00
0857aba039 Switch HAClusterTopology for K8sAnywhereTopology in lamp example 2025-04-23 11:08:36 -04:00
452ebc2614 feat: add k3d installation interpret
Adds a new interpret for k3d installation. This includes defining the `K3dInstallationInterpret` struct, implementing the `Interpret` trait for it, and adding the `K3dInstallation` variant to the `InterpretName` enum. The implementation currently contains `todo!()` placeholders for the actual logic.
2025-04-23 10:54:54 -04:00
9e456bb4f5 chore: Refactor DownloadableAsset tests to use httptest instead of a local TcpListener 2025-04-23 10:54:54 -04:00
83ba0e1044 fix: Initialize K3DInstallationScore correctly 2025-04-23 10:54:54 -04:00
2229e9d7af chore: Cargo fmt 2025-04-23 10:54:54 -04:00
15785dd219 feat: download and install k3d latest release
- Implemented functionality to fetch the latest k3d release tag from GitHub.
- Added logic to determine the appropriate binary URL based on the current platform.
- Implemented downloading and saving the binary to a specified directory.
- Included unit tests to verify the download and installation process.
- Added a `K3D_BIN_FILE_NAME` constant for clarity.
- Added logging for better debugging.
2025-04-23 10:54:54 -04:00
847d84b46f wip: Started work on k3d crate 2025-04-23 10:54:54 -04:00
3f6f1fa0d4 wip: Implement basic K8sAnywhere setup with K3d support
- Added initial K8sAnywhere topology and related modules.
- Implemented a basic K3d installation score for cluster bootstrapping.
- Introduced LocalhostTopology for local development and testing.
- Added necessary module structure and dependencies.
- Implemented user prompt for K3d installation confirmation.
- Added basic error handling and logging.
- Refactored existing code to improve modularity and maintainability.
- Included necessary tests to ensure functionality.
2025-04-23 10:54:54 -04:00
6812d05849 feat: Introduce K8sAnywhereTopology and refactor Kubernetes interactions
This commit introduces a new topology, `K8sAnywhereTopology`, designed to handle Kubernetes deployments more flexibly.

Key changes include:

- Introduced `K8sAnywhereTopology` to encapsulate Kubernetes client management and configuration.
- Refactored existing Kubernetes-related code to utilize the new topology.
- Updated `OcK8sclient` to `K8sclient` across modules (k8s, lamp, deployment, resource) for consistency.
- Ensured all relevant modules now interface with Kubernetes through the `K8sclient` trait.

This change promotes a more modular and maintainable codebase for Kubernetes integrations within Harmony.
2025-04-23 10:54:54 -04:00
027114c48c feat: introduce topology readiness and initialization
Adds a `ensure_ready` method to the `Topology` trait to ensure the infrastructure is prepared before score execution.

- Introduces a new `Outcome` status to indicate the result of the readiness check.
- Implements a `topology_preparation_result` field in `Maestro` to track initialization status.
- Adds a check in `interpret` to warn if the topology isn't fully initialized.
- Provides detailed documentation for the `Topology` trait and `ensure_ready` method, including recommended patterns for complex setups.
- Adds `async_trait` dependency.
2025-04-23 10:54:54 -04:00
eeafa086f3 feat: Improve output of tui. From p-r tui-score-info (#11)
WIP: formatted score debug print into a table with a name header and the score information below
Co-authored-by: Jean-Gabriel Gill-Couture <jg@nationtech.io>
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/11
Reviewed-by: johnride <jg@nationtech.io>
Co-authored-by: Willem <wrolleman@nationtech.io>
Co-committed-by: Willem <wrolleman@nationtech.io>
2025-04-23 14:54:32 +00:00
abd20b96a2 feat: harmony-cli v0.1 #8 (#9)
Co-authored-by: tahahawa <tahahawa@gmail.com>
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/9
Reviewed-by: johnride <jg@nationtech.io>
Co-authored-by: Taha Hawa <taha@taha.dev>
Co-committed-by: Taha Hawa <taha@taha.dev>
2025-04-19 01:13:40 +00:00
0ba7f2536c docs: ADR for Helm Resource implementation style (#12)
Co-authored-by: tahahawa <tahahawa@gmail.com>
Reviewed-on: https://git.nationtech.io/NationTech/harmony/pulls/12
2025-04-16 17:39:17 +00:00
3097e6af67 Merge branch 'adr/005-interactive-project' 2025-04-11 11:03:16 -04:00
606ea43b51 fix: improve tests and remove unused code
- Corrected XML test data to remove unnecessary `<descr>` tags, resolving failing tests.
- Removed the unused `ratatui_utils` module and its associated code.
- Simplified example in `harmony_tui/src/lib.rs` to use `tokio::main` and register scores directly with `Maestro`. This aligns with the project's evolving structure.
2025-04-11 11:01:05 -04:00
31ae8365a6 docs: add quick demo and core architecture overview
Adds a quick demo command using `cargo run -p example-tui` to launch a minimalist TUI with demo scores.

Also includes a core architecture diagram and overview in the README for better understanding of the project structure.
2025-04-09 16:09:54 -04:00
1cbf4de2a1 adr: proposal serde for score data representation and UI rendering
Decouples score definitions from UI implementations by mandating `serde::Serialize` and `serde::Deserialize` for all `Score` structs. UIs will interact with scores via their serialized representation, enabling scalability and reducing complexity for score authors.

This approach:

- Scales better with new score types and UI targets.
- Simplifies score authoring by removing the need for UI-specific display traits.
- Leverages the `serde` ecosystem for robust data handling.

Adding new field types requires updates to all UIs, a trade-off acknowledged in the ADR.
2025-04-05 14:38:58 -04:00
b4cc5cff4f feat: add serde derive to Score types
This commit adds `serde` dependency and derives `Serialize` trait for `Score` types. This is necessary for serialization and deserialization of these types, which is required to display Scores to various user interfaces

- Added `serde` dependency to `harmony_types/Cargo.toml`.
- Added `serde::Serialize` derive macro to `MacAddress` in `harmony_types/src/lib.rs`.
- Added `serde::Serialize` derive macro to `Config` in `opnsense-config/src/config/config.rs`.
- Added `serde::Serialize` derive macro to `Score` in `harmony_types/src/lib.rs`.
- Added `serde::Serialize` derive macro to `Config` and `Score` in relevant modules.
- Added placeholder `todo!()` implementations for `serialize` methods. These will be implemented in future commits.
2025-04-05 14:36:08 -04:00
ab9b7476a4 feat: add load balancer score and frontend integration
- Implemented `OKDLoadBalancerScore` and integrated it as a `FrontendScore`.
- Added `FrontendScore` trait for TUI displayable scores.
- Implemented `Display` for `OKDLoadBalancerScore`.
- Updated `ScoreListWidget` to handle `FrontendScore` types.
- Included load balancer score in the TUI.
2025-04-03 13:41:29 -04:00
e6384da57e Working on various ADR, cleaning up some stuff 2025-04-03 13:40:46 -04:00
79213ba8d7 feat: implement passthrough for HAClusterTopology traits
This commit completes the refactoring of the `HAClusterTopology` struct to implement all required traits via passthrough to the underlying infrastructure providers.

- Implemented all traits (`DnsServer`, `LoadBalancer`, `HttpServer`, etc.) on `HAClusterTopology`.
- Each trait method now simply calls the corresponding method on the underlying infrastructure provider.
- This ensures that all functionality is delegated to the correct provider without duplicating logic.
- Updated trait implementations to accept `&self` instead of `&mut self` where appropriate.
- Fixed a compilation error in `remove_record` by changing the signature to accept `&self`.
- Added unimplemented!() stubs for HttpServer traits.
2025-04-03 12:20:51 -04:00
8a1627e728 wip: refactoring 2025-04-02 16:52:24 -04:00
fc718f11cf feat: Introduce Topology Trait for Compile-Time Safe Score Binding
Introduce the `Topology` trait to ensure that `Maestro` can compile-time safely bind compatible `Scores` and `Topologies`. This refactoring includes updating `HarmonyTuiEvent`, `ScoreListWidget`, and related structures to work with generic `Topology` types, enhancing type safety and modularity.
2025-04-02 15:51:28 -04:00
f7dc15cbf0 refactor(topology): remove unused HAClusterTopology import
Remove the unnecessary `HAClusterTopology` import from multiple modules to clean up dependencies and reduce clutter. This change does not affect functionality as `HAClusterTopology` is no longer required in these files.
2025-03-31 15:07:16 -04:00
6e9bf3a4be Add more Topology samples with various architectures 2025-03-31 15:02:41 -04:00
fda007f014 feat(topology): generalize Score and Interpret implementations with topology traits
Refactor various `Score` and `Interpret` implementations to utilize generic `Topology` traits, removing hardcoded dependencies on `HAClusterTopology`. This enhancement allows for more flexible and extensible code, accommodating different types of network topologies.
2025-03-26 23:10:51 -04:00
d7897f29c4 feat(orchestration): introduce Interpret trait and refactor score application
Refactor the orchestration process to use an `Interpret` trait instead of directly applying scores. This change introduces a more flexible and extensible design for executing commands associated with different types of topologies. The `CommandScore` and `K8sResourceScore` now implement this trait, providing a clear separation between score definition and execution logic. Update the `Maestro::orchestrate` method to compile scores into interpreters before executing them against their respective topologies.
2025-03-26 16:39:11 -04:00
3962238f0d spike: Working on abstractions, Topology, Score, Capability, Maestro for strong type safety and nice UX/DX 2025-03-25 08:03:45 -04:00
2433c02de9 feat: select k3d for cross-platform Kubernetes development
Select k3d as the primary solution for running Kubernetes clusters on Windows and macOS, alongside native k3s on Linux, to achieve a consistent "zero setup" experience across platforms while considering resource usage, complexity, and long-term alternatives like WebAssembly.
2025-03-17 22:36:07 -04:00
3d6f646460 feat(adr/007-default-runtime.md): add future work section discussing WASM potential
Add a new section to the ADR document outlining potential future work with WebAssembly (WASM) as an alternative runtime, comparing it to Java's bytecode and JVM model, highlighting potential benefits in observability, heap allocation, and garbage collection. Note current maturity limitations compared to our target customer base.
2025-03-17 16:20:52 -04:00
35fcc295aa ADR: Default runtime for harmony workloads
This ADR proposes to use k3s as a default runtime on linux and k3d on other platforms supporting docker
2025-03-17 15:48:14 -04:00
7291db7ca3 feat(example/lamp): add LAMPScore and configuration support
- Introduce `LAMPScore` struct with additional fields: `domain`, `config`, and `php_version`.
- Define default implementation for `LAMPConfig`.
- Update `Url` enum to use `Url(url::Url)` instead of `Remote(url::Url)`.
- Adjust references in `HttpServer` and `TftpServer` implementations.
- Modify `Interpret` trait implementation to use `name()` method from `LAMPScore`.
2025-03-10 17:04:35 -04:00
fbc18d2fad feat(harmony): add lamp server module and refactor dhcpd tests
Implement LAMP server module with basic configuration.
Refactor and remove commented out Dhcpd struct and associated tests in opnsense/xml_utils.
Ensure codebase adheres to best practices and maintainability standards.
2025-03-10 15:18:40 -04:00
fe42ebd347 feat(adr): add architecture decision record for interactive project setup
Add an Architecture Decision Record (ADR) outlining the approach to integrate LAMP projects into Harmony's automated delivery pipeline using either Score Spec or a custom Rust DSL. A decision will have to be made between the two in the short term to decide which we will implement first. The ADR details the benefits and consequences of each option, focusing on providing a seamless transition for developers while leveraging Harmony's enterprise-grade features.
2025-03-10 00:35:40 -04:00
2950235d23 Actualiser adr/006-secret-management.md 2025-03-10 04:31:06 +00:00
7f56d4d654 feat(adr/006-secret-management): propose using Keycloak for secret management
Introduce Architecture Decision Record (ADR) outlining the use of Keycloak as a secret management solution. The document details the context, considerations, decision workflow, rationale for choosing Keycloak over alternatives, and potential consequences including benefits and challenges.
2025-03-06 12:40:44 -05:00
c8547e38f2 feat(ipxe): create empty score shell for ipxe 2025-03-02 12:14:04 -05:00
bfc79abfb6 feat(ipxe): added slitaz image (super small image with gui and tools) 2025-03-02 10:05:50 -05:00
7697a170bd feat(ipxe): setup to have MAC specific bootfiles and fallback to a default if not found 2025-03-02 09:37:11 -05:00
941c9bc0b0 fix: missing protocol for ipxe boot file 2025-03-02 07:59:30 -05:00
51aeea1ec9 feat: support new configurable field in dhcp config: filenameipxe 2025-03-01 10:51:01 -05:00
8118df85ee feat: support new configurable field in dhcp config: filename64 2025-03-01 10:41:41 -05:00
7af83910ef doc: fix 2025-03-01 10:29:22 -05:00
1475f4af0c doc: fix 2025-03-01 10:25:24 -05:00
a3a61c734f doc: update README.md with instructions on how to add a field in opnsense config.xml 2025-03-01 10:17:51 -05:00
3f77bc7aef feat: support new configurable field in dhcp config: filename 2025-03-01 08:56:41 -05:00