Tryton - Issues

 

Issue6344

Title Add environment variables to wsgi script
Priority feature Status resolved
Superseder Nosy List ced, fmorato, pokoli, reviewbot, roundup-bot, smarro
Type feature request Components trytond
Assigned To pokoli Keywords review
Reviews 32131002
View: 32131002

Created on 2017-03-09.12:52:49 by pokoli, last changed by roundup-bot.

Messages
New changeset 4019b8d90214 by Sergi Almacellas Abellana in branch 'default':
Add environment variables to wsgi script
http://hg.tryton.org/trytond/rev/4019b8d90214
review32131002 updated at https://codereview.tryton.org/32131002/#ps220001
review32131002 updated at https://codereview.tryton.org/32131002/#ps200001
review32131002 updated at https://codereview.tryton.org/32131002/#ps180001
review32131002 updated at https://codereview.tryton.org/32131002/#ps160001
review32131002 updated at https://codereview.tryton.org/32131002/#ps140001
msg33311 (view) Author: [hidden] (fmorato) Date: 2017-04-20.19:11:07
I've been running a server with patch review32131002 for a month now without any remarks. It's been stable enough.

I haven't done any particular testing, though.
review32131002 updated at https://codereview.tryton.org/32131002/#ps100004
review32131002 updated at https://codereview.tryton.org/32131002/#ps110001
review32131002 updated at https://codereview.tryton.org/32131002/#ps90001
review32131002 updated at https://codereview.tryton.org/32131002/#ps70001
review32131002 updated at https://codereview.tryton.org/32131002/#ps50001
msg32398 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.16:06:05
OK then if it is clearly separated.
review32131002 updated at https://codereview.tryton.org/32131002/#ps30001
msg32396 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-09.15:39:23
El 09/03/17 a les 15:20, Cédric Krier ha escrit:
>> El 09/03/17 a les 13:25, Cédric Krier ha escrit:
>>> For me, it will just create double way to set options when running
>>> trytond. This will lead to the question which one has the precedence?
>> For me there is no dobule way:
>>
>> When using trytond the only option is to use the flags.
> I do not see how you reach to this conclusion.
> The app is used by trytond so the wsgi app will override configuration
> based on environment variable.

Right this is the current behaviour. But I think we can modify the behaviour and apply environment variables only for uwsgi.
msg32393 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.15:20:06
On 2017-03-09 13:56, Sergi Almacellas Abellana wrote:
> El 09/03/17 a les 13:25, Cédric Krier ha escrit:
> > For me, it will just create double way to set options when running
> > trytond. This will lead to the question which one has the precedence?
> 
> For me there is no dobule way:
> 
> When using trytond the only option is to use the flags.

I do not see how you reach to this conclusion.
The app is used by trytond so the wsgi app will override configuration
based on environment variable.
msg32389 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-09.13:56:19
El 09/03/17 a les 13:25, Cédric Krier ha escrit:
>> As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.
> Could you rational why it is good practice?

Because it ease the deployment using wsgi scripts and it simplifies the maintenance of wsgi scripts. 

Because it provides a more detailed example for custom scripts.

Also if it's possible to set a variable using a commandline command, it's expected to be able to set it also when running wsgi. 

> For me, it will just create double way to set options when running
> trytond. This will lead to the question which one has the precedence?

For me there is no dobule way:

When using trytond the only option is to use the flags.
When using wsgi the only option is to use environment variables.
msg32388 (view) Author: [hidden] (ced) (Tryton committer) (Tryton translator) Date: 2017-03-09.13:25:06
On 2017-03-09 12:52, Sergi Almacellas Abellana wrote:
> As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.

Could you rational why it is good practice?
For me, it will just create double way to set options when running
trytond. This will lead to the question which one has the precedence?
review32131002 updated at https://codereview.tryton.org/32131002/#ps1
msg32386 (view) Author: [hidden] (pokoli) (Tryton committer) (Tryton translator) Date: 2017-03-09.12:52:49
As requested on [1] it will be a good addition to allow to configure some of the wsgi application behaviour by using environemnt variables. Although it's possible to use a custom wsgi script, I think it's a good practice to provide a configurable default one.

We should include the following variables:

* TRYTOND_LOGGING_CONFIG: Which will be the route to the file used as logging configuration
* TRYTOND_DATABASE_NAME: The database name to initialize when initialitzing the server. This will be required when implementing issue5694.


[1] http://www.tryton.org/~irclog/2017-03-06.log.html#t2017-03-06%2017:38
History
Date User Action Args
2017-07-19 10:13:11roundup-botsetstatus: testing -> resolved
nosy: + roundup-bot
messages: + msg34688
2017-07-18 11:34:41reviewbotsetmessages: + msg34661
2017-07-07 11:00:29reviewbotsetmessages: + msg34507
2017-07-07 10:39:56reviewbotsetmessages: + msg34506
2017-07-05 23:53:12smarrosetnosy: + smarro
2017-07-03 19:38:40reviewbotsetmessages: + msg34408
2017-07-03 18:38:51reviewbotsetmessages: + msg34404
2017-04-20 19:11:07fmoratosetnosy: + fmorato
messages: + msg33311
2017-03-17 12:35:38reviewbotsetmessages: + msg32578
2017-03-17 12:02:24reviewbotsetmessages: + msg32577

Showing 10 items. Show all history (warning: this could be VERY long)