Loading
feat(orchestration): make supervisor XML RPC port and address configurable
Every service's supervisord instance hardcoded port 9001 for its inet HTTP
server, and the client library hardcoded http://juice-{service_name}:9001
to reach it over RPC. In the scenario of upcoming
https://demo.orangeqs.com this is not suitable, because there we avoid the
default orchestrator and instead use custom deployment logic.
In the demo setup all the services are accessible on
http://localhost:XXXX. IPythonKernelConfigs support configuring the
IP/domain name of the services, but in supervisor communication we still
hardcode the conventions of Juice Orchestrator. Thus, we need a way to override:
- Default port to spawn supervisor - it gets also used by the custom logic.
- Address to reach it.
In this merge request we:
- Add
ServiceSettings.supervisor_port(default9001, validated1-65535), used into theservice_supervisor/supervisord.conf.j2template so it controls both theinet_http_serverbind port and thesupervisorctlserver URL. This remains the single source of truth for what port a service's supervisord is actually launched on. - Add
supervisor_porttoKernelConnectionInfo(schemas/ipython.py). It is not part of an actual IPython kernel connection config (and it is excluded fromjupyter_client_connection_info), but this is the most natural place to put it within the current config hirerarchy:IPythonKernelConfigsserve as one per-service address config for both a service's IPython kernel and its supervisord RPC server, via the newIPythonKernelConfigs.for_service(name)(mirroringTaskServerConfigs.for_service), which defaults unsetip/supervisor_portto the Podman-network address (juice-<service_name>, port9001). - Update
client/service.py'srestart_service_partialto resolve a service's address viaIPythonKernelConfigs.for_serviceinstead of hardcoding IP/hostname value. - Both
supervisor_port(onServiceSettings) and theIPythonKernelConfigsoverride are admin-configurable and documented in the generated configuration reference.
Co-Authored-By: Claude Sonnet 5 noreply@anthropic.com
Edited by Viacheslav Ostroukh