Coder Social home page Coder Social logo

kevinmackenzie / incubator-trafficcontrol Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/trafficcontrol

0.0 0.0 0.0 68.5 MB

Mirror of Apache Traffic Control (incubating)

License: Apache License 2.0

Shell 1.78% Go 20.45% Roff 0.04% Perl 35.28% Python 0.94% CSS 1.92% HTML 8.17% JavaScript 16.69% Java 12.77% PLpgSQL 0.71% Perl 6 0.26% Ruby 0.04% PLSQL 0.04% Makefile 0.01% C 0.23% SQLPL 0.67%

incubator-trafficcontrol's People

Contributors

alficles avatar dangogh avatar dewrich avatar dg4prez avatar dneuman64 avatar elsloo avatar ezelkow1 avatar hbeatty avatar jheitz200 avatar jifyang avatar joepolcari avatar jrushford avatar knutsel avatar limited avatar mdb avatar mitchell852 avatar mtorluemke avatar naamashoresh avatar nir-sopher avatar peterryder avatar psudaemon avatar rivasj avatar rob05c avatar rscrimojr avatar ryandurfey avatar trevorackerman avatar trevorhays avatar weifensh avatar xiaodzha avatar zhilhuan avatar

Watchers

 avatar  avatar

incubator-trafficcontrol's Issues

Ort script gets lines missing, but database stores lines added

The naming of the columns in the database suggests that it will store the lines in the database that aren't in the local under db_lines and the lines that are in the local, but not in the database under local_lines. To keep consistent with how the ort script handles these differences, the naming and usage should change to be db_lines_missing and local_lines_missing in the database and something similar in the JSON submitted to the web API.

Best server database column to indices for config difference API?

When requesting the API that we're developing, what should be used as the identifying attributes? the config_name column seems like a good one to have, but should we use the id from the server table, or is there a better option? Right now, it is /servers/{id}/cfg.json to request all configuration differences of the server, but there should be an option to only select the differences of a single file.

Host Name vs Host Name Short

Right now, the API is set up to accept a regular length host-name, but the ort script is making the request with the short version. These are almost always different, so this needs to be solved. It is unclear how a host-name-short gets mapped to its server.id, but that will definitely be a requirement.

Create API for accessing/modifying configuration differences

This is meant to get requests, often from the caches, to update the differences each has with the active configuration for their cache group. This data will be stored as determined in #12 and then can be reported back with other web requests.

This issue may become a project and then more specific issues added as we get to this point in the project.

Custom data stored in Traffic Ops

Once we get a service that interacts with existing Traffic Ops data, we must next extend the data that is stored to include the information of the configuration differences between caches and the cache group configuration.

Error Checking for unmarshalling database-originating json

When retrieving the lines added/removed for a config file in the PostgreSQL database, the database array is being converted to JSON and after making the request, this json is being unmarshalled back into an array. The results of this unmarshalling should be checked for errors.

Submit local time stamp when PUTing configuration state

The timestamp stored in the database with the configuration differences is being taken from the Golang server, but it would be better to have the timestamp come from the client because, while unlikely, it is possible for the client to check for updates, the server to queue an update, and the client to submit the report. This would cause the database to reflect that the client had checked for updates, but didn't see some of them.

Changed TrafficOps Go code and rebuilding

Before anything real can be added to the TrafficOps service, we will need to figure out how the current GO api is structured and how to add endpoints/routes to it. It is unclear if the go code gets shipped or just the binaries, because there are no homologous files between the 2.1.X branch and the /opt/traffic_ops/ folder. Furthermore, I am not entirely sure how to rebuild/restart these apis once they are modified.

Report Basic Info from Traffic Ops

Before creating and reporting my own data, this will test reporting of data that already exists as an example of how to interface with Traffic Ops, so when we add our own data we will know what we're doing.

Document Config API

Right now, the only documentation is on the blog posts and commit messages, but it is important to have a centralized documentation for how the API functions. This could start in the wiki of this repository and then we can figure out how to merge this with the Traffic Ops documentation after the PR.

Add Post/Update methods to ort script

If the ort script is going to notify traffic ops, we are going to want a generalized POST or UPDATE method for making this request, which, similarly to the existing GET method, should do full error checking and retry attempts.

Represent individual configuration deltas

Ideally, we can report exactly which configuration elements are different between the remote and the local. How should these deltas be represented? It should be organized in a way that can be reported to TrafficOps easily and interpreted by another service for a later milestone.

Make tests for Config API

All of the other Golang files (i.e. monitoring.go) have a (file_name)_tests.go that runs tests on the routes. The Config API should have a homologous file.

Restrict PUT access to config API

Ideally, only the server can update/submit its configuration differences for itself. Everyone can have read access to it, but only the owning server can update their table entry. This can be done in the API, but how would this be verified?

Add PUT Route to Config API

One major feature of the API is to allow the server to update their configuration state. This will allow them to do that by submitting JSON to a route TBD with the applicable information. The format of this is also TBD, but will contain the name of the config, the db_lines and the local_lines.

PUT config request requires server id in route, but config file name in JSON

Either there should be one route for all servers, or extend the route to have the config name in too it and ignore the name in the submitted JSON or accept JSON without those elements in it.

For example, either /api/1.2/servers/config/{server-id}/{config-name}
or
/api/1.2/servers/config with {server-id} and {config-name} in the json.

Postinstall generates invalid cdn.conf File

When packaging the repository and installing it to ensure all of the files are on the same version, the generated cdn.conf in the app/conf directory is not the correct format. It appears to work correctly with JSON, but the generated text is in some other format:

hypnotoad => { listen => [

Since the post install terminates early, this might be causing #40 and it might be the reason why the traffic ops golang service also registers as offline when calling service traffic_ops status

Interpret Configurations for comparison

Once we are retrieving configurations from Traffic Ops, we must compare that version with the local one and know what the differences are, so we must represent the configuration data in a way that allows easy comparison and reporting of the differences.

Test Modifying the Ort Script on Traffic Server

To figure out how to integrate with Traffic Control, we should start small, just trying to add a basic service in Go that can build with the rest of the Traffic Control project and be run alongside it.

Try to add a custom Data Extension and route

Based on the documentation on Extensions (Data Extensions), I can add a route file (see TrafficOpsRoutes.pm for example) to a subfolder of the traffic_ops/app/lib/Extensions that contains a TrafficOpsRoutes.pm file and it will allow me to add custom routes. While this wouldn't be a go implementation of the extension, it should be a straightforward way to add a plugin without having to modify any other code.

Useful links:
https://trafficcontrol.incubator.apache.org/docs/latest/development/traffic_ops.html#data-source-extensions
https://trafficcontrol.incubator.apache.org/docs/latest/admin/traffic_ops/extensions.html

What should the config API routes path be?

The title says most of it. What should the paths be for each route we use for this API? The routes used are:

  • Get all config differences of all servers
  • Get all config differences of a server
  • Get all config differences of a config file on a server
  • Update all config differences of a server

Create UI Integration

This integration will allow for the user of Traffic Ops to see the data that we are storing. This data should be stored in an appropriate part of the UI. Perhaps that would be under Servers, or Parameters, or misc.

What needs to be done with result of lwp_put command in ort script

When making the lwp_put request to the Config Diffs API, the result is being taken, but nothing is being done with it. Http error codes are checked in the lwp_put method, so that doesn't need to be done in the process_cfg_file subroutine, but is there anything else that should be done with this?

Traffic Ops No longer starts correctly

After packaging the current version of the repo and running install, the traffic ops service doesn't start successfully, even after replacing the config file (see #41 ) with the older one. There are no errors in any of the log files ('/var/log/traffic_ops/traffic_ops_golang.logandjournalctl`). The one known symptom of this issue is #40.

Learn how Traffic Ops APIs are called

Determine what steps are required before making requests to Traffic Ops (other than authentication) and what information is needed to call these requests

Interpret Traffic Ops Responses

Once we have made successful requests, we must interpret the responses and determine if there is anything else we need to do (other requests to make, parsing, etc.) before the data is in a usable state

Representing configuration deltas

Once we know how to determine the differences between deltas, we must figure out how to represent this difference. this should just be a difference in date that can be reported to Traffic Ops potentially.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.