Skip to content
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

Revert recent config changes #8406

Merged
merged 2 commits into from
Jan 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ on:
- '.github/workflows/deploy.yml'
- '.github/workflows/redeploy.yml'
- 'bin/logger'
- 'conf/development.ini'
- 'production.ini'
- 'conf/development-app.ini'
- 'app.ini'
- 'conf/supervisord*.conf'
- 'docs/*'
- 'requirements/*.in'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/data_tasks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,5 +55,5 @@ jobs:
Env: ${{ inputs.Environment }}
Timeout: 7200
Region: ${{ inputs.Region }}
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/production.ini --task ${{ inputs.Task }}'
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/app.ini --task ${{ inputs.Task }}'
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
- '.github/*'
- 'bin/create-testdb'
- 'bin/install-python'
- 'conf/development.ini'
- 'conf/development-app.ini'
- 'conf/supervisord-dev.conf'
- 'conf/websocket-dev.ini'
- 'docs/*'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/report_refresh.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ jobs:
Env: 'prod'
Timeout: 3600
Region: 'all'
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/production.ini --task report/refresh'
Command: 'newrelic-admin run-program python bin/run_data_task.py --config-file conf/app.ini --task report/refresh'
secrets: inherit
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ devdata: python

.PHONY: shell
shell: python
@pyenv exec tox -qe dev --run-command 'pshell conf/development.ini'
@pyenv exec tox -qe dev --run-command 'pshell conf/development-app.ini'

.PHONY: sql
sql: python
Expand Down
2 changes: 1 addition & 1 deletion bin/make_db
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ def init_search(settings):


def main():
with bootstrap("conf/development.ini") as env:
with bootstrap("conf/development-app.ini") as env:
settings = env["registry"].settings
init_db(settings)
init_search(settings)
Expand Down
5 changes: 5 additions & 0 deletions conf/production.ini → conf/app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@ use: call:h.app:create_app
[filter:proxy-prefix]
use: egg:PasteDeploy#prefix

[server:main]
use: egg:gunicorn#main
bind: unix:/tmp/gunicorn-web.sock
proc_name: web

[loggers]
keys = root, alembic, gunicorn.error, h

Expand Down
9 changes: 9 additions & 0 deletions conf/development.ini → conf/development-app.ini
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ secret_key: notverysecretafterall

sqlalchemy.url: postgresql://postgres@localhost/postgres

[server:main]
use: egg:gunicorn#main
host: 0.0.0.0
port: 5000
proc_name: web
graceful_timeout: 0
timeout: 0
errorlog: -

[pshell]
setup = h.pshell.setup

Expand Down
3 changes: 0 additions & 3 deletions conf/gunicorn-dev.conf.py

This file was deleted.

5 changes: 0 additions & 5 deletions conf/gunicorn-websocket-dev.conf.py

This file was deleted.

5 changes: 0 additions & 5 deletions conf/gunicorn-websocket-monolithic.conf.py

This file was deleted.

5 changes: 0 additions & 5 deletions conf/gunicorn-websocket.conf.py

This file was deleted.

1 change: 0 additions & 1 deletion conf/gunicorn.conf.py

This file was deleted.

4 changes: 2 additions & 2 deletions conf/supervisord-dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@ nodaemon = true
silent = true

[program:web]
command = gunicorn --paste conf/development.ini --config conf/gunicorn-dev.conf.py
command = pserve --reload conf/development-app.ini
stdout_events_enabled=true
stderr_events_enabled=true
stopsignal = KILL
stopasgroup = true
autostart = %(ENV_ENABLE_WEB)s

[program:websocket]
command = gunicorn --paste conf/websocket-dev.ini --config conf/gunicorn-websocket-dev.conf.py
command = pserve --reload conf/websocket-dev.ini
stdout_events_enabled=true
stderr_events_enabled=true
stopsignal = KILL
Expand Down
13 changes: 2 additions & 11 deletions conf/supervisord.conf
Original file line number Diff line number Diff line change
Expand Up @@ -13,30 +13,21 @@ stderr_events_enabled=true
autostart = %(ENV_ENABLE_NGINX)s

[program:web]
command=newrelic-admin run-program gunicorn --paste conf/production.ini --config conf/gunicorn.conf.py
command=newrelic-admin run-program pserve conf/app.ini
stdout_logfile=NONE
stderr_logfile=NONE
stdout_events_enabled=true
stderr_events_enabled=true
autostart = %(ENV_ENABLE_WEB)s

[program:websocket]
command=gunicorn --paste conf/websocket.ini --config conf/gunicorn-websocket.conf.py
command=pserve %(ENV_WEBSOCKET_CONFIG)s
stdout_logfile=NONE
stderr_logfile=NONE
stdout_events_enabled=true
stderr_events_enabled=true
autostart = %(ENV_ENABLE_WEBSOCKET)s

[program:websocket-monolithic]
command=gunicorn --paste conf/websocket-monolithic.ini --config conf/gunicorn-websocket-monolithic.conf.py
stdout_logfile=NONE
stderr_logfile=NONE
stdout_events_enabled=true
stderr_events_enabled=true
autostart = %(ENV_ENABLE_WEBSOCKET_MONOLITHIC)s
process_name = websocket

[program:worker]
command=newrelic-admin run-program hypothesis celery worker --loglevel=INFO
stdout_logfile=NONE
Expand Down
11 changes: 11 additions & 0 deletions conf/websocket-dev.ini
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,17 @@ secret_key: notverysecretafterall
# SQLAlchemy configuration -- See SQLAlchemy documentation
sqlalchemy.url: postgresql://postgres@localhost/postgres

[server:main]
use: egg:gunicorn#main
host: localhost
port: 5001
worker_class: h.streamer.Worker
graceful_timeout: 0
proc_name: websocket
# This is very low so you can see what happens when we run out
workers: 2
worker_connections: 8

[loggers]
keys = root, gunicorn.error, h

Expand Down
9 changes: 9 additions & 0 deletions conf/websocket-monolithic.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[app:main]
use: call:h.streamer:create_app

[server:main]
use: egg:gunicorn#main
bind: unix:/tmp/gunicorn-websocket.sock
worker_class: h.streamer.Worker
graceful_timeout: 0
proc_name: websocket
workers: 2
worker_connections: 8192

[loggers]
keys = root, gunicorn.error, h.streamer

Expand Down
10 changes: 10 additions & 0 deletions conf/websocket.ini → conf/websocket-separate.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,16 @@
[app:main]
use: call:h.streamer:create_app

[server:main]
use: egg:gunicorn#main
host: 0.0.0.0
port: 5000
worker_class: h.streamer.Worker
graceful_timeout: 0
proc_name: websocket
workers: 2
worker_connections: 8192

[loggers]
keys = root, gunicorn.error, h.streamer

Expand Down
2 changes: 1 addition & 1 deletion h/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def bootstrap(app_url, dev=False):
else:
raise click.ClickException("the app URL must be set in production mode!")

config = "conf/development.ini" if dev else "conf/production.ini"
config = "conf/development-app.ini" if dev else "conf/app.ini"

paster.setup_logging(config)
request = Request.blank("/", base_url=app_url)
Expand Down
2 changes: 1 addition & 1 deletion tests/functional/bin/run_data_task_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def test_reporting_tasks(self, environ):
sys.executable,
"bin/run_data_task.py",
"--config-file",
"conf/development.ini",
"conf/development-app.ini",
"--task",
task_name,
],
Expand Down