##// END OF EJS Templates
fix(configs): removed waitress as a default runner for web service on development....
super-admin -
r1236:23af3321 default
parent child Browse files
Show More
@@ -1,143 +1,138 b''
1 1 # required for pushd to work..
2 2 SHELL = /bin/bash
3 3
4 4
5 5 # set by: PATH_TO_OUTDATED_PACKAGES=/some/path/outdated_packages.py
6 6 OUTDATED_PACKAGES = ${PATH_TO_OUTDATED_PACKAGES}
7 7
8 8 .PHONY: clean
9 9 ## Cleanup compiled and cache py files
10 10 clean:
11 11 make test-clean
12 12 find . -type f \( -iname '*.c' -o -iname '*.pyc' -o -iname '*.so' -o -iname '*.orig' \) -exec rm '{}' ';'
13 13 find . -type d -name "build" -prune -exec rm -rf '{}' ';'
14 14
15 15
16 16 .PHONY: test
17 17 ## run test-clean and tests
18 18 test:
19 19 make test-clean
20 20 make test-only
21 21
22 22
23 23 .PHONY: test-clean
24 24 ## run test-clean and tests
25 25 test-clean:
26 26 rm -rf coverage.xml htmlcov junit.xml pylint.log result
27 27 find . -type d -name "__pycache__" -prune -exec rm -rf '{}' ';'
28 28 find . -type f \( -iname '.coverage.*' \) -exec rm '{}' ';'
29 29
30 30
31 31 .PHONY: test-only
32 32 ## Run tests only without cleanup
33 33 test-only:
34 34 PYTHONHASHSEED=random \
35 35 py.test -x -vv -r xw -p no:sugar \
36 36 --cov-report=term-missing --cov-report=html \
37 37 --cov=vcsserver vcsserver
38 38
39 39
40 40 .PHONY: ruff-check
41 41 ## run a ruff analysis
42 42 ruff-check:
43 43 ruff check --ignore F401 --ignore I001 --ignore E402 --ignore E501 --ignore F841 --exclude rhodecode/lib/dbmigrate --exclude .eggs --exclude .dev .
44 44
45 45
46 46 .PHONY: pip-packages
47 47 ## Show outdated packages
48 48 pip-packages:
49 49 python ${OUTDATED_PACKAGES}
50 50
51 51
52 52 .PHONY: build
53 53 ## Build sdist/egg
54 54 build:
55 55 python -m build
56 56
57 57
58 58 .PHONY: dev-sh
59 59 ## make dev-sh
60 60 dev-sh:
61 61 sudo echo "deb [trusted=yes] https://apt.fury.io/rsteube/ /" | sudo tee -a "/etc/apt/sources.list.d/fury.list"
62 62 sudo apt-get update
63 63 sudo apt-get install -y zsh carapace-bin
64 64 rm -rf /home/rhodecode/.oh-my-zsh
65 65 curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh
66 66 @echo "source <(carapace _carapace)" > /home/rhodecode/.zsrc
67 67 @echo "${RC_DEV_CMD_HELP}"
68 68 @PROMPT='%(?.%F{green}√.%F{red}?%?)%f %B%F{240}%1~%f%b %# ' zsh
69 69
70 70
71 71 .PHONY: dev-env
72 72 ## make dev-env based on the requirements files and install develop of packages
73 73 ## Cleanup: pip freeze | grep -v "^-e" | grep -v "@" | xargs pip uninstall -y
74 74 dev-env:
75 75 sudo -u root chown rhodecode:rhodecode /home/rhodecode/.cache/pip/
76 76 pip install build virtualenv
77 77 pip wheel --wheel-dir=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
78 78 pip install --no-index --find-links=/home/rhodecode/.cache/pip/wheels -r requirements.txt -r requirements_test.txt -r requirements_debug.txt
79 79 pip install -e .
80 80
81 81
82 82 .PHONY: sh
83 83 ## shortcut for make dev-sh dev-env
84 84 sh:
85 85 make dev-env
86 86 make dev-sh
87 87
88 88
89 .PHONY: dev-srv
90 ## run develop server instance, docker exec -it $(docker ps -q --filter 'name=dev-enterprise-ce') /bin/bash
91 dev-srv:
92 pserve --reload .dev/dev.ini
93
94 89 ## Allows changes of workers e.g make dev-srv-g workers=2
95 90 workers?=1
96 91
97 .PHONY: dev-srv-g
92 .PHONY: dev-srv
98 93 ## run gunicorn multi process workers
99 94 dev-srv-g:
100 95 gunicorn --paste=.dev/dev.ini --bind=0.0.0.0:10010 --config=.dev/gunicorn_config.py --reload --workers=$(workers)
101 96
102 97
103 98 # Default command on calling make
104 99 .DEFAULT_GOAL := show-help
105 100
106 101 .PHONY: show-help
107 102 show-help:
108 103 @echo "$$(tput bold)Available rules:$$(tput sgr0)"
109 104 @echo
110 105 @sed -n -e "/^## / { \
111 106 h; \
112 107 s/.*//; \
113 108 :doc" \
114 109 -e "H; \
115 110 n; \
116 111 s/^## //; \
117 112 t doc" \
118 113 -e "s/:.*//; \
119 114 G; \
120 115 s/\\n## /---/; \
121 116 s/\\n/ /g; \
122 117 p; \
123 118 }" ${MAKEFILE_LIST} \
124 119 | LC_ALL='C' sort --ignore-case \
125 120 | awk -F '---' \
126 121 -v ncol=$$(tput cols) \
127 122 -v indent=19 \
128 123 -v col_on="$$(tput setaf 6)" \
129 124 -v col_off="$$(tput sgr0)" \
130 125 '{ \
131 126 printf "%s%*s%s ", col_on, -indent, $$1, col_off; \
132 127 n = split($$2, words, " "); \
133 128 line_length = ncol - indent; \
134 129 for (i = 1; i <= n; i++) { \
135 130 line_length -= length(words[i]) + 1; \
136 131 if (line_length <= 0) { \
137 132 line_length = ncol - indent - length(words[i]) - 1; \
138 133 printf "\n%*s ", -indent, " "; \
139 134 } \
140 135 printf "%s ", words[i]; \
141 136 } \
142 137 printf "\n"; \
143 138 }'
@@ -1,204 +1,187 b''
1 1 #
2 2
3 3 ; #################################
4 4 ; RHODECODE VCSSERVER CONFIGURATION
5 5 ; #################################
6 6
7 7 [server:main]
8 8 ; COMMON HOST/IP CONFIG
9 9 host = 0.0.0.0
10 10 port = 10010
11 11
12 ; ##################################################
13 ; WAITRESS WSGI SERVER - Recommended for Development
14 ; ##################################################
15
16 ; use server type
17 use = egg:waitress#main
18
19 ; number of worker threads
20 threads = 5
21
22 ; MAX BODY SIZE 100GB
23 max_request_body_size = 107374182400
24
25 ; Use poll instead of select, fixes file descriptors limits problems.
26 ; May not work on old windows systems.
27 asyncore_use_poll = true
28
29 12
30 13 ; ###########################
31 14 ; GUNICORN APPLICATION SERVER
32 15 ; ###########################
33 16
34 17 ; run with gunicorn --paste rhodecode.ini
35 18
36 19 ; Module to use, this setting shouldn't be changed
37 #use = egg:gunicorn#main
20 use = egg:gunicorn#main
38 21
39 22 [app:main]
40 23 ; The %(here)s variable will be replaced with the absolute path of parent directory
41 24 ; of this file
42 25 ; Each option in the app:main can be override by an environmental variable
43 26 ;
44 27 ;To override an option:
45 28 ;
46 29 ;RC_<KeyName>
47 30 ;Everything should be uppercase, . and - should be replaced by _.
48 31 ;For example, if you have these configuration settings:
49 32 ;rc_cache.repo_object.backend = foo
50 33 ;can be overridden by
51 34 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
52 35
53 36 use = egg:rhodecode-vcsserver
54 37
55 38
56 39 ; #############
57 40 ; DEBUG OPTIONS
58 41 ; #############
59 42
60 43 # During development the we want to have the debug toolbar enabled
61 44 pyramid.includes =
62 45 pyramid_debugtoolbar
63 46
64 47 debugtoolbar.hosts = 0.0.0.0/0
65 48 debugtoolbar.exclude_prefixes =
66 49 /css
67 50 /fonts
68 51 /images
69 52 /js
70 53
71 54 ; #################
72 55 ; END DEBUG OPTIONS
73 56 ; #################
74 57
75 58 ; Pyramid default locales, we need this to be set
76 59 #pyramid.default_locale_name = en
77 60
78 61 ; default locale used by VCS systems
79 62 #locale = en_US.UTF-8
80 63
81 64 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
82 65 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
83 66 ; or /usr/local/bin/rhodecode_bin/vcs_bin
84 67 core.binary_dir =
85 68
86 69 ; Custom exception store path, defaults to TMPDIR
87 70 ; This is used to store exception from RhodeCode in shared directory
88 71 #exception_tracker.store_path =
89 72
90 73 ; #############
91 74 ; DOGPILE CACHE
92 75 ; #############
93 76
94 77 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
95 78 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
96 79 #cache_dir = %(here)s/data
97 80
98 81 ; ***************************************
99 82 ; `repo_object` cache, default file based
100 83 ; ***************************************
101 84
102 85 ; `repo_object` cache settings for vcs methods for repositories
103 86 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
104 87
105 88 ; cache auto-expires after N seconds
106 89 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
107 90 #rc_cache.repo_object.expiration_time = 2592000
108 91
109 92 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
110 93 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
111 94
112 95 ; ***********************************************************
113 96 ; `repo_object` cache with redis backend
114 97 ; recommended for larger instance, and for better performance
115 98 ; ***********************************************************
116 99
117 100 ; `repo_object` cache settings for vcs methods for repositories
118 101 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
119 102
120 103 ; cache auto-expires after N seconds
121 104 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
122 105 #rc_cache.repo_object.expiration_time = 2592000
123 106
124 107 ; redis_expiration_time needs to be greater then expiration_time
125 108 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
126 109
127 110 #rc_cache.repo_object.arguments.host = localhost
128 111 #rc_cache.repo_object.arguments.port = 6379
129 112 #rc_cache.repo_object.arguments.db = 5
130 113 #rc_cache.repo_object.arguments.socket_timeout = 30
131 114 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
132 115 #rc_cache.repo_object.arguments.distributed_lock = true
133 116
134 117 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
135 118 #rc_cache.repo_object.arguments.lock_auto_renewal = true
136 119
137 120 ; Statsd client config, this is used to send metrics to statsd
138 121 ; We recommend setting statsd_exported and scrape them using Promethues
139 122 #statsd.enabled = false
140 123 #statsd.statsd_host = 0.0.0.0
141 124 #statsd.statsd_port = 8125
142 125 #statsd.statsd_prefix =
143 126 #statsd.statsd_ipv6 = false
144 127
145 128 ; configure logging automatically at server startup set to false
146 129 ; to use the below custom logging config.
147 130 ; RC_LOGGING_FORMATTER
148 131 ; RC_LOGGING_LEVEL
149 132 ; env variables can control the settings for logging in case of autoconfigure
150 133
151 134 #logging.autoconfigure = true
152 135
153 136 ; specify your own custom logging config file to configure logging
154 137 #logging.logging_conf_file = /path/to/custom_logging.ini
155 138
156 139 ; #####################
157 140 ; LOGGING CONFIGURATION
158 141 ; #####################
159 142
160 143 [loggers]
161 144 keys = root, vcsserver
162 145
163 146 [handlers]
164 147 keys = console
165 148
166 149 [formatters]
167 150 keys = generic, json
168 151
169 152 ; #######
170 153 ; LOGGERS
171 154 ; #######
172 155 [logger_root]
173 156 level = NOTSET
174 157 handlers = console
175 158
176 159 [logger_vcsserver]
177 160 level = DEBUG
178 161 handlers =
179 162 qualname = vcsserver
180 163 propagate = 1
181 164
182 165 ; ########
183 166 ; HANDLERS
184 167 ; ########
185 168
186 169 [handler_console]
187 170 class = StreamHandler
188 171 args = (sys.stderr, )
189 172 level = DEBUG
190 173 ; To enable JSON formatted logs replace 'generic' with 'json'
191 174 ; This allows sending properly formatted logs to grafana loki or elasticsearch
192 175 formatter = generic
193 176
194 177 ; ##########
195 178 ; FORMATTERS
196 179 ; ##########
197 180
198 181 [formatter_generic]
199 182 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
200 183 datefmt = %Y-%m-%d %H:%M:%S
201 184
202 185 [formatter_json]
203 186 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
204 187 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
@@ -1,167 +1,167 b''
1 1 #
2 2
3 3 ; #################################
4 4 ; RHODECODE VCSSERVER CONFIGURATION
5 5 ; #################################
6 6
7 7 [server:main]
8 8 ; COMMON HOST/IP CONFIG
9 host = 127.0.0.1
9 host = 0.0.0.0
10 10 port = 10010
11 11
12 12
13 13 ; ###########################
14 14 ; GUNICORN APPLICATION SERVER
15 15 ; ###########################
16 16
17 17 ; run with gunicorn --paste rhodecode.ini
18 18
19 19 ; Module to use, this setting shouldn't be changed
20 20 use = egg:gunicorn#main
21 21
22 22 [app:main]
23 23 ; The %(here)s variable will be replaced with the absolute path of parent directory
24 24 ; of this file
25 25 ; Each option in the app:main can be override by an environmental variable
26 26 ;
27 27 ;To override an option:
28 28 ;
29 29 ;RC_<KeyName>
30 30 ;Everything should be uppercase, . and - should be replaced by _.
31 31 ;For example, if you have these configuration settings:
32 32 ;rc_cache.repo_object.backend = foo
33 33 ;can be overridden by
34 34 ;export RC_CACHE_REPO_OBJECT_BACKEND=foo
35 35
36 36 use = egg:rhodecode-vcsserver
37 37
38 38 ; Pyramid default locales, we need this to be set
39 39 #pyramid.default_locale_name = en
40 40
41 41 ; default locale used by VCS systems
42 42 #locale = en_US.UTF-8
43 43
44 44 ; path to binaries (hg,git,svn) for vcsserver, it should be set by the installer
45 45 ; at installation time, e.g /home/user/.rccontrol/vcsserver-1/profile/bin
46 46 ; or /usr/local/bin/rhodecode_bin/vcs_bin
47 47 core.binary_dir =
48 48
49 49 ; Custom exception store path, defaults to TMPDIR
50 50 ; This is used to store exception from RhodeCode in shared directory
51 51 #exception_tracker.store_path =
52 52
53 53 ; #############
54 54 ; DOGPILE CACHE
55 55 ; #############
56 56
57 57 ; Default cache dir for caches. Putting this into a ramdisk can boost performance.
58 58 ; eg. /tmpfs/data_ramdisk, however this directory might require large amount of space
59 59 #cache_dir = %(here)s/data
60 60
61 61 ; ***************************************
62 62 ; `repo_object` cache, default file based
63 63 ; ***************************************
64 64
65 65 ; `repo_object` cache settings for vcs methods for repositories
66 66 #rc_cache.repo_object.backend = dogpile.cache.rc.file_namespace
67 67
68 68 ; cache auto-expires after N seconds
69 69 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
70 70 #rc_cache.repo_object.expiration_time = 2592000
71 71
72 72 ; file cache store path. Defaults to `cache_dir =` value or tempdir if both values are not set
73 73 #rc_cache.repo_object.arguments.filename = /tmp/vcsserver_cache_repo_object.db
74 74
75 75 ; ***********************************************************
76 76 ; `repo_object` cache with redis backend
77 77 ; recommended for larger instance, and for better performance
78 78 ; ***********************************************************
79 79
80 80 ; `repo_object` cache settings for vcs methods for repositories
81 81 #rc_cache.repo_object.backend = dogpile.cache.rc.redis_msgpack
82 82
83 83 ; cache auto-expires after N seconds
84 84 ; Examples: 86400 (1Day), 604800 (7Days), 1209600 (14Days), 2592000 (30days), 7776000 (90Days)
85 85 #rc_cache.repo_object.expiration_time = 2592000
86 86
87 87 ; redis_expiration_time needs to be greater then expiration_time
88 88 #rc_cache.repo_object.arguments.redis_expiration_time = 3592000
89 89
90 90 #rc_cache.repo_object.arguments.host = localhost
91 91 #rc_cache.repo_object.arguments.port = 6379
92 92 #rc_cache.repo_object.arguments.db = 5
93 93 #rc_cache.repo_object.arguments.socket_timeout = 30
94 94 ; more Redis options: https://dogpilecache.sqlalchemy.org/en/latest/api.html#redis-backends
95 95 #rc_cache.repo_object.arguments.distributed_lock = true
96 96
97 97 ; auto-renew lock to prevent stale locks, slower but safer. Use only if problems happen
98 98 #rc_cache.repo_object.arguments.lock_auto_renewal = true
99 99
100 100 ; Statsd client config, this is used to send metrics to statsd
101 101 ; We recommend setting statsd_exported and scrape them using Promethues
102 102 #statsd.enabled = false
103 103 #statsd.statsd_host = 0.0.0.0
104 104 #statsd.statsd_port = 8125
105 105 #statsd.statsd_prefix =
106 106 #statsd.statsd_ipv6 = false
107 107
108 108 ; configure logging automatically at server startup set to false
109 109 ; to use the below custom logging config.
110 110 ; RC_LOGGING_FORMATTER
111 111 ; RC_LOGGING_LEVEL
112 112 ; env variables can control the settings for logging in case of autoconfigure
113 113
114 114 #logging.autoconfigure = true
115 115
116 116 ; specify your own custom logging config file to configure logging
117 117 #logging.logging_conf_file = /path/to/custom_logging.ini
118 118
119 119 ; #####################
120 120 ; LOGGING CONFIGURATION
121 121 ; #####################
122 122
123 123 [loggers]
124 124 keys = root, vcsserver
125 125
126 126 [handlers]
127 127 keys = console
128 128
129 129 [formatters]
130 130 keys = generic, json
131 131
132 132 ; #######
133 133 ; LOGGERS
134 134 ; #######
135 135 [logger_root]
136 136 level = NOTSET
137 137 handlers = console
138 138
139 139 [logger_vcsserver]
140 140 level = INFO
141 141 handlers =
142 142 qualname = vcsserver
143 143 propagate = 1
144 144
145 145 ; ########
146 146 ; HANDLERS
147 147 ; ########
148 148
149 149 [handler_console]
150 150 class = StreamHandler
151 151 args = (sys.stderr, )
152 152 level = INFO
153 153 ; To enable JSON formatted logs replace 'generic' with 'json'
154 154 ; This allows sending properly formatted logs to grafana loki or elasticsearch
155 155 formatter = generic
156 156
157 157 ; ##########
158 158 ; FORMATTERS
159 159 ; ##########
160 160
161 161 [formatter_generic]
162 162 format = %(asctime)s.%(msecs)03d [%(process)d] %(levelname)-5.5s [%(name)s] %(message)s
163 163 datefmt = %Y-%m-%d %H:%M:%S
164 164
165 165 [formatter_json]
166 166 format = %(timestamp)s %(levelname)s %(name)s %(message)s %(req_id)s
167 167 class = vcsserver.lib._vendor.jsonlogger.JsonFormatter
General Comments 0
You need to be logged in to leave comments. Login now