Configure Tryton server 5 (good practices or advices)


I’m upgrading an old version of Tryton server to 5.0 and i’m wondering what is the best practice for deploying Tryton server…

Before i used to clone trytond and needed modules from a specific branch (with hg clone -b …) and then
hg npull to update all the modules (including my custom modules) with the hgnested extension.

Now with tryton-env (hg clone tryton-env) and the hook, it downloads all modules. I add my custom modules in /trytond/trytond/modules without symbolic link. (because all the symbolic links are deleted if not in the .hgsub file when doing hg pull)
How to pull all the modules (included custom modules) in a single command like with hg npull ?

What is the best way to deploy a tryton server 5 on a linux server? How do you deal with your custom modules and the updates?
Thanks for help, comments, answers…

We are doing all our deployment with the Docker image and we customize it to include one custom module if needed.

For the development, we use a virtualenv an install Tryton in it. The custom module is installed with the develop setuptools command so we do not need to install it on each change.

If you don’t want to use the Docker boilerplate you can install the custom module on a virtualenv which will install all the required module dependencies (the ones listed on tryton.cfg).

We also use docker because as we find easier to manage upgrades: it’s just a mater of pulling the image instead of recreating the virtualenv and installing new dependencies.

So you proceed with a “python install” with your custom module… but how do you update your custom module if there’s any changes in your repo ? hg pull -u and then install again ?

I never used before for the server installation. In a virtualenv, i used to clone needed modules in the trytond/trytond/modules directory and then “trytond-admin --all …” to update. And to update all the modules to the latest version, it was with “hg npull -u”. It seems easy…
What about updating the modules with a docker image ? How does-it works if you patch a module and you need to update ? Do you need to recreate a docker image ?

That’s why I use python develop it install the module in the virtualenv but in-place.
When I want to get latest releases, I just run python develop -U

You do not need as the docker image are rebuild every week with the latest versions.

We do not patch modules. At best, we have in the custom module an override to implement bugfixes which are not back-ported. Usually we use a sub-module with the name of the issue to ease its removal later when upgrading.

You need to extend the docker image if you want to put more code in it. And of course, you need to rebuild it if you want to get the new version of the image.

1 Like

It is also possible to install the custom module with it’s repository link via pip.

I think you should simply not use the hook. this way you have a per default empty trytond/modules directory. You should just manage manually symlinks for modules you want installed.

to update, simply use hg pull -u and it will update the whole repository and all modules.

Indeed, thanks. But i suppose if i add my custom modules in the trytond/modules directory, they won’t be updated. (hgnested with the npull command was really useful for this case). But i’ll test commands from the others answers. Thanks to all for your replies! I’m sure there is not only one good method to deploy the tryton server but i think it is helpful to know how people are installing tryton following the environment (production, dev, … ) and which tools are bests to use and to make installation and updates easy to maintain (including custom modules in the scenario). So feel free to continue this discuss to share your experiences! :slight_smile: