Skip to content

fix: install each service's pinned pip into its venv - #400

Merged
vgulati-apphelix merged 1 commit into
masterfrom
vgulati/LP-1401
Oct 27, 2026
Merged

vgulati-apphelix merged 1 commit into
masterfrom
vgulati/LP-1401

Conversation

@vgulati-apphelix

Copy link
Copy Markdown
Member

Description

Security fix for the eMudhra / emSign CA incident (GHSA-6q48-6c7w-9gw2). pip vendors its own certifi, so hosts need pip 26.2.2 as well as certifi 2026.10.19.

xqueue, xqueue-watcher, edx-analytics-dashboard and edx-analytics-data-api are built as AMIs by these roles, not from Docker images, so the pip fix in the app repos and in edx/public-dockerfiles#234 never reached them. Their venvs kept an old pip:

Play Venv pip came from Before
xqueue python3.12 -m venv (ensurepip) 24.0
xqwatcher virtualenv 20.27.0 24.2
insights virtualenv 20.27.0 (via edx_service) 24.2
analyticsapi edx_django_service "Pin pip" step (COMMON_PIP_VERSION) 24.0

Each role now installs the app repo's own requirements/pip.txt (pip==26.2.2 on all four repos' default branches) into the venv before the app requirements:

  • xqueue, xqwatcher: new "Install pinned pip" task, with xqueue_pip_requirements_file / xqwatcher_pip_requirements_file defaults.
  • insights: pip.txt added first in insights_requirements.
  • edx_django_service: the "Pin pip" step uses a new edx_django_service_pip_install_args, defaulting to the existing pip=={{ COMMON_PIP_VERSION }}, so other services are unchanged. analytics_api overrides it with -r <code_dir>/requirements/pip.txt.

COMMON_PIP_VERSION (system pip) is not changed: pip 26.2.2 needs Python 3.10+, and plays still on Python 3.8 would break.

Supporting information

Testing

  • ansible-playbook --syntax-check (ansible 2.10.7): xqueue.yml, xqwatcher.yml, insights.yml, analyticsapi.yml pass.
  • Simulated each venv in containers with the repos' real pip.txt: xqueue (python3.12 -m venv) 25.0.1 → 26.2.2; xqwatcher / insights (virtualenv 20.27.0) 24.2 → 26.2.2; analyticsapi (py3.11, pinned 24.0) 24.0 → 26.2.2.
  • App code is checked out before these tasks (edx_service → git_clone in each role's meta), so requirements/pip.txt exists when they run. No overrides of the touched variables in edx-internal.
  • Not yet run as a real AMI build. After merge: run the xqueue, xqwatcher, insights and analytics-api pipelines, then check <venv>/bin/pip --version is 26.2.2 on a new host.

Make sure that the following steps are done before merging:

  • Have a Site Reliability Engineer review the PR if you don't own all of the services impacted.
  • If you are adding any new default values that need to be overridden when this change goes live, update internal repos and add an entry to the top of the CHANGELOG.
  • Performed the appropriate testing.

🤖 Generated with Claude Code

xqueue, xqwatcher, insights and analytics_api venvs got pip from
ensurepip/virtualenv (24.x), or from the COMMON_PIP_VERSION pin (24.0)
for edx_django_service. pip vendors its own certifi, so these hosts kept
trusting the emSign root removed in certifi 2026.10.19 (eMudhra incident)
for any pip install.

Install the app repo's requirements/pip.txt (pip==26.2.2) into the venv
before the app requirements. edx_django_service gets an overridable
edx_django_service_pip_install_args that defaults to the existing
COMMON_PIP_VERSION pin, so other services are unchanged.

Ticket: LP-1401

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@abhalsod-sonata abhalsod-sonata left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@vgulati-apphelix
vgulati-apphelix merged commit d1fc129 into master Oct 27, 2026
3 checks passed
@vgulati-apphelix
vgulati-apphelix deleted the vgulati/LP-1401 branch October 27, 2026 12:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants