{"action":"created","issue":{"url":"https://api.github.com/repos/weaveworks/scope/issues/438","repository_url":"https://api.github.com/repos/weaveworks/scope","labels_url":"https://api.github.com/repos/weaveworks/scope/issues/438/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/scope/issues/438/comments","events_url":"https://api.github.com/repos/weaveworks/scope/issues/438/events","html_url":"https://github.com/weaveworks/scope/issues/438","id":104865324,"number":438,"title":"Allow one-to-many mappings in the renderer","user":{"login":"tomwilkie","id":444037,"avatar_url":"https://avatars1.githubusercontent.com/u/444037?v=4","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"labels":[{"id":253839951,"url":"https://api.github.com/repos/weaveworks/scope/labels/techdebt","name":"techdebt","color":"fbca04","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2015-09-04T10:27:41Z","updated_at":"2017-11-20T17:55:14Z","closed_at":"2017-11-20T17:55:14Z","author_association":"CONTRIBUTOR","body":"The current rendering pipeline supports many-to-one mappings (including one-to-one) ie endpoint to process, process to container, container to image.\n\nThe pipeline doesn't allow us to go in the opposite direction, for instance enrich processes with container info, or containers with image info.  We hack this up with custom renderers (see #437 ContainerWithImageNameRenderer and ProcessWithContainerNameRenderer) which do two render passes and then do custom lookups.\n\nI propose we generalise this by allowing mappers to emit intermediate keys, not merging RenderableNodes with the same intermediate keys, and allowing mappers to accept multiple RenderableNodes with the same intermediate key.  The MapFunc prototype would become:\n\n```\nfunc (key string, RenderableNodes) []struct{key string, RenderableNode}\n```\n\nCurrent behaviour would be provided by a special 'Reduce' Mapper, which would merge together all the RenderableNodes with the same intermediate key.\n\nThen, to implement ProcessWithContainerNameRenderer, the ProcessRenderer would emit the Container ID as the intermediate key, and the next Mapper would receive all the Process for a given container _and_ the container, where it could then do the arbitrary enriching and emit a set of nodes for the processes.  It would look something like:\n\n```\nProcessRenderer   -> {containerid: [n]processes} -\n                                                  |->  ProcessContainerRenderer -> {processid: [1]process}\nContainerRenderer -> {containerid: [1]container} -\n```\n\nThis would bring out existing Map/Reduce rendering pipeline much closer to real Map/Reduce.  As part of this, we should rename the ReduceRendered to be a MergeRenderer, to prevent (more) confusion.\n"},"comment":{"url":"https://api.github.com/repos/weaveworks/scope/issues/comments/345775800","html_url":"https://github.com/weaveworks/scope/issues/438#issuecomment-345775800","issue_url":"https://api.github.com/repos/weaveworks/scope/issues/438","id":345775800,"user":{"login":"bboreham","id":8125524,"avatar_url":"https://avatars2.githubusercontent.com/u/8125524?v=4","gravatar_id":"","url":"https://api.github.com/users/bboreham","html_url":"https://github.com/bboreham","followers_url":"https://api.github.com/users/bboreham/followers","following_url":"https://api.github.com/users/bboreham/following{/other_user}","gists_url":"https://api.github.com/users/bboreham/gists{/gist_id}","starred_url":"https://api.github.com/users/bboreham/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bboreham/subscriptions","organizations_url":"https://api.github.com/users/bboreham/orgs","repos_url":"https://api.github.com/users/bboreham/repos","events_url":"https://api.github.com/users/bboreham/events{/privacy}","received_events_url":"https://api.github.com/users/bboreham/received_events","type":"User","site_admin":false},"created_at":"2017-11-20T17:55:14Z","updated_at":"2017-11-20T17:55:14Z","author_association":"OWNER","body":"This was done in e4970f9214d4245104a2eb84ed7fc584c5b49547"}}
{"actor":{"display_login":"bboreham"}}