##// END OF EJS Templates
celery: bumped to 4.4.7 and fixed loader logic/logging
super-admin -
r4880:75f25e20 default
parent child Browse files
Show More
@@ -22,14 +22,14 b' self: super: {'
22 22 };
23 23 };
24 24 "amqp" = super.buildPythonPackage {
25 name = "amqp-2.5.2";
25 name = "amqp-2.6.1";
26 26 doCheck = false;
27 27 propagatedBuildInputs = [
28 28 self."vine"
29 29 ];
30 30 src = fetchurl {
31 url = "https://files.pythonhosted.org/packages/92/1d/433541994a5a69f4ad2fff39746ddbb0bdedb0ea0d85673eb0db68a7edd9/amqp-2.5.2.tar.gz";
32 sha256 = "13dhhfxjrqcjybnq4zahg92mydhpg2l76nxcmq7d560687wsxwbp";
31 url = "https://files.pythonhosted.org/packages/37/9f/d54494a157d0dcd1673fe7a1bcce7ac70d3eb6d5d6149749450c87a2c959/amqp-2.6.1.tar.gz";
32 sha256 = "70cdb10628468ff14e57ec2f751c7aa9e48e7e3651cfd62d431213c0c4e58f21";
33 33 };
34 34 meta = {
35 35 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -149,11 +149,11 b' self: super: {'
149 149 };
150 150 };
151 151 "billiard" = super.buildPythonPackage {
152 name = "billiard-3.6.1.0";
152 name = "billiard-3.6.4.0";
153 153 doCheck = false;
154 154 src = fetchurl {
155 url = "https://files.pythonhosted.org/packages/68/1d/2aea8fbb0b1e1260a8a2e77352de2983d36d7ac01207cf14c2b9c6cc860e/billiard-3.6.1.0.tar.gz";
156 sha256 = "09hzy3aqi7visy4vmf4xiish61n0rq5nd3iwjydydps8yrs9r05q";
155 url = "https://files.pythonhosted.org/packages/92/91/40de1901da8ec9eeb7c6a22143ba5d55d8aaa790761ca31342cedcd5c793/billiard-3.6.4.0.tar.gz";
156 sha256 = "299de5a8da28a783d51b197d496bef4f1595dd023a93a4f59dde1886ae905547";
157 157 };
158 158 meta = {
159 159 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -197,7 +197,7 b' self: super: {'
197 197 };
198 198 };
199 199 "celery" = super.buildPythonPackage {
200 name = "celery-4.3.0";
200 name = "celery-4.4.7";
201 201 doCheck = false;
202 202 propagatedBuildInputs = [
203 203 self."pytz"
@@ -206,8 +206,8 b' self: super: {'
206 206 self."vine"
207 207 ];
208 208 src = fetchurl {
209 url = "https://files.pythonhosted.org/packages/a2/4b/d020836f751617e907e84753a41c92231cd4b673ff991b8ee9da52361323/celery-4.3.0.tar.gz";
210 sha256 = "1y8y0gbgkwimpxqnxq2rm5qz2vy01fvjiybnpm00y5rzd2m34iac";
209 url = "https://files.pythonhosted.org/packages/fe/58/c7ced9705c2cedf526e183e428d1b145910cb8bc7ea537a2ec9a6552c056/celery-4.4.7.tar.gz";
210 sha256 = "d220b13a8ed57c78149acf82c006785356071844afe0b27012a4991d44026f9f";
211 211 };
212 212 meta = {
213 213 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -938,15 +938,15 b' self: super: {'
938 938 };
939 939 };
940 940 "kombu" = super.buildPythonPackage {
941 name = "kombu-4.6.6";
941 name = "kombu-4.6.10";
942 942 doCheck = false;
943 943 propagatedBuildInputs = [
944 944 self."amqp"
945 945 self."importlib-metadata"
946 946 ];
947 947 src = fetchurl {
948 url = "https://files.pythonhosted.org/packages/20/e6/bc2d9affba6138a1dc143f77fef253e9e08e238fa7c0688d917c09005e96/kombu-4.6.6.tar.gz";
949 sha256 = "11mxpcy8mg1l35bgbhba70v29bydr2hrhdbdlb4lg98m3m5vaq0p";
948 url = "https://files.pythonhosted.org/packages/73/ec/22996f5f58669d3acc7f0e58adb919bfa7d3c5744b0a6384740690db4748/kombu-4.6.10.tar.gz";
949 sha256 = "437b9cdea193cc2ed0b8044c85fd0f126bb3615ca2f4d4a35b39de7cacfa3c1a";
950 950 };
951 951 meta = {
952 952 license = [ pkgs.lib.licenses.bsdOriginal ];
@@ -1,10 +1,10 b''
1 1 ## dependencies
2 2
3 amqp==2.5.2
3 amqp==2.6.1
4 4 babel==1.3
5 5 beaker==1.9.1
6 6 bleach==3.1.3
7 celery==4.3.0
7 celery==4.4.7
8 8 channelstream==0.6.14
9 9 click==7.0
10 10 colander==1.7.0
@@ -22,7 +22,7 b' futures==3.0.2'
22 22 infrae.cache==1.0.1
23 23 iso8601==0.1.12
24 24 itsdangerous==1.1.0
25 kombu==4.6.6
25 kombu==4.6.10
26 26 lxml==4.2.5
27 27 mako==1.1.0
28 28 markdown==2.6.11
@@ -3,7 +3,7 b''
3 3 atomicwrites==1.3.0
4 4 attrs==19.3.0
5 5 asn1crypto==0.24.0
6 billiard==3.6.1.0
6 billiard==3.6.4.0
7 7 cffi==1.12.3
8 8 chameleon==2.24
9 9 configparser==4.0.2
@@ -55,30 +55,6 b" register('json_ext', json.dumps, json.lo"
55 55 log = logging.getLogger('celery.rhodecode.loader')
56 56
57 57
58 def add_preload_arguments(parser):
59 parser.add_argument(
60 '--ini', default=None,
61 help='Path to ini configuration file.'
62 )
63 parser.add_argument(
64 '--ini-var', default=None,
65 help='Comma separated list of key=value to pass to ini.'
66 )
67
68
69 def get_logger(obj):
70 custom_log = logging.getLogger(
71 'rhodecode.task.{}'.format(obj.__class__.__name__))
72
73 if rhodecode.CELERY_ENABLED:
74 try:
75 custom_log = obj.get_logger()
76 except Exception:
77 pass
78
79 return custom_log
80
81
82 58 imports = ['rhodecode.lib.celerylib.tasks']
83 59
84 60 try:
@@ -104,26 +80,50 b' base_celery_config = {'
104 80 'group': 'beat_groupmeta',
105 81 }
106 82 }
83
84
85 def add_preload_arguments(parser):
86 parser.add_argument(
87 '--ini', default=None,
88 help='Path to ini configuration file.'
89 )
90 parser.add_argument(
91 '--ini-var', default=None,
92 help='Comma separated list of key=value to pass to ini.'
93 )
94
95
96 def get_logger(obj):
97 custom_log = logging.getLogger(
98 'rhodecode.task.{}'.format(obj.__class__.__name__))
99
100 if rhodecode.CELERY_ENABLED:
101 try:
102 custom_log = obj.get_logger()
103 except Exception:
104 pass
105
106 return custom_log
107
108
107 109 # init main celery app
108 110 celery_app = Celery()
109 111 celery_app.user_options['preload'].add(add_preload_arguments)
110 ini_file_glob = None
111 112
112 113
113 114 @signals.setup_logging.connect
114 115 def setup_logging_callback(**kwargs):
115 setup_logging(ini_file_glob)
116 ini_file = celery_app.conf['RC_INI_FILE']
117 setup_logging(ini_file)
116 118
117 119
118 120 @signals.user_preload_options.connect
119 121 def on_preload_parsed(options, **kwargs):
120 from rhodecode.config.middleware import get_celery_config
121 122
122 ini_location = options['ini']
123 ini_file = options['ini']
123 124 ini_vars = options['ini_var']
124 celery_app.conf['INI_PYRAMID'] = options['ini']
125 125
126 if ini_location is None:
126 if ini_file is None:
127 127 print('You must provide the paste --ini argument')
128 128 exit(-1)
129 129
@@ -131,16 +131,24 b' def on_preload_parsed(options, **kwargs)'
131 131 if ini_vars is not None:
132 132 options = parse_ini_vars(ini_vars)
133 133
134 global ini_file_glob
135 ini_file_glob = ini_location
134 celery_app.conf['RC_INI_FILE'] = ini_file
135 celery_app.conf['RC_INI_OPTIONS'] = options
136 setup_logging(ini_file)
137
138
139 @signals.celeryd_init.connect
140 def on_celeryd_init(sender=None, conf=None, **kwargs):
141 from rhodecode.config.middleware import get_celery_config
136 142
137 143 log.debug('Bootstrapping RhodeCode application...')
138 144
145 ini_file = conf['RC_INI_FILE']
146 options = conf['RC_INI_OPTIONS']
147
139 148 try:
140 env = bootstrap(ini_location, options=options)
149 env = bootstrap(ini_file, options=options)
141 150 except Exception:
142 151 log.exception('Failed to bootstrap RhodeCode APP')
143 raise
144 152
145 153 log.debug('Got Pyramid ENV: %s', env)
146 154
General Comments 0
You need to be logged in to leave comments. Login now