Skip to content

Conversation

@djeebus
Copy link
Contributor

@djeebus djeebus commented Oct 16, 2025

This keeps support for assuming an orchestrator port number, but only as a fallback. This allows us to place orchestrators where ever we want, with whatever port number we want, and the API will find them.


Note

API now discovers orchestrator IP/port from Nomad allocation resources (label grpc), with a configurable default fallback; Nomad job defines labeled ports and env wired from Nomad.

  • Orchestrator discovery (API):
    • Switch from listing Nomad nodes to listing allocations with filter ClientStatus == "running" and JobID contains "orchestrator-".
    • Add health gating via isHealthy and resolve address by scanning AllocatedResources for port label o.portLabel (fallback to o.defaultPort).
    • Build NomadServiceDiscovery from allocation IP/port; logs when missing/found.
    • Add tests for isHealthy and port resolution across reserved/dynamic/shared networks in client_test.go.
  • Configuration:
    • Introduce Config.DefaultOrchestratorPort (deprecated fallback) and Config.OrchestratorPortLabel (default grpc).
    • Thread defaultPort and portLabel into Orchestrator.
  • Nomad job (iac/provider-gcp/nomad/jobs/orchestrator.hcl):
    • Define network { mode = "host" } with labeled ports grpc and proxy; services reference labels.
    • Set GRPC_PORT/PROXY_PORT from $${NOMAD_PORT_grpc}/$${NOMAD_PORT_proxy}.
  • Cleanup:
    • Remove OrchestratorPort from packages/shared/pkg/consts/sandboxes.go.

Written by Cursor Bugbot for commit bd75947. This will update automatically on new commits. Configure here.

cursor[bot]

This comment was marked as outdated.

cursor[bot]

This comment was marked as outdated.

@djeebus djeebus requested a review from ValentaTomas October 31, 2025 00:59
@djeebus djeebus merged commit dfe87b9 into main Oct 31, 2025
27 checks passed
@djeebus djeebus deleted the api-find-orchestrators branch October 31, 2025 01:00
djeebus added a commit that referenced this pull request Oct 31, 2025
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.

4 participants