Repository navigation
v2.0.3
Patch release fixing service registration when the advertised port differs from the port the app binds. No breaking changes.
Fixed
- Registration no longer skips services published or proxied on another port (CLIM-1248). Before registering, servicekit waits for the app to become ready by probing
127.0.0.1, and it probed the advertisedSERVICEKIT_PORT. A container run with-p 18701:8000andSERVICEKIT_PORT=18701, as needed when the orchestrator runs on the Docker host, was therefore probed on a port nothing listens on inside the container, timed out withregistration.readiness_timeout, and loggedApp never became ready, skipping registration. The readiness probe now targets the local bind port, resolved separately from the advertised port:with_registration(local_port=...)when set, otherwisePORT, the advertised port, and 8000 are tried in turn.SERVICEKIT_PORTremains the port sent to the orchestrator. - The probe only accepts responses from its own app instance, using a per-instance token echoed by a middleware that wraps the whole stack. Another server on a candidate port (for example an orchestrator on 8000) is never mistaken for the service, and the probe keeps working with
with_auth(), with middleware added afterbuild(), and alongsidewith_monitoring()instrumentation.
Added
with_registration(local_port=None, local_port_env="PORT")to name the local bind port explicitly.run_appexports the port uvicorn binds asPORT, in addition to the existingSERVICEKIT_PORTdefault.
Upgrading
Drop-in for 2.0.x users. Setups where the advertised port equals the bind port keep working unchanged. Services behind a published or proxied port can now set SERVICEKIT_PORT to the port the orchestrator uses; the app is found on PORT, the advertised port, or 8000, and local_port covers any other bind port. The registration guide now describes the advertised and local ports separately.
What's Changed
- fix(registration): probe the bind port separately from the advertised port by @mortenoh in #42
- chore: release 2.0.3 by @mortenoh in #43
Full Changelog: v2.0.2...v2.0.3