Description
Currently, when a sleeping app is accessed, the Freeshard controller intercepts the request, holds it, uses Docker to start the container(s), and forwards the traffic once the app is up. This custom "hanging request" logic can be standardized and optimized.
We should replace the custom request holding with Sablier, a Traefik middleware specifically designed for on-demand container execution.
Proposed Changes
- Traefik Integration: Integrate the Sablier middleware into our Traefik reverse proxy configuration.
- Blocking Strategy: Configure Sablier to use the
blocking strategy with a defined timeout to intercept requests targeting inactive containers.
- Controller Hook: Hook Sablier into the Freeshard controller (or the Docker API) to trigger the container start process.
- Health-Check Polling: Delegate the health-check polling to Sablier so it automatically releases the proxy request to the backend as soon as the container is ready.
Motivation
Delegating the network holding complexity to a dedicated Traefik middleware reduces our own codebase maintenance. More importantly, Sablier provides the necessary network-layer foundation to be coupled with CRIU, which will solve the hard timeout issues we experience with native mobile apps.
Description
Currently, when a sleeping app is accessed, the Freeshard controller intercepts the request, holds it, uses Docker to start the container(s), and forwards the traffic once the app is up. This custom "hanging request" logic can be standardized and optimized.
We should replace the custom request holding with Sablier, a Traefik middleware specifically designed for on-demand container execution.
Proposed Changes
blockingstrategy with a defined timeout to intercept requests targeting inactive containers.Motivation
Delegating the network holding complexity to a dedicated Traefik middleware reduces our own codebase maintenance. More importantly, Sablier provides the necessary network-layer foundation to be coupled with CRIU, which will solve the hard timeout issues we experience with native mobile apps.