[FIX]: Unblock deploy blocked by PEP 668 on Python 3.12#1129
Draft
x15sr71 wants to merge 1 commit into
Draft
Conversation
|
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.



Please prefix your pull request with one of the following: [FEATURE] [FIX] [IMPROVEMENT].
In raising this pull request, I confirm the following (please check boxes):
My familiarity with the project is as follows (check one):
Summary
Adds
--break-system-packagesandpython3(where the script used unversionedpython) to all system-wide pip install commands in the deploy, rollback, bootstrap, and legacy workflow paths. Resolves the PEP 668 failure that has been blocking the sample-platform deploy since Jun 15.Why
Deploy run #190 failed at the dependency-install step with an
externally-managed-environmenterror:The VM runs
python33.12.3 and ships/usr/lib/python3.12/EXTERNALLY-MANAGED. System-widepip installis blocked by PEP 668 unless--break-system-packagesis explicit. Becauseset -eaborts the deploy script on the failed pip call,systemctl reload platformis never reached, so even after a successfulgit pullthe running gunicorn process keeps serving stale code.Runs #188 and #189 failed at the same step and are likely the same issue, but only #190's full log was inspected.
The VM does not provide an unversioned
pythoninterpreter, so the legacy workflow path andinstall/install.shwould fail withpython: command not foundif invoked:python3replacespythonin those locations for consistency with the VM environment.Why this affects production right now
On the VM, three signals confirm the running process is stale:
mod_test/controllers.pymtime:Jun 15 17:22(git pull on Jun 15 succeeded)mod_test/__pycache__/controllers.cpython-310.pycmtime:Mar 12 13:06(module never re-imported)Wed Jun 3 16:41:32(process never restarted)Merged fixes after Jun 3 (#1118, #1119) are on disk but not in the running process.
Files patched
install/deploy/deploy.sh:48--break-system-packagesinstall/deploy/rollback.sh:87--break-system-packagesinstall/install.sh:67,69python→python3, add--break-system-packagespythonis not installed on the VM.github/workflows/sp-deployment-pipeline.yml:84,159python→python3, add--break-system-packagesWhy
--break-system-packagesThis is a dedicated VM running a single application. System Python is the application runtime; there's no separate system Python stack to destabilize. The flag is the standard PEP 668 workaround for this configuration.
A virtualenv migration is the cleaner long-term fix but requires coordinated changes to the systemd unit, bootstrap, and call sites — out of scope for unblocking the current deploy.
Verification after merge
After the workflow runs successfully, on the VM:
ls -la /var/www/sample-platform/mod_test/__pycache__/controllers.cpython-310.pyc ps -o pid,lstart,cmd -p $(pgrep -f "gunicorn.*sample-platform" | head -1)Both should show recent timestamps, indicating Python re-imported the module and the gunicorn reload took effect.
Notes
This PR is intentionally scoped to the pip-install commands hitting PEP 668 and the related
python→python3fixes in the same scripts. No application logic changes.