-
Notifications
You must be signed in to change notification settings - Fork 103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unified location processing #862
Comments
Historically there wasn't
While others describe the group of servers as single load-balaned array of server connections and 'low-level' connection and load balancer properties:
It seems reasonable to move options from the first group to vhost settings. Need to review all the configuration directives and stabiles them. Future additions must extend but not change configuration format. Tempesta's upgrade to the newer version should be possible without any issues. |
Some time ago we already made a step towards building AST for configuration files, but declined the approach due to complexity. During all the development we had a lot of issues with proper configuration files parsing. Meantime, modern cloud infrastructures (service mesh) require dynamically reconfigured services with replicated among cluster configurations. As the result JSON stored in some replicated database is popular. REST/gRPC APIs are another configuration challenge. With all the above in mind I propose to consider to move configuration parser (current
Using the user space daemon with netlink interface allows us to mix Tempesta FW configuration with nftables - a user can write L3-L7 rules in a file and we can just call the user-space Next, the code base of the C++ program can be reused for #67 (RESTful & gRPC APIs), at least in the part of loading binary data structures. It seems much easier to generate a binary structures and load them to the kernel than adjust a human-written configuration file (in any allowed format) according to received configuration update and then, after JSON parsing, run another configuration file parser in the kernel. For #67 we still can use the Perl script to generate or adjust a human-readable configuration file, but
The last, but very wished, opportunity is to make a foundation for TL (#102) using Flex/Bison grammar tor the configuration file - no need to build the AST by hands! For this purpose we can move to a different syntax. Just one lesson from old DPI project worth mentioning: the binary data passed from the user-space program to the kernel is also an intermediary representation - final data structures use pointers to kernel objects and various dynamic structures, so we also have to process the intermediary binary configuration representation to build data structures usable in run-time. However, the binary data structures are less error prone and probably we case do less memory allocations on building the final data structures since we already know all the sizes. |
Totally agree here, parsing configuration out of the kernel is highly desired feature, especially when we speak about REST/gRPC APIs. I will add a more requirements for this userspace program: Show current active configuration. With full runtime reconfiguration it's now clear which exact configuration is used at the moment. Some features, like Apply configuration changes atomically. Now live reconfiguration is full reconfiguration and it takes ages to reload very huge configuration under heavy load. With atomic changes, e.g. "add new server group" instead of "leave 1M server groups as is and add a new server group", runtime reconfiguration will be less complicated and more reliable. This will also implement 50% of REST/gRPC APIs requirements. Probably that configuration parser program should replace |
Some directives may be configured globally, but in some sections administrator may want to revert back to defaults. I suggest to use
|
I rewrote #67 to move all the configuration logic from tile to TDB, so no need to update file parser. The only issue (also referenced in the code) is about location processing, so I deleted couple comments and rewritten the initial task statement. |
Although #851 introduced significant changes tocfg.c
it still has architectural issues: the same cleanup function for different directives, cleanup is not aware of that it cleans up actually (so it's not possible to clean up a part of repeatable directives, e.g.srv_group
), tracking of child specs is a little bit hacky (see usage of__called_now
flags), it's not possible to get current effective configuration.Tempesta should build a tree ofTfwCfgEntry
to represent text configuration. This change will eliminate__called_*
flags inTfwCfgSpec
structure. In the same time theTfwCfgSpec
structure must be used only as description of configuration directives.Issues #67 and #102 is mostly about scenarios of interacting with configuration, so requirements from that issues must be taken into account during completing this task.TfwHttpReq->location
should always point to the full effective set of location-based setting. Currently it's required to look though current location, current vhost default location and global vhost settings to obtain complete set of settings.Example:
tempesta/tempesta_fw/http.c
Lines 2004 to 2006 in 40dd107
The text was updated successfully, but these errors were encountered: