Merge ~pappacena/launchpad:enabling-gunicorn-in-development into launchpad:master

Proposed by Thiago F. Pappacena
Status: Merged
Approved by: Thiago F. Pappacena
Approved revision: 1a5da57418e87f0218f8ffd9274a61c80d225a6b
Merge reported by: Otto Co-Pilot
Merged at revision: not available
Proposed branch: ~pappacena/launchpad:enabling-gunicorn-in-development
Merge into: launchpad:master
Prerequisite: ~pappacena/launchpad:gunicorn-appserver-tests
Diff against target: 53 lines (+11/-3)
4 files modified
configs/development/gunicorn.conf.py (+6/-0)
configs/development/launchpad-lazr.conf (+1/-0)
lib/lp/services/config/__init__.py (+1/-3)
lib/lp/services/config/schema-lazr.conf (+3/-0)
Reviewer Review Type Date Requested Status
Colin Watson Approve
Cristian Gonzalez (community) Approve
Review via email: mp+396701@code.launchpad.net

Commit message

Enabling gunicorn (with autoreload) in development

Description of the change

The gunicorn configuration for Launchpad is not production ready yet, but it might worth enabling it in development so we all can test and see if any obvious thing pops out.

To post a comment you must log in.
Revision history for this message
Cristian Gonzalez (cristiangsp) wrote :

Gunicorn time!

review: Approve
Revision history for this message
Colin Watson (cjwatson) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/configs/development/gunicorn.conf.py b/configs/development/gunicorn.conf.py
2new file mode 100644
3index 0000000..b667109
4--- /dev/null
5+++ b/configs/development/gunicorn.conf.py
6@@ -0,0 +1,6 @@
7+bind = [":8085", ":8086", ":8087", ":8088", ":8089"]
8+workers = 2
9+threads = 10
10+max_requests = 1000
11+log_level = "DEBUG"
12+reload = True
13diff --git a/configs/development/launchpad-lazr.conf b/configs/development/launchpad-lazr.conf
14index 8409e5c..ee141fb 100644
15--- a/configs/development/launchpad-lazr.conf
16+++ b/configs/development/launchpad-lazr.conf
17@@ -89,6 +89,7 @@ public_https: False
18
19 [launchpad]
20 devmode: true
21+use_gunicorn: true
22 enable_test_openid_provider: True
23 openid_canonical_root: https://testopenid.test/
24 openid_provider_root: https://testopenid.test/
25diff --git a/lib/lp/services/config/__init__.py b/lib/lp/services/config/__init__.py
26index c3cc9ae..73c7866 100644
27--- a/lib/lp/services/config/__init__.py
28+++ b/lib/lp/services/config/__init__.py
29@@ -156,9 +156,7 @@ class LaunchpadConfig:
30 @property
31 def use_gunicorn(self):
32 """When running launchpad server, shall we use gunicorn?"""
33- # XXX pappacena: 2021-01-20: Forced False until we have everything
34- # in place.
35- return False
36+ return self.launchpad.use_gunicorn
37
38 def setInstance(self, instance_name):
39 """Set the instance name where the conf files are stored.
40diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
41index 6b54929..3a61db5 100644
42--- a/lib/lp/services/config/schema-lazr.conf
43+++ b/lib/lp/services/config/schema-lazr.conf
44@@ -846,6 +846,9 @@ max_scaling: 500
45 # Is this server running in dev mode?
46 devmode: false
47
48+# Should use gunicorn when booting, or fallback to Zope Server?
49+use_gunicorn: false
50+
51 # A directory of files from which *-lazr.conf will be loaded and
52 # overlaid in order on top of the main config.
53 # Note that this is relative to the top-level config file, not