← Back to team overview

launchpad-reviewers team mailing list archive

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

 

Thiago F. Pappacena has proposed merging ~pappacena/launchpad:enabling-gunicorn-in-development into launchpad:master with ~pappacena/launchpad:gunicorn-appserver-tests as a prerequisite.

Commit message:
Enabling gunicorn (with autoreload) in development

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~pappacena/launchpad/+git/launchpad/+merge/396701

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.
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~pappacena/launchpad:enabling-gunicorn-in-development into launchpad:master.
diff --git a/configs/development/gunicorn.conf.py b/configs/development/gunicorn.conf.py
new file mode 100644
index 0000000..b667109
--- /dev/null
+++ b/configs/development/gunicorn.conf.py
@@ -0,0 +1,6 @@
+bind = [":8085", ":8086", ":8087", ":8088", ":8089"]
+workers = 2
+threads = 10
+max_requests = 1000
+log_level = "DEBUG"
+reload = True
diff --git a/configs/development/launchpad-lazr.conf b/configs/development/launchpad-lazr.conf
index 8409e5c..ee141fb 100644
--- a/configs/development/launchpad-lazr.conf
+++ b/configs/development/launchpad-lazr.conf
@@ -89,6 +89,7 @@ public_https: False
 
 [launchpad]
 devmode: true
+use_gunicorn: true
 enable_test_openid_provider: True
 openid_canonical_root: https://testopenid.test/
 openid_provider_root: https://testopenid.test/
diff --git a/lib/lp/services/config/__init__.py b/lib/lp/services/config/__init__.py
index c2ed613..73c7866 100644
--- a/lib/lp/services/config/__init__.py
+++ b/lib/lp/services/config/__init__.py
@@ -156,9 +156,7 @@ class LaunchpadConfig:
     @property
     def use_gunicorn(self):
         """When running launchpad server, shall we use gunicorn?"""
-        # XXX pappacena: 2021-01-20: Forced False until we have everything
-        # in place.
-        return True
+        return self.launchpad.use_gunicorn
 
     def setInstance(self, instance_name):
         """Set the instance name where the conf files are stored.
diff --git a/lib/lp/services/config/schema-lazr.conf b/lib/lp/services/config/schema-lazr.conf
index 6b54929..3a61db5 100644
--- a/lib/lp/services/config/schema-lazr.conf
+++ b/lib/lp/services/config/schema-lazr.conf
@@ -846,6 +846,9 @@ max_scaling: 500
 # Is this server running in dev mode?
 devmode: false
 
+# Should use gunicorn when booting, or fallback to Zope Server?
+use_gunicorn: false
+
 # A directory of files from which *-lazr.conf will be loaded and
 # overlaid in order on top of the main config.
 # Note that this is relative to the top-level config file, not

Follow ups