appcelerator-archive / amp

** THIS PROJECT IS STOPPED ** An open source CaaS for Docker, batteries included.
http://appcelerator.io
Apache License 2.0
81 stars 28 forks source link

Consolidated agent #15

Closed subfuzion closed 8 years ago

subfuzion commented 8 years ago

Create a single agent in Go that can provide the same functionality as our current amp-docker-agent and amp-log-service/amp-log-agent. Evaluate what functionality of our original docker agent is still necessary at the node level and make recommendations on what, if anything, can be eliminated if the information we previously captured is available with alternative strategies under Docker 1.12. If we do not need an agent on every node, then we can consider consolidating the functionality into amplifier.

Our concept of log collation corresponds to Docker Cloud's log multiplexing and is very similar to the work that @generalhenry worked on with amp-log-service, so please coordinate with him. @bertrand-quenin will be working on the log consumer side and adding the cli interface for it (see https://github.com/appcelerator/amp/issues/11).

freignat91 commented 8 years ago

added project repository: amp-agent: https://github.com/appcelerator/amp-agent A new service v1.0.0-0, on this version this agent:

its service command is

docker service create --network amp-swarm --name amp-agent \ --mode global \ -p 5001:3000 \ --label amp.swarm="infrastructure" \ --mount type=bind,source=/var/run/docker.sock,target=/var/run/docker.sock \ appcelerator/amp-agent

Next step make it HA using Elasticsearch last timestamp

subfuzion commented 8 years ago

@freignat91 Looking good so far!

subfuzion commented 8 years ago

@freignat91 Let's have a conversation about the pros/cons of consolidating this into amp and what that would mean if we did...

freignat91 commented 8 years ago

That only the first version, needs to be tested more in details, but the main principles are there except HA for now.

freignat91 commented 8 years ago

amp-agent v1.0.0-1: Added: send dockers events to kafka commit: https://github.com/appcelerator/amp-agent/commit/0904c9a387aea344da54779d337c1dadabf34f52

freignat91 commented 8 years ago

Testing and stabilizing the version before going further.

freignat91 commented 8 years ago

create PR on appcelerator/app: https://github.com/appcelerator/amp/pull/20 to add amp-agent, remove amp-docker-agent and amp-log-service, add kibana, kafkamanager then logs can be viewed on kibana after amp startup amp-log worker work can be followed in kafkamanager on its consumer ui part.

freignat91 commented 8 years ago

adding recovery capability on crash using last time_id stored in elasticsearch in order to do not resent logs which have been already sent.

freignat91 commented 8 years ago

Commited recovery update (forgot to link this commit to this issue): https://github.com/appcelerator/amp-agent/commit/760946432ab8680a8598dfb340e9c2d3a56ff023

freignat91 commented 8 years ago

testing it

subfuzion commented 8 years ago

@freignat91 I just started to look at the code. Can you please add a Makefile at the repo root that incorporates the same kind of rule I added to the amp repo for checking code quality issues? See the check rule I added here. It checks all the sources (filtering out the vendor directory and any auto-generated files). Your code should pass the lint/vet checks and should be formatted with the simplify option (see the fmt rule here).

freignat91 commented 8 years ago

ok, Makefile on going

freignat91 commented 8 years ago

testing new image with all updated code, manually for now testing Docker events pushed on Kafak testing containers running list updated concidering Docker events testing logs pushed on Kafka testing crash and recover with no logs sent two times

freignat91 commented 8 years ago

amp-agent tested ok on swarm min and on full swam

subfuzion commented 8 years ago

@freignat91 I wasn't finished reviewing! Sorry, I know it's been taking a while! It's ok ... I'll finish reviewing and re-open this if necessary. :p