Documentation of bench and frappe internals

Is there a set of documentation showing the services and communications i.e. redis, db, gunicorn, supervisor, nginx etc.

I would like to install ERPnext on NixOS and manage upgrades with our own choice of CI/CD but bench is doing a lot of stuff that other things do and it needs internet access. I’d rather not reverse engineer the from source code as I would like to get to the intent of the components and build from that.

There seem to be some other threads around issues with setup and upgrade which might benefit from documentation on the process and components.

If you are interested in this please let me know. I’m considering placing a bounty on this.



Bench needs internet access? I’m not sure. Most bench commands are offline (with the exception of syncing apps). What bounty are you keen to raise?

“NixOS has a completely declarative approach to configuration management: you write a specification of the desired configuration of your system in NixOS’s modular language, and NixOS takes care of making it happen.” This is at odds with the python and Ansible currently used for state management and setup. Database, web servers, scheduling, process management can be defined as nix expressions. Code management and upgrades can be managed with a variety of CI/CD tools but the steps required to do this all reference bench.

Without a clear description of how frappe handles requests (not the web server), where the state is stored, how the application is configured etc. it would require reading the code. Essentially I’d like better documentation for the things that are specific to frappe and ERPNext but not specific to OS, database, web servers, scheduling, process management etc. unless there is a hard dependency e.g. requires MariaDB version x.y. and wkhtmltopdf with patches from repo github…

The link was somewhat helpful for the components but it lacks detail about the interfaces and configuration files.

As for the bounty, I’m thinking I’d keep it high level such as “Support for ERPNext on NixOS”.

1 Like

I am working on this now. I plan to upstream contribute to nixpkgs if possible

Also interested in helping with the bounty for this. Has there been any progress, @Sam_Rose?

1 Like

I am hearing from many in the Nixos community that the way that erpnext handles packaging and internals makes it a true nightmare to implement in Nixos. Apparently it is a symptom of a problem with how erpnext is organized in terms of installers, dependencies/requirements etc. Some very seasoned nixos developers reported it took them 3 weeks (!!!) to get through packaging this.

So, I going shift to creating a branch of erpnext where I try to sort that out. Given what I have seen so far, this is going to be a large and time consuming project for me. I will be updating here as I make progress. I am not really looking for a bounty on it.

In other words: one should be able to install frappe, and erpnext without bench, and without the conglomeration of scripts/ansible, etc therein.

So, I am going to investigate the feasibility of that, as it is the pathway to packaging this for nixpkgs, and eventually nixos module

Check frappe_docker for production.

It doesn’t use bench.

There are mainly 3 component required, python environment, nodejs/socketio environment and nginx to serve static assets reverse proxy to python/gunicorn and socketio.

python environment also starts 3 background workers and schedule process, these are not exposed by nginx

1 Like

@revant_one thanks I was just looking at your posts about the new docker images today.

@Sam_Rose it’s been a while, any luck packaging this as a nixos module?