-
-
Notifications
You must be signed in to change notification settings - Fork 2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: pull coolify image only when the app needs to be updated #3312
fix: pull coolify image only when the app needs to be updated #3312
Conversation
🔍 Existing Issues For ReviewYour pull request is modifying functions with the following pre-existing issues: 📄 File: app/Console/Kernel.php
Did you find this useful? React with a 👍 or 👎 |
@Vahor Why not just change the cron interval in the settings so change the update check frequency so that it does not happen every hour (I added it in v320, so it is new)? |
@peaklabs-dev the 1h cron is not the issue, the issue is pulling a docker image when it's not needed, we should only pull the latest image when we want to actually upgrade the app |
6139f7a
to
0dad77a
Compare
Ah now, I see what you mean. Man, today is not my best day (the second time my brain just gave up). I should probably go to sleep. |
I put a question in the description but maybe you can answer it (maybe tomorrow 😁)
|
I have added a version controlled helper image, so the pull helper image job should check the latest version via http request (which costs way less cpu than docker pull) and if an update is available, then pull the new version. I also test this. |
Still looking to improve #3226
While doing so, I saw that the
PullCoolifyImageJob
was called every hour 👀 and even ifis_auto_update_enabled
was disabled, it was pulling the latest docker image (doing ssh stuff etc) so not really geat.I also saw that at the end this job might not be needed as we already have a job to Update the instance, and pulling the latest version at that moment seems a better idea ?
So what that pr does:
PullCoolifyImageJob
thus making it a "FetchLatestCoolifyVersionJob"CheckForUpdatesJob
that fetch the version (in the same cron interval), and could save the versions.json file. That's what I did, thePullCoolifyImageJob
is entirely removed, andCheckForUpdatesJob
now saves the json file.Note: not really sure how to test this, in local I removed the isDev check and made sure that there was no error in the scheduler. I also tried to force an update by removing the
$this->latestVersion === $this->currentVersion
check, no issue so far. (but as it's local I might have missed something)And question for the reviewer as I do not know the codebase well enough: Do we need to have a
PullHelperImageJob
and run it every hour (update_check_frequency). Or can we pull that image when upgrading the app ? (or in other words, does the helper image change outside of releases)