ORT is:
perl –c
) fail to verify dynamic runtime errors. This makes it very easy to introduce a bug in seldom-executed areas.ORT will be rewritten into a series of standalone executables, in the “UNIX Philosophy”
- Make each program do one thing well. To do a new job, build afresh rather than complicate old programs by adding new “features”.
- Expect the output of every program to become the input to another, as yet unknown, program. Don‘t clutter output with extraneous information. Avoid stringently columnar or binary input formats. Don’t insist on interactive input.
This makes ORT:
The implementation should adhere to the “UNIX Philosophy,” POSIX, Linux Standard Base (LSB), and GNU as much as possible.
ORT will continue to consist of a single OS package (e.g. RPM), which installs all executables.
ORT will require the following executables:
Aggregator. This is the “primary application” which will emulate the existing ORT script, and be called by CRON or operators to deploy all configs, as ORT does today. Note this is similar to how git works, and several other common Linux CLI utilities. Will include a “Report Mode” which executes the pipeline of commands necessary to emulate the existing ORT Report Mode. This app will have no logic itself, except to call the other executables.
Traffic Ops Requestor. This will fetch data needed from Traffic Ops, such as the Update Pending flag, packages, etc. This should never modify TO data, and should be guaranteed read-only. Any status modifications should go in the Traffic Ops Updater.
Config File Generator. This will take TO data and produce config files.
Config File Preprocessor. Preprocesses generated config files, making post-generation modifications such as underscore directive replacements, and remap OVERRIDE replacements. TODO: determine if this should be rolled into the Config File Generator.
Server Config Readiness Verifier. Verifies the operating system is ready and safe to apply the given config. Currently, this is just checking udev rules and verifying ATS block devices don’t have filessytems. But it may be more in the future. TODO: determine if necessary; should this even be ORT’s job? Will we ever need anything besides udev/50-ats.rules?
ATS Plugin Readiness Verifier. Verifies ATS has the necessary plugins for the config files.
Diff Tool. This will take two config files (presumably an existing and new file) and return their differences. TODO: determine if this is necessary; if configs are deterministic, can POSIX diff be used?
Backup Tool. This will take a file and copy it to a backup location. TODO: determine if necessary; are standard POSIX cp/mv/etc enough?
Restart Determiner. Takes the config to be applied (only the changed files, after diffing), encapsulates the logic of what changes require a reload or restart, and returns whether a restart, reload, or neither is required.
Service Reloader. Takes the name of the service (possibly only ATS) to reload or restart, and reloads or restarts as necessary. TODO determine if necessary; is this any logic beyond calling service restart and/or traffic_ctl?
Traffic Ops Updater. This will set the server’s update status in Traffic Ops. This should be only the Update and Reval Pending flags; ORT should never modify server configuration data, only ever server configuration status data.
The following features of the current ORT are specifically not being implemented in the redesign:
Shell scripts which are “one-liners” pipelining common operations should be provided with the OS Package. TODO: add a list of scripts under Implementation heading.
Additionally, a .pl script which emulates the existing ORT behavior will be provided in the old location, to preserve backwards-compatibility. This script should be very small, and essentially translate old calls and flags to the new Aggregator.
I started to list requirements for all apps, such as unit tests, integration tests, modular design, argument/manpage for usage info, etc. But then I realized I was just listing good design principles. So I decided to omit that.
None.
None.
None.
None.
None.
Completely rewrites ORT. Backward-compatibility for safe upgrades will be preserved.
The Interface will be similar, but compatibility is not a goal. Further, LSB-compliant options and parameters is a goal, and will require incompatibility.
A traffic_ops_ort.pl
script will be provided, whose interface does preserve backward compatibility, and calls the new ORT “aggregator”. This will preserve existing CRON or other tools users are using with ORT, and make an upgrade not break a production system.
None.
None.
None.
None.
Rewrite will provide MAN pages for ORT. ORT arguments are not currently documented, and that will not be changed, to avoid duplicate documentation. TC “read-the-docs” may include a small comment pointing users to the MAN page.
ORT does not currently include an Integration Test framework. Creating one is orthogonal to this project, but this project is a good opportunity to do so at the same time.
ORT Integration Tests need exactly the same thing as the Traffic Ops API tests: a running TO instance populated with data. It is suggested that an ORT Integration Test framework copy or abstract the TO API Tests.
Not significant. ORT in master as of this writing takes less than a minute to run, on a large CDN with at least 1000 Delivery Services and 1000 Servers. The Rewrite should still take less than a minute to run.
It should be a goal for ORT to take less than 15 seconds to run, given a fast Traffic Ops. Because a faster ORT means TC changes propogate faster, which is ideal. But ORT is not in the Request Path, so performance is not critical to TC operation. Further, the previous release of ORT took 5-8 minutes on a large CDN.
None.
None. The rewrite will provide a compatibility script, so existing tools and runs continue to work as before.
Operators should learn the new real ORT interface, to better operate Traffic Control. However, it's not strictly required, they can continue to use the compatibility script for the immediate future.
Developers on ORT will have to learn the new codebase and write in Go.
The new code should not be logically larger or more complex than the existing ORT. The Go language is vertically verbose, but this project does not significantly increase the actual logic, or add new logical features.
There are innumerable ways ORT could be rewritten. Some possibilities:
None anticipated. Small Go library dependencies may be needed, which will be considered as they arise. Any dependencies should be compile-time.
https://en.wikipedia.org/wiki/Unix_philosophy
https://refspecs.linuxfoundation.org/lsb.shtml
https://www.gnu.org/prep/standards/html_node/Command_002dLine-Interfaces.html
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html
https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html#tag_12_02