Implement graceful shutdown of old machines during Fly.io deployments to ensure livestreams are not interrupted.
Pipeline Changes:
Modify lib/algora/pipeline.ex to list pipelines using Membrane.Pipeline.list_pipelines and check for running livestreams.
Add logic to destroy old machines if no livestreams are running in the :end_of_stream callback.
Termination Logic:
Update lib/algora/terminate.ex to include a function terminate_interrupted_streams that lists pipelines and destroys old machines if no livestreams are running.
Deployment Controller:
Add lib/algora_web/controllers/deployment_controller.ex to handle deployment-related actions such as starting/stopping livestreams, triggering deployments, confirming livestream continuity, and destroying old machines.
Router Updates:
Modify lib/algora_web/router.ex to add routes for the new deployment-related actions in the DeploymentController.
Tests:
Add test/algora_web/controllers/deployment_controller_test.exs to test the new deployment-related actions in the DeploymentController.
Related to #78
Implement graceful shutdown of old machines during Fly.io deployments to ensure livestreams are not interrupted.
Pipeline Changes:
lib/algora/pipeline.ex
to list pipelines usingMembrane.Pipeline.list_pipelines
and check for running livestreams.:end_of_stream
callback.Termination Logic:
lib/algora/terminate.ex
to include a functionterminate_interrupted_streams
that lists pipelines and destroys old machines if no livestreams are running.Deployment Controller:
lib/algora_web/controllers/deployment_controller.ex
to handle deployment-related actions such as starting/stopping livestreams, triggering deployments, confirming livestream continuity, and destroying old machines.Router Updates:
lib/algora_web/router.ex
to add routes for the new deployment-related actions in theDeploymentController
.Tests:
test/algora_web/controllers/deployment_controller_test.exs
to test the new deployment-related actions in theDeploymentController
./claim #78