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

ref: switch from mywsgi/uwsgi to pyuwsgi #3076

Merged
merged 1 commit into from
Aug 30, 2022
Merged

Conversation

asottile-sentry
Copy link
Member

@asottile-sentry asottile-sentry commented Aug 19, 2022

pyuwsgi provides wheels making it much faster to install whereas uwsgi isn't wheelable

this also cuts about 10 minutes from the uncached arm64 image build (17 minutes -> 7 minutes)

@codecov-commenter
Copy link

Codecov Report

Merging #3076 (fab53a7) into master (bfec4dd) will increase coverage by 0.19%.
The diff coverage is 30.00%.

❗ Current head fab53a7 differs from pull request most recent head 365f19c. Consider uploading reports for the commit 365f19c to get more accurate results

@@            Coverage Diff             @@
##           master    #3076      +/-   ##
==========================================
+ Coverage   92.53%   92.72%   +0.19%     
==========================================
  Files         655      656       +1     
  Lines       30353    30379      +26     
==========================================
+ Hits        28087    28170      +83     
+ Misses       2266     2209      -57     
Impacted Files Coverage Δ
snuba/utils/uwsgi.py 26.92% <26.92%> (ø)
snuba/cli/admin.py 45.83% <50.00%> (+4.16%) ⬆️
snuba/cli/api.py 40.62% <50.00%> (+3.12%) ⬆️
snuba/utils/streams/metrics_adapter.py 75.00% <0.00%> (+8.33%) ⬆️
snuba/environment.py 100.00% <0.00%> (+16.66%) ⬆️
snuba/cli/consumer.py 96.07% <0.00%> (+27.45%) ⬆️
snuba/consumers/consumer_builder.py 91.15% <0.00%> (+49.55%) ⬆️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

Comment on lines +45 to +69
options: dict[str, bool | int | str | None] = {
"auto_procname": True,
"chmod_socket": 777,
"die_on_term": True,
"disable_write_exception": True,
"enable_threads": True,
"ignore_sigpipe": True,
"ignore_write_errors": True,
"lazy_apps": True,
"log_format": '%(addr) - %(user) [%(ltime)] "%(method) %(uri) %(proto)" %(status) %(size) "%(referer)" "%(uagent)"',
"log_x_forwarded_for": True,
"master": True,
"module": module,
"need_app": True,
"processes": 1,
"protocol": protocol,
"single_interpreter": True,
"threads": 1,
"thunder_lock": True,
"vacuum": True,
"virtualenv": sys.prefix,
"wsgi_env_behavior": "holy",
f"{protocol}_socket": bind,
**kwargs,
}
Copy link
Member Author

Choose a reason for hiding this comment

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

these are copied from mywsgi which appear to be copied from sentry

@asottile-sentry asottile-sentry marked this pull request as ready for review August 19, 2022 19:24
@asottile-sentry asottile-sentry requested a review from a team as a code owner August 19, 2022 19:24
@asottile-sentry
Copy link
Member Author

not planning to merge or roll this out until after sentry has and after hackweek -- unless there's interest in doing it sooner rather than later 🤷

@@ -46,13 +47,11 @@ def api(
WSGIRequestHandler.protocol_version = "HTTP/1.1"
application.run(host=host, port=port, threaded=True, debug=debug)
else:
import mywsgi

if log_level:
os.environ["LOG_LEVEL"] = log_level

with flush_attribution_producer():
Copy link
Member Author

Choose a reason for hiding this comment

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

unrelated to this patch but this call does nothing! both myuwsgi.run and snuba.utils.uwsgi.run end with os.execvp which replaces the current process

pyuwsgi provides wheels making it much faster to install whereas uwsgi isn't wheelable
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