mirror of
https://github.com/frappe/bench.git
synced 2025-01-26 08:08:23 +00:00
Merge branch 'develop' into staging
This commit is contained in:
commit
b253e35302
@ -371,12 +371,12 @@ class BenchSetup(Base):
|
|||||||
)
|
)
|
||||||
|
|
||||||
@step(title="Setting Up Bench Config", success="Bench Config Set Up")
|
@step(title="Setting Up Bench Config", success="Bench Config Set Up")
|
||||||
def config(self, redis=True, procfile=True):
|
def config(self, redis=True, procfile=True, additional_config=None):
|
||||||
"""Setup config folder
|
"""Setup config folder
|
||||||
- create pids folder
|
- create pids folder
|
||||||
- generate sites/common_site_config.json
|
- generate sites/common_site_config.json
|
||||||
"""
|
"""
|
||||||
setup_config(self.bench.name)
|
setup_config(self.bench.name, additional_config=additional_config)
|
||||||
|
|
||||||
if redis:
|
if redis:
|
||||||
from bench.config.redis import generate_config
|
from bench.config.redis import generate_config
|
||||||
|
@ -39,6 +39,12 @@ import click
|
|||||||
@click.option("--skip-assets", is_flag=True, default=False, help="Do not build assets")
|
@click.option("--skip-assets", is_flag=True, default=False, help="Do not build assets")
|
||||||
@click.option("--install-app", help="Install particular app after initialization")
|
@click.option("--install-app", help="Install particular app after initialization")
|
||||||
@click.option("--verbose", is_flag=True, help="Verbose output during install")
|
@click.option("--verbose", is_flag=True, help="Verbose output during install")
|
||||||
|
@click.option(
|
||||||
|
"--dev",
|
||||||
|
is_flag=True,
|
||||||
|
default=False,
|
||||||
|
help="Enable developer mode and install development dependencies.",
|
||||||
|
)
|
||||||
def init(
|
def init(
|
||||||
path,
|
path,
|
||||||
apps_path,
|
apps_path,
|
||||||
@ -54,6 +60,7 @@ def init(
|
|||||||
skip_assets=False,
|
skip_assets=False,
|
||||||
python="python3",
|
python="python3",
|
||||||
install_app=None,
|
install_app=None,
|
||||||
|
dev=False,
|
||||||
):
|
):
|
||||||
import os
|
import os
|
||||||
|
|
||||||
@ -79,6 +86,7 @@ def init(
|
|||||||
skip_assets=skip_assets,
|
skip_assets=skip_assets,
|
||||||
python=python,
|
python=python,
|
||||||
verbose=verbose,
|
verbose=verbose,
|
||||||
|
dev=dev,
|
||||||
)
|
)
|
||||||
log(f"Bench {path} initialized", level=1)
|
log(f"Bench {path} initialized", level=1)
|
||||||
except SystemExit:
|
except SystemExit:
|
||||||
|
@ -18,12 +18,14 @@ default_config = {
|
|||||||
DEFAULT_MAX_REQUESTS = 5000
|
DEFAULT_MAX_REQUESTS = 5000
|
||||||
|
|
||||||
|
|
||||||
def setup_config(bench_path):
|
def setup_config(bench_path, additional_config=None):
|
||||||
make_pid_folder(bench_path)
|
make_pid_folder(bench_path)
|
||||||
bench_config = get_config(bench_path)
|
bench_config = get_config(bench_path)
|
||||||
bench_config.update(default_config)
|
bench_config.update(default_config)
|
||||||
bench_config.update(get_gunicorn_workers())
|
bench_config.update(get_gunicorn_workers())
|
||||||
update_config_for_frappe(bench_config, bench_path)
|
update_config_for_frappe(bench_config, bench_path)
|
||||||
|
if additional_config:
|
||||||
|
bench_config.update(additional_config)
|
||||||
|
|
||||||
put_config(bench_config, bench_path)
|
put_config(bench_config, bench_path)
|
||||||
|
|
||||||
|
@ -2,13 +2,15 @@
|
|||||||
; priority=1 --> Lower priorities indicate programs that start first and shut down last
|
; priority=1 --> Lower priorities indicate programs that start first and shut down last
|
||||||
; killasgroup=true --> send kill signal to child processes too
|
; killasgroup=true --> send kill signal to child processes too
|
||||||
|
|
||||||
|
; graceful timeout should always be lower than stopwaitsecs to avoid orphan gunicorn workers.
|
||||||
[program:{{ bench_name }}-frappe-web]
|
[program:{{ bench_name }}-frappe-web]
|
||||||
command={{ bench_dir }}/env/bin/gunicorn -b 127.0.0.1:{{ webserver_port }} -w {{ gunicorn_workers }} --max-requests {{ gunicorn_max_requests }} --max-requests-jitter {{ gunicorn_max_requests_jitter }} -t {{ http_timeout }} frappe.app:application --preload
|
command={{ bench_dir }}/env/bin/gunicorn -b 127.0.0.1:{{ webserver_port }} -w {{ gunicorn_workers }} --max-requests {{ gunicorn_max_requests }} --max-requests-jitter {{ gunicorn_max_requests_jitter }} -t {{ http_timeout }} --graceful-timeout 30 frappe.app:application --preload
|
||||||
priority=4
|
priority=4
|
||||||
autostart=true
|
autostart=true
|
||||||
autorestart=true
|
autorestart=true
|
||||||
stdout_logfile={{ bench_dir }}/logs/web.log
|
stdout_logfile={{ bench_dir }}/logs/web.log
|
||||||
stderr_logfile={{ bench_dir }}/logs/web.error.log
|
stderr_logfile={{ bench_dir }}/logs/web.error.log
|
||||||
|
stopwaitsecs=40
|
||||||
user={{ user }}
|
user={{ user }}
|
||||||
directory={{ sites_dir }}
|
directory={{ sites_dir }}
|
||||||
|
|
||||||
|
@ -35,6 +35,7 @@ def init(
|
|||||||
skip_assets=False,
|
skip_assets=False,
|
||||||
python="python3",
|
python="python3",
|
||||||
install_app=None,
|
install_app=None,
|
||||||
|
dev=False,
|
||||||
):
|
):
|
||||||
"""Initialize a new bench directory
|
"""Initialize a new bench directory
|
||||||
|
|
||||||
@ -63,7 +64,14 @@ def init(
|
|||||||
bench.setup.dirs()
|
bench.setup.dirs()
|
||||||
bench.setup.logging()
|
bench.setup.logging()
|
||||||
bench.setup.env(python=python)
|
bench.setup.env(python=python)
|
||||||
bench.setup.config(redis=not skip_redis_config_generation, procfile=not no_procfile)
|
config = {}
|
||||||
|
if dev:
|
||||||
|
config["developer_mode"] = 1
|
||||||
|
bench.setup.config(
|
||||||
|
redis=not skip_redis_config_generation,
|
||||||
|
procfile=not no_procfile,
|
||||||
|
additional_config=config,
|
||||||
|
)
|
||||||
bench.setup.patches()
|
bench.setup.patches()
|
||||||
|
|
||||||
# local apps
|
# local apps
|
||||||
|
Loading…
x
Reference in New Issue
Block a user