Graceful deployments
Let's set up a Fly.io deployment pipeline such that machines running with an old version are shut down gracefully. This is important to ensure livestreams are not interrupted during deployments
This tweet along with this complementary repo explain how we can implement this
The only missing part is to destroy old machines after all running livestreams are terminated, which we can implement inside the end_of_stream callback using Membrane.Pipeline.list_pipelines
If anyone wants to tackle this, please include a short demo of the entire process in the PR, which should include:
- Starting a livestream
- Triggering a deployment
- Confirming that the livestream is still running once the new version is deployed
- Stopping the livestream
- Confirming that the old machine is destroyed automatically
/bounty $50
💎 $50 bounty • Algora
Steps to solve:
- Start working: Comment
/attempt #78with your implementation plan - Submit work: Create a pull request including
/claim #78in the PR body to claim the bounty - Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts
❗ Important guidelines:
- To claim a bounty, you need to provide a short demo video of your changes in your pull request
- If anything is unclear, ask for clarification before starting as this will help avoid potential rework
- For assistance or questions, join our Discord
Thank you for contributing to algora-io/tv!
Add a bounty • Share on socials
| Attempt | Started (GMT+0) | Solution |
|---|---|---|
| 🔴 @aybanda | Sep 5, 2024, 6:04:09 AM | WIP |
| 🟢 @destinedcodes | Sep 12, 2024, 4:36:40 PM | WIP |
| 🟢 @vishwamartur | Nov 17, 2024, 5:19:09 PM | WIP |
| 🟢 @simangaKhumalo | Jan 31, 2025, 8:36:00 AM | WIP |
@zcesur /attempt #78 Here is my implementation plan 1.Set up environment 2.Implement livestream status check 3.Implement old machine destruction check 4.Create livestream control endpoints 5.Test livestream start 6.Set up Fly.io deployment 7.Implement deployment monitoring 8.Run full demo deployment 9.Error handling
| Algora profile | Completed bounties | Tech | Active attempts | Options |
|---|---|---|---|---|
| @aybanda | 1 bounty from 1 project | Cancel attempt |
Just checking in, is this still needed?
Yep, still open @raphaelbernhart
/attempt #78
Implementation Plan:
-
Set Up Fly.io Deployment Pipeline:
- Configure Fly.io for deploying new versions of the service.
- Ensure the deployment process does not interrupt ongoing livestreams.
-
Handle Livestreams Gracefully:
- Use the end of stream callback to detect when a livestream ends.
- Implement the Membrane Pipeline list pipelines function to check for active pipelines.
-
Shut Down Old Machines:
- After confirming all livestreams have ended, trigger the shutdown of old machines.
-
Create a Demo Video:
- Record a video showing:
- Starting a livestream.
- Triggering a deployment.
- Confirming the livestream is running after deployment.
- Stopping the livestream.
- Confirming the old machine is destroyed automatically.
- Record a video showing:
-
Submit Pull Request:
- Create a PR with the changes and include
/claim #78in the PR body. - Attach the demo video in the PR.
- Create a PR with the changes and include
Hi @zcesur I'd like to work on this and wanted to clarify the scope.
Is the expectation to implement the Fly.io graceful deployment process entirely through a GitHub Actions workflow? or is having a deploy.exs script sufficient for now?
Hey @miguelnietoa thanks for jumping in!
This repo is on maintenance mode, but we'll need the same feature in the new app so how about we add it there? We'll open source it this week but I just gave you access if you wanna check it out!
And yeah having a deploy.exs script works
Hi @zcesur - sure, I'll check it out there! Thanks for the invite.
@zcesur Is this feature still needed or has it been implemented in the new app?
Still needed in https://github.com/algora-io/algora