algora-io / tv

Open source Twitch for developers
https://algora.tv
GNU Affero General Public License v3.0
867 stars 48 forks source link

Graceful deployments #78

Open zcesur opened 2 weeks ago

zcesur commented 2 weeks ago

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:

  1. Starting a livestream
  2. Triggering a deployment
  3. Confirming that the livestream is still running once the new version is deployed
  4. Stopping the livestream
  5. Confirming that the old machine is destroyed automatically
zcesur commented 2 weeks ago

/bounty $50

algora-pbc[bot] commented 2 weeks ago

💎 $50 bounty • Algora

Steps to solve:

  1. Start working: Comment /attempt #78 with your implementation plan
  2. Submit work: Create a pull request including /claim #78 in the PR body to claim the bounty
  3. Receive payment: 100% of the bounty is received 2-5 days post-reward. Make sure you are eligible for payouts

❗ Important guidelines:

Thank you for contributing to algora-io/tv!

Add a bountyShare 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
aybanda commented 1 week ago

@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
destinedcodes commented 5 days ago

/attempt #78