Skip to content

Commit

Permalink
Feature add support for gunicorn worker class (#21)
Browse files Browse the repository at this point in the history
* Add support for other gunicorn worker types

* Remove gthread worker_class
  • Loading branch information
jortencio authored Jul 27, 2023
1 parent e093ecd commit 1fcd4ac
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
String $admin_lastname = 'admin',
String $admin_email = '[email protected]',
String $gunicorn_install_dir = '/home/superset',
String $gunicorn_worker_class = 'gevent',
Enum['sync','eventlet','gevent','tornado'] $gunicorn_worker_class = 'gevent',
Integer $gunicorn_workers = 10,
Integer $gunicorn_timeout = 120,
String $gunicorn_bind = '0.0.0.0:8088',
Expand Down
6 changes: 5 additions & 1 deletion manifests/install.pp
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,11 @@

# Install python libraries for managing the webserver
if $superset::manage_webserver {
$webserver_venv_pip_pkg = ['gunicorn', 'gevent']
if $superset::gunicorn_worker_class == 'sync' {
$webserver_venv_pip_pkg = ['gunicorn']
} else {
$webserver_venv_pip_pkg = ['gunicorn', $superset::gunicorn_worker_class]
}
$webserver_venv_pip_pkg.each | String $pkgname | {
python::pip { $pkgname:
ensure => 'present',
Expand Down
2 changes: 1 addition & 1 deletion templates/superset.gunicorn.epp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<%- |
String $install_dir,
Integer $workers,
Enum['sync','eventlet','gevent','tornado','gthread'] $worker_class,
Enum['sync','eventlet','gevent','tornado'] $worker_class,
String $bind,
Integer $timeout,
Integer $limit_request_line,
Expand Down

0 comments on commit 1fcd4ac

Please sign in to comment.