Skip to content

Run codespeed migrate/collectstatic under each instance's settings module - #677

Merged
jmcshannon merged 1 commit into
python:mainfrom
StanFromIreland:codespeed-pre-reload-settings
Nov 9, 2026
Merged

jmcshannon merged 1 commit into
python:mainfrom
StanFromIreland:codespeed-pre-reload-settings

Conversation

@StanFromIreland

Copy link
Copy Markdown
Member

Unfortunately, a little hiccup with the recent refactor. Since #673 switched both sites to main, manage.py in python/codespeed defaults to speed_python.settings... The pre-reload step (migrate && collectstatic) does not set DJANGO_SETTINGS_MODULE, so on the PyPy instance it imports the CPython settings and fails on the missing speed_python/local_settings.py.

From /var/log/salt/cron-highstate.log:

      ID: codespeed-pypy-source
Function: git.latest
  Result: True
 Comment: https://github.com/python/codespeed.git was fetched, resulting in updated refs. Repository was fast-forwarded to origin/main (6855fa0).
---
      ID: codespeed-pypy-pre-reload
Function: cmd.run
    Name: /srv/codespeed/pypy/env/bin/python manage.py migrate --noinput && /srv/codespeed/pypy/env/bin/python manage.py collectstatic --noinput
  Result: False
          retcode:
              1
          stderr:
                File "/srv/codespeed/pypy/src/speed_python/settings.py", line 133, in <module>
                  from .local_settings import *
              ModuleNotFoundError: No module named 'speed_python.local_settings'
---
      ID: codespeed-pypy
Function: service.running
  Result: False
 Comment: One or more requisite failed: codespeed.codespeed-pypy-pre-reload

Pass DJANGO_SETTINGS_MODULE={{ module }}.settings to the pre-reload so each instance migrates and collects static files under its own settings. Also, add enable: True to the gunicorn service.running state, since both units are currently disabled and would not come back after a reboot.

@JacobCoffee / @jmcshannon could you please review?

@jmcshannon
jmcshannon merged commit 71945c0 into python:main Nov 9, 2026
3 checks passed
@StanFromIreland
StanFromIreland deleted the codespeed-pre-reload-settings branch November 9, 2026 17:20
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.

2 participants