Skip to content
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

Orchestrator Workload Client (points to holo-agent-service-module) #53

Open
wants to merge 19 commits into
base: main
Choose a base branch
from

Conversation

JettTech
Copy link
Contributor

@JettTech JettTech commented Jan 20, 2025

The primary intent of this PR is to separate out the Orchestrator Client into its own feature PR.

Updates:

  • Adds orchestrator workload client
  • Cleans up workload service
    • Refactors the workload service api into a trait
    • Adds distinct service api structs for the host and orchestrator
  • Adds ServiceError and standardizes input/output types for workload service
  • Cleans up naming in util_libs

steveej and others added 12 commits January 20, 2025 14:04
this is required when VM tests use nixos modules that live in a
blueprint repository like this.
previously it would only expose the target directory as an archive.
iterate on holo-agent-integration-nixos with code changes all over the place.

test can be run with:

nix build -vL .\#checks.x86_64-linux.holo-agent-integration-nixos
…sistency

this also takes out the hardoded path for the credentials path which has
been panicing in the integration tests.
when running the host-agent on system startup there seems to be a race
condition that prevents the agent from connecting to the spawned NATS
instance.

the root cause for this _might_ be a race condition between the network
stack availability and spawning Nats, however that's a guess. it might
also just take a 100-200ms for Nats to start servicing the TCP port.

either way, the boot log in the integration test looks like this with
the fix applied. the loop fails once and then succeeds after waiting
100ms:

```
[    6.690765] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  util_libs::nats_server] NATS Leaf Server is running at 127.0.0.1:4222
[    6.692975] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  host_agent::workload_manager] HPOS Agent Client: Connecting to server...
[    6.695163] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  host_agent::workload_manager] host_creds_path : None
[    6.696391] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  host_agent::workload_manager] host_pubkey : host_id_placeholder>
[    6.698881] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  host_agent::workload_manager] nats_url : 127.0.0.1:4222
[    6.720665] systemd-logind[707]: New seat seat0.
[    6.723219] holo-host-agent-start[695]: [2025-01-20T20:53:16Z WARN  host_agent::workload_manager] connecting to NATS via 127.0.0.1:4222: IO error: Connection refused (os error 111), retrying in 100ms
[    6.726726] systemd-logind[707]: Watching system buttons on /dev/input/event2 (Power Button)
[    6.727999] systemd-logind[707]: Watching system buttons on /dev/input/event3 (QEMU Virtio Keyboard)
[    6.731311] systemd-logind[707]: Watching system buttons on /dev/input/event0 (AT Translated Set 2 keyboard)
[    6.734306] systemd[1]: Started User Login Management.
[    6.762172] systemd[1]: Started Name Service Cache Daemon (nsncd).
[    6.764253] nsncd[750]: Jan 20 20:53:16.581 INFO started, config: Config { ignored_request_types: {}, worker_count: 8, handoff_timeout: 3s }, path: "/var/run/nscd/socket"
[    6.767328] systemd[1]: Reached target Host and Network Name Lookups.
[    6.768655] systemd[1]: Reached target User and Group Name Lookups.
[    6.771096] systemd[1]: Finished resolvconf update.
[    6.771760] systemd[1]: Reached target Preparation for Network.
[    6.776104] systemd[1]: Starting DHCP Client...
[    6.779801] systemd[1]: Starting Address configuration of eth1...
[    6.862637] network-addresses-eth1-start[775]: adding address 192.168.1.1/24... done
[    6.872977] holo-host-agent-start[695]: [2025-01-20T20:53:16Z INFO  util_libs::nats_js_client] NATS-CLIENT-LOG::Host Agent::Connected to NATS server at 127.0.0.1:4222
[    6.880800] network-addresses-eth1-start[775]: adding address 2001:db8:1::1/64... done
[    6.903973] systemd[1]: Finished Address configuration of eth1.
```
@JettTech JettTech marked this pull request as ready for review January 20, 2025 22:09
@JettTech JettTech changed the title Orchestrator Client Orchestrator Workload Client Jan 20, 2025
@JettTech JettTech changed the base branch from main to holo-agent-service-module January 21, 2025 02:32
@JettTech JettTech changed the base branch from holo-agent-service-module to main January 21, 2025 02:37
@JettTech JettTech changed the title Orchestrator Workload Client Orchestrator Workload Client (points to holo-agent-service-module) Jan 21, 2025
@pandeyAK
Copy link
Contributor

@JettTech Which task is this PR related to?

@JettTech
Copy link
Contributor Author

JettTech commented Jan 21, 2025

@pandeyAK - This pr is apart of the work needed to support the workload API flow on the orchestrator side, which relates to ticket 43. (FYI: This work was previously apart of another pr and has been separated out for ease of review and feature distinction.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants