Skip to content

v2.0.3

Choose a tag to compare

@github-actions github-actions released this 30 Sep 12:23
· 10 commits to main since this release
v2.0.3
01f98be

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 advertised SERVICEKIT_PORT. A container run with -p 18701:8000 and SERVICEKIT_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 with registration.readiness_timeout, and logged App 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, otherwise PORT, the advertised port, and 8000 are tried in turn. SERVICEKIT_PORT remains 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 after build(), and alongside with_monitoring() instrumentation.

Added

  • with_registration(local_port=None, local_port_env="PORT") to name the local bind port explicitly.
  • run_app exports the port uvicorn binds as PORT, in addition to the existing SERVICEKIT_PORT default.

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