Automatic yt-dlp updates - #415
Merged
Merged
Conversation
Collaborator
Author
|
Here is context on why I made this patch: https://commons.wikimedia.org/wiki/Commons_talk:Video2commons#c-Amdrel-20260804154600-Jeff_G.-20260804145400 Ignore my blurb about the encoders not being affected. They only update if we push new code, which is not ideal. |
don-vip
approved these changes
Aug 6, 2026
Collaborator
|
Wow it's really nice, thank you! We will need to update those python 3.9 / 3.11 jobs to a supported version though. |
Collaborator
Author
|
I agree, and I do want to do that soon. Just didn't want to lump too many changes together all at once to minimize the chances of something going wrong. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This patch adds shell scripts that update
yt-dlpand its optional dependencies everyday. The Toolforgeyt-dlpis updated at 7:33 UTC (seejobs.yaml) and the encoders do it at 6:32 UTC. I staggered them to run after other jobs should have completed just to be safe.The scripts restart the web service and celery processes respectively if the version changed so that the changes actually take effect. However, the Toolforge update script has to get a bit clever as it can't directly utilize the
toolforgeCLI.In Toolforge I set it up to restart
uwsgiby using thetouch-reloadoption, which allows the job totoucha special file atwww/python/reloadand eventually uwsgi will detect that and restart the service. I tested this onvideo2commons-testalready and it notices after a couple of minutes or so.I also tested on encoder01 by manually copying the script over and running it.
Changes
jobs.yamlfile with the newupdate-yt-dlpjob, along with already existing jobs.worker1job on purpose as that job never worked and attempts to setup a Celery worker. I have the old definitions backed up though just in case.utils/update-yt-dlp-encoder.shandutils/update-yt-dlp-toolforge.shshell scripts.www/python/reloadfile that uwsgi will check to perform restarts.www/python/uwsgi.ini.log-maxsize = 10485760specifically) and added thetouch-reloadkey.Deployment
Encoders
These can be deployed like usual with the GitHub Action. There is nothing special to do here.
Toolforge
We shouldn't use the action to deploy changes to Toolforge just this one time. The reason for this is I need to manually shuffle some untracked files around as the
git pullthat gets executed by the GitHub Action will fail as new files added in this commit exist in an untracked state in Toolforge, andgitwon't clobber them.I also need to manually load the new
jobs.yamldefinition, which the GitHub Action doesn't do.