Commit graph

29 commits

Author SHA256 Message Date
Till Wegmueller
471fa7f3e1 Enable pure-iso feature for vm-manager (no genisoimage needed) 2026-04-07 21:01:12 +02:00
Till Wegmueller
b5c7078adc Switch vm-manager to git dep + multi-stage Containerfile
- Use HTTPS git dep for vm-manager (works in CI and container builds)
- Add .cargo/ to .gitignore (local dev patch override)
- Restore multi-stage Containerfile: Rust build stage fetches vm-manager
  from GitHub, Ubuntu 24.04 runtime with QEMU
- Host orchestrator stopped and disabled (container-only from now on)
2026-04-07 17:24:17 +02:00
Till Wegmueller
c9fc05a00e Remove libvirt dependencies and clean up orchestrator
- Remove `virt` crate dependency and libvirt feature flag
- Remove `ssh2` crate dependency (vm-manager handles SSH)
- Remove `zstd` crate dependency (vm-manager handles decompression)
- Remove LibvirtHypervisor, ZonesHypervisor, RouterHypervisor from hypervisor.rs
- Remove libvirt error types from error.rs
- Remove libvirt_uri/libvirt_network CLI options, add network_bridge
- Replace RouterHypervisor::build() with VmManagerAdapter::build()
- Update deb package depends: libvirt → qemu-system-x86
- Keep Noop backend for development/testing
- Dead old SSH/console functions left for future cleanup
2026-04-07 15:56:10 +02:00
Till Wegmueller
a60053f030 Add vm-manager adapter layer to orchestrator
- Add vm-manager as dependency of orchestrator
- Create vm_adapter.rs that bridges orchestrator's Hypervisor trait
  to vm-manager's RouterHypervisor (QEMU/Propolis/Noop backends)
- Add Qemu and Propolis variants to BackendTag
- Add console_socket, ssh_host_port, mac_addr fields to VmHandle
- Adapter uses user-mode networking by default for containerization
- Maps orchestrator VmSpec + JobContext → vm-manager VmSpec with
  CloudInitConfig and SshConfig
2026-04-07 15:46:20 +02:00
Till Wegmueller
8f909c0105
Update default SSH user to 'sol' and enhance cloud-init config; bump version to 0.1.15
- Change the default SSH username from 'ubuntu' to 'sol' for consistency with Solstice CI environment.
- Modify cloud-init user configuration to align with the new default, adding enhanced permissions and settings for 'sol' user.
- Increment orchestrator version to 0.1.15.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-18 14:48:20 +01:00
Till Wegmueller
2c73c80619
Introduce workflow.jobs support and script path overrides; bump version to 0.1.14
- Add parsing and execution support for `.solstice/workflow.kdl` with job-specific configurations, including `runs_on`, `script path`, and `workflow_job_id`.
- Enable job grouping via `group_id` for cohesive workflow processing.
- Update orchestrator to pass workflow-specific parameters to `cloud-init` for finer control over execution.
- Refactor enqueue logic to handle multiple jobs per workflow with fallback to single job when no workflow is defined.
- Enhance dependencies for workflow parsing by integrating `base64`, `regex`, and `uuid`.
- Increment orchestrator version to 0.1.14 for release.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-18 14:37:35 +01:00
Till Wegmueller
7fc4e8edb7
Introduce logs-service for structured job logs management; bump version to 0.1.13
- Add `logs-service` crate as a separate microservice to handle job log storage, retrieval, and categorization.
- Update orchestrator to redirect log endpoints to the new service with optional permanent redirects using `LOGS_BASE_URL`.
- Enhance log persistence by introducing structured fields such as category, level, and error flags.
- Implement migration to add new columns and indexes for job logs.
- Add ANSI escape sequence stripping and structured logging for cleaner log storage.
- Improve SSH log handling with interleaved stdout/stderr processing and pty request support.
- Revise Docker files and compose setup to include logs-service, with support for PostgreSQL and secure connections.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-18 11:48:09 +01:00
Till Wegmueller
20a0efd116
Atomically upload runner via SFTP to ensure safe file replacement; bump version to 0.1.11
- Refactor runner upload logic to use temporary files and atomic renaming for safer updates.
- Improve file permission handling during temporary file creation.
- Increment orchestrator version to 0.1.11.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 23:18:55 +01:00
Till Wegmueller
b36e5c70a8
Validate runner paths at startup and improve diagnostics; bump version to 0.1.10
- Add validation for `RUNNER_LINUX_PATH` and `RUNNER_ILLUMOS_PATH` with detailed warnings and diagnostics for misconfigurations.
- Log fallback to default paths and warn if binaries are missing.
- Increment orchestrator version to 0.1.10.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 22:48:33 +01:00
Till Wegmueller
931e5ac81a
Add explicit libvirt configuration support; remove environment variable reliance; bump version to 0.1.9
- Introduce `libvirt_uri` and `libvirt_network` in configuration structs, replacing reliance on environment variables.
- Update all `virsh`-related logic to use explicit parameters for libvirt connection and network settings.
- Align codebase with new guidelines rejecting runtime environment variable mutations.
- Document breaking changes in `.junie/guidelines.md`.
- Increment orchestrator version to 0.1.9.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 22:40:50 +01:00
Till Wegmueller
f1d161655f
Refactor dnsmasq leases-based guest IP discovery and bump version to 0.1.8
- Update IP selection logic to prefer the latest lease based on epoch timestamp.
- Remove redundant IP discovery logic in `net-dhcp-leases`.
- Increment orchestrator version to 0.1.8 for release.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 22:00:46 +01:00
Till Wegmueller
a6ed0f0c69
Add libvirt-related environment handling, directory preparation, and bump version to 0.1.7
- Add default `LIBVIRT_URI`, `HOME`, and `XDG_CACHE_HOME` environment variable handling for `virsh` commands.
- Ensure writable cache directories for the service user in packaging scripts.
- Update systemd service to include libvirt-related environment defaults.
- Bump orchestrator version to 0.1.7.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 21:50:17 +01:00
Till Wegmueller
bf94664a30
Refactor VM lifecycle handling and improve guest IP discovery, bump version to 0.1.6
- Adjust stopping, destroying, and persisting VM lifecycle events to ensure better sequencing and avoid races.
- Enhance `discover_guest_ip_virsh` with detailed logging, structured attempt tracking, and robust fallback mechanisms.
- Introduce `Attempt` struct to capture detailed command execution context for debugging.
- Update console log handling to snapshot logs early, minimizing race conditions.
- Bump orchestrator version to 0.1.6.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 21:34:19 +01:00
Till Wegmueller
d5faf319ab
Add boot wait configuration and improve VM startup logging, bump version to 0.1.5
- Introduce `boot_wait_secs` configuration to delay IP discovery/SSH after VM startup.
- Capture console logs when no SSH logs are available for better debugging during failures.
- Add a utility function to snapshot and persist console logs into job logs.
- Update CLI and environment variable support for the `boot_wait_secs` parameter.
- Bump orchestrator version to 0.1.5.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 21:12:54 +01:00
Till Wegmueller
5d8e79c8d4
Add support for results queue and routing key in MQ configuration, bump version to 0.1.4
- Introduce `results_queue` and `results_routing_key` to MQ configuration.
- Update message publishing and queue declaration logic to leverage new fields.
- Increment orchestrator version to 0.1.4.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 20:51:57 +01:00
Till Wegmueller
8e21c2ba47
Remove unused systemd unit file hardening options, bump version to 0.1.3
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 20:05:21 +01:00
Till Wegmueller
0724a4c526
Enable libvirt feature for orchestrator and bump version to 0.1.2
- Add `--features libvirt` to orchestrator's Debian package build process.
- Update orchestrator version to 0.1.2 in `Cargo.toml`.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 20:01:06 +01:00
Till Wegmueller
fad8e60ec1
Add Debian packaging support and network configuration enhancements
- Introduce Debian package build script using `cargo-deb` for orchestrator releases.
- Add systemd unit file and post-installation script for automatic service setup.
- Update `compose.yml` with host-only port bindings for Postgres and RabbitMQ.
- Introduce NGINX-based log proxy for orchestrator logs with Traefik support.
- Bump orchestrator version to 0.1.1 and update related Cargo metadata for packaging.
- Add example environment file for orchestrator configuration.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-17 19:57:19 +01:00
Till Wegmueller
9dfa9c4b95
Enhance SSH handling with retries and robust error management, refactor guest IP discovery
- Implement SSH execution retries with exponential backoff and timeout handling.
- Replace `virsh domifaddr` with a multi-strategy IP discovery approach.
- Introduce `OrchestratorError` for consistent, structured error reporting.
- Improve runner deployment and SSH session utilities for readability and reliability.
- Add dependencies: `thiserror`, `anyhow` for streamlined error handling.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-15 21:46:54 +01:00
Till Wegmueller
c2fefb5167
Add per-job SSH key support, refactor scheduler for SSH-based job execution, and remove unused runner endpoint
- Introduce fields in `JobContext` for per-job SSH configuration, including user, key paths, and PEM contents.
- Update the scheduler to support SSH-based execution of jobs, including VM lifecycle management and SSH session handling.
- Add utility functions for SSH execution, guest IP discovery, and runner deployment.
- Remove the unused `/runners/{name}` HTTP endpoint and its associated logic.
- Simplify router creation by refactoring out disabled runner directory handling.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-15 18:37:30 +01:00
Till Wegmueller
888aa26388
Add libvirt/KVM integration and Forgejo webhook support to Podman stack
- Extend `.env.sample` with libvirt configuration, Forgejo secrets, and image mapping defaults.
- Update `compose.yml` to enable libvirt integration, including required mounts, devices, and environment variables.
- Add Forgejo webhook configuration and commit status reporting with optional HMAC validation.
- Enhance the orchestrator container with libvirt dependencies and optional features for VM management.
- Document host preparation for libvirt/KVM and image directories in the README.
- Set default fallback values for Traefik ACME CA server.

Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-11-09 17:58:36 +01:00
Till Wegmueller
81a93ef1a7
Enable job log persistence, HTTP server, and extend CI/packaging support
This commit introduces:
- Log persistence feature with a new `job_logs` table and related APIs for recording and retrieving job logs.
- An HTTP server for serving log endpoints and job results.
- Updates to the CI pipeline to enable persistence by default and ensure PostgreSQL readiness.
- Docker Compose updates with a Postgres service and MinIO integration for object storage.
- Packaging scripts for Arch Linux, including systemd service units for deployment.
2025-11-02 23:37:11 +01:00
Till Wegmueller
952262ede4
Upgrade dependencies for Axum, Tonic, Prost, and related build tools across crates
This commit updates multiple dependencies, including:
- `axum` upgraded to 0.8 for HTTP and webhook functionality.
- `tonic` upgraded to 0.14 for gRPC support.
- `prost` upgraded to 0.14 for protobuf processing.
- Addition of `tonic-prost` and `tonic-prost-build` for updated gRPC build configurations.

Relevant Cargo.toml entries and `build.rs` are adjusted to reflect these updates.
2025-11-01 15:24:09 +01:00
Till Wegmueller
1b7b2dd91b
Update parsing logic and upgrade dependencies across crates
This commit updates parsing logic by simplifying `.and_then(|e| e.value().as_string())` calls to `.and_then(|v| v.as_string())`. Additionally, it upgrades several crate dependencies, including `thiserror`, `sea-orm`, `lapin`, `virt`, and `kdl`, to their latest compatible versions for improved functionality and stability.
2025-11-01 14:44:16 +01:00
Till Wegmueller
855aecbb10
Add gRPC support for VM runner log streaming and orchestrator integration
This commit introduces gRPC-based log streaming between the VM runner (`solstice-runner`) and orchestrator. Key updates include:
- Implemented gRPC server in the orchestrator for receiving and processing runner logs.
- Added log streaming and job result reporting in the `solstice-runner` client.
- Defined `runner.proto` with messages (`LogItem`, `JobEnd`) and the `Runner` service.
- Updated orchestrator to accept gRPC settings and start the server.
- Modified cloud-init user data to include gRPC endpoint and request ID for runners.
- Enhanced message queue logic to handle job results via `publish_job_result`.
- Configured `Cross.toml` for cross-compilation of the runner.
2025-11-01 12:14:50 +01:00
Till Wegmueller
7918db3468
Enhance hypervisor image handling with dynamic format detection and raw conversion
This commit improves the hypervisor by:
- Adding support for detecting base image formats using `qemu-img info`.
- Dynamically setting the base image format for overlay creation.
- Automatically converting non-raw images to raw format for bhyve compatibility.
- Updating `Cargo.toml` to include `serde_json` for JSON parsing.
- Modifying default working directory logic for `ZonesHypervisor`.
2025-10-26 18:17:02 +01:00
Till Wegmueller
d05121b378
Switch orchestrator from libvirt crate to virt crate for Linux hypervisor backend
This commit replaces the `libvirt` crate with the `virt` crate for managing the libvirt backend on Linux. Key changes include:

- Updated `Cargo.toml` dependencies and feature configuration.
- Refactored hypervisor implementation to align with `virt` crate API.
- Improved error handling and lifecycle management for VMs and networks.
2025-10-26 16:08:36 +01:00
Till Wegmueller
6568183d86
Add orchestrator persistence using SeaORM for initial database support
This commit introduces a persistence layer to the Orchestrator, enabling it to optionally connect to a Postgres database for recording job and VM states. It includes:

- SeaORM integration with support for migrations from the migration crate.
- `Persist` module with methods for job and VM state upserts.
- No-op fallback when persistence is disabled or unavailable.
- Documentation updates and test coverage for persistence functionality.
2025-10-26 15:38:54 +01:00
Till Wegmueller
a71f9cc7d1
Initial Commit
Signed-off-by: Till Wegmueller <toasterson@gmail.com>
2025-10-25 20:01:08 +02:00