{"action":"created","comment":{"url":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments/74985800","id":74985800,"diff_hunk":"@@ -0,0 +1,86 @@\n+<!--\n+http://www.apache.org/licenses/LICENSE-2.0.txt\n+\n+\n+Copyright 2015 Intel Corporation\n+\n+Licensed under the Apache License, Version 2.0 (the \"License\");\n+you may not use this file except in compliance with the License.\n+You may obtain a copy of the License at\n+\n+    http://www.apache.org/licenses/LICENSE-2.0\n+\n+Unless required by applicable law or agreed to in writing, software\n+distributed under the License is distributed on an \"AS IS\" BASIS,\n+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n+See the License for the specific language governing permissions and\n+limitations under the License.\n+-->\n+# Plugin life cycle\n+\n+A snap plugin can be in a `Loaded` or `Running` state.  A plugin can be loaded\n+in the following two ways.\n+\n+1. `snapd` was started with an auto discover path `snapd -a /etc/snapd/plugins`\n+2. A user loads a plugin through the REST API or using the snapctl \n+    * `curl -F file=@snap-plugin-publisher-file http://localhost:9191/v1/plugins`\n+    * `snapctl plugin load snap-plugin-publisher-file` \n+\n+A plugin transitions to a `running` state when a task is started that uses the \n+plugin.  This is also called a plugin subscription.  \n+\n+## What happens when a plugin is loaded\n+\n+When a plugin is loaded snapd takes the following steps.\n+\n+1. Handshakes with the plugin by reading it's stdout\n+2. Updates the metric catalog by calling the plugin over RPC\n+    * `GetMetricTypes` returns the metrics the plugin provides\n+    * `GetConfigPolicy` returns the conf policy that the plugin needs\n+3. The plugin is stopped\n+\n+It should be emphasized that when a plugin is loaded it is started but stopped \n+as soon as the metric catalog has been updated.  \n+\n+## What happens when a task is started\n+\n+When a task is started the plugins that it references are started and subscribed ","path":"docs/PLUGIN_LIFECYCLE.md","position":47,"original_position":47,"commit_id":"d4e00bbbfbc92c6cd07d8b46ad71049008b51e32","original_commit_id":"d4e00bbbfbc92c6cd07d8b46ad71049008b51e32","user":{"login":"bjray","id":624417,"avatar_url":"https://avatars.githubusercontent.com/u/624417?v=3","gravatar_id":"","url":"https://api.github.com/users/bjray","html_url":"https://github.com/bjray","followers_url":"https://api.github.com/users/bjray/followers","following_url":"https://api.github.com/users/bjray/following{/other_user}","gists_url":"https://api.github.com/users/bjray/gists{/gist_id}","starred_url":"https://api.github.com/users/bjray/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bjray/subscriptions","organizations_url":"https://api.github.com/users/bjray/orgs","repos_url":"https://api.github.com/users/bjray/repos","events_url":"https://api.github.com/users/bjray/events{/privacy}","received_events_url":"https://api.github.com/users/bjray/received_events","type":"User","site_admin":false},"body":"I'd suggest replacing \"it\" with \"the task\".","created_at":"2016-08-16T17:53:52Z","updated_at":"2016-08-16T17:53:52Z","html_url":"https://github.com/intelsdi-x/snap/pull/1109#discussion_r74985800","pull_request_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109","_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments/74985800"},"html":{"href":"https://github.com/intelsdi-x/snap/pull/1109#discussion_r74985800"},"pull_request":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109"}}},"pull_request":{"url":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109","id":79365404,"html_url":"https://github.com/intelsdi-x/snap/pull/1109","diff_url":"https://github.com/intelsdi-x/snap/pull/1109.diff","patch_url":"https://github.com/intelsdi-x/snap/pull/1109.patch","issue_url":"https://api.github.com/repos/intelsdi-x/snap/issues/1109","number":1109,"state":"open","locked":false,"title":"Simplified interaction between scheduler and control","user":{"login":"marcin-krolik","id":14905131,"avatar_url":"https://avatars.githubusercontent.com/u/14905131?v=3","gravatar_id":"","url":"https://api.github.com/users/marcin-krolik","html_url":"https://github.com/marcin-krolik","followers_url":"https://api.github.com/users/marcin-krolik/followers","following_url":"https://api.github.com/users/marcin-krolik/following{/other_user}","gists_url":"https://api.github.com/users/marcin-krolik/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-krolik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-krolik/subscriptions","organizations_url":"https://api.github.com/users/marcin-krolik/orgs","repos_url":"https://api.github.com/users/marcin-krolik/repos","events_url":"https://api.github.com/users/marcin-krolik/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-krolik/received_events","type":"User","site_admin":false},"body":"Fixes #832, #852, #1052 \r\nContinuation #997 \r\n\r\nSimplified interaction between scheduler and control. Introduces new subscription mechanism with task view. Plugin loading/unloading triggers subscribtion/unsubscribtions from pools.\r\n\r\nLink to [design](https://intelsdi.atlassian.net/wiki/display/~jrcookli/Simplifying+the+interaction+between+scheduler+and+control) document\r\n\r\nSummary of changes:\r\n- task view in `pluginControl` for storing task related data (requests, expanded metrics, plugins and configuration)\r\n- No more expanding metrics on each collect job\r\n- `ValidateDeps` takes care of expanding metrics when task is created\r\n- `SubscribeDeps`/`UnsubscribeDeps` manages task view\r\n- `CollectMetrics` uses task view\r\n- Bound and Unbound subscriptions removed, pool simplified\r\n- changes in gRPC requests for `SubscribeDeps`, `ValidateDeps` and `CollectMetric` \r\n- changes to protobuf\r\n\r\nTesting done:\r\n- unit tests\r\n- manual\r\n\r\n@intelsdi-x/snap-maintainers\r\n","created_at":"2016-07-29T14:10:30Z","updated_at":"2016-08-16T17:53:52Z","closed_at":null,"merged_at":null,"merge_commit_sha":"90fd0fbb3c43e6c32e459ee2a7d70870f0bf3d55","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109/commits","review_comments_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109/comments","review_comment_url":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments{/number}","comments_url":"https://api.github.com/repos/intelsdi-x/snap/issues/1109/comments","statuses_url":"https://api.github.com/repos/intelsdi-x/snap/statuses/d4e00bbbfbc92c6cd07d8b46ad71049008b51e32","head":{"label":"marcin-krolik:kromar-enhanced-view","ref":"kromar-enhanced-view","sha":"d4e00bbbfbc92c6cd07d8b46ad71049008b51e32","user":{"login":"marcin-krolik","id":14905131,"avatar_url":"https://avatars.githubusercontent.com/u/14905131?v=3","gravatar_id":"","url":"https://api.github.com/users/marcin-krolik","html_url":"https://github.com/marcin-krolik","followers_url":"https://api.github.com/users/marcin-krolik/followers","following_url":"https://api.github.com/users/marcin-krolik/following{/other_user}","gists_url":"https://api.github.com/users/marcin-krolik/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-krolik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-krolik/subscriptions","organizations_url":"https://api.github.com/users/marcin-krolik/orgs","repos_url":"https://api.github.com/users/marcin-krolik/repos","events_url":"https://api.github.com/users/marcin-krolik/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-krolik/received_events","type":"User","site_admin":false},"repo":{"id":47414494,"name":"snap","full_name":"marcin-krolik/snap","owner":{"login":"marcin-krolik","id":14905131,"avatar_url":"https://avatars.githubusercontent.com/u/14905131?v=3","gravatar_id":"","url":"https://api.github.com/users/marcin-krolik","html_url":"https://github.com/marcin-krolik","followers_url":"https://api.github.com/users/marcin-krolik/followers","following_url":"https://api.github.com/users/marcin-krolik/following{/other_user}","gists_url":"https://api.github.com/users/marcin-krolik/gists{/gist_id}","starred_url":"https://api.github.com/users/marcin-krolik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/marcin-krolik/subscriptions","organizations_url":"https://api.github.com/users/marcin-krolik/orgs","repos_url":"https://api.github.com/users/marcin-krolik/repos","events_url":"https://api.github.com/users/marcin-krolik/events{/privacy}","received_events_url":"https://api.github.com/users/marcin-krolik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/marcin-krolik/snap","description":"A powerful telemetry framework","fork":true,"url":"https://api.github.com/repos/marcin-krolik/snap","forks_url":"https://api.github.com/repos/marcin-krolik/snap/forks","keys_url":"https://api.github.com/repos/marcin-krolik/snap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/marcin-krolik/snap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/marcin-krolik/snap/teams","hooks_url":"https://api.github.com/repos/marcin-krolik/snap/hooks","issue_events_url":"https://api.github.com/repos/marcin-krolik/snap/issues/events{/number}","events_url":"https://api.github.com/repos/marcin-krolik/snap/events","assignees_url":"https://api.github.com/repos/marcin-krolik/snap/assignees{/user}","branches_url":"https://api.github.com/repos/marcin-krolik/snap/branches{/branch}","tags_url":"https://api.github.com/repos/marcin-krolik/snap/tags","blobs_url":"https://api.github.com/repos/marcin-krolik/snap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/marcin-krolik/snap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/marcin-krolik/snap/git/refs{/sha}","trees_url":"https://api.github.com/repos/marcin-krolik/snap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/marcin-krolik/snap/statuses/{sha}","languages_url":"https://api.github.com/repos/marcin-krolik/snap/languages","stargazers_url":"https://api.github.com/repos/marcin-krolik/snap/stargazers","contributors_url":"https://api.github.com/repos/marcin-krolik/snap/contributors","subscribers_url":"https://api.github.com/repos/marcin-krolik/snap/subscribers","subscription_url":"https://api.github.com/repos/marcin-krolik/snap/subscription","commits_url":"https://api.github.com/repos/marcin-krolik/snap/commits{/sha}","git_commits_url":"https://api.github.com/repos/marcin-krolik/snap/git/commits{/sha}","comments_url":"https://api.github.com/repos/marcin-krolik/snap/comments{/number}","issue_comment_url":"https://api.github.com/repos/marcin-krolik/snap/issues/comments{/number}","contents_url":"https://api.github.com/repos/marcin-krolik/snap/contents/{+path}","compare_url":"https://api.github.com/repos/marcin-krolik/snap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/marcin-krolik/snap/merges","archive_url":"https://api.github.com/repos/marcin-krolik/snap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/marcin-krolik/snap/downloads","issues_url":"https://api.github.com/repos/marcin-krolik/snap/issues{/number}","pulls_url":"https://api.github.com/repos/marcin-krolik/snap/pulls{/number}","milestones_url":"https://api.github.com/repos/marcin-krolik/snap/milestones{/number}","notifications_url":"https://api.github.com/repos/marcin-krolik/snap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/marcin-krolik/snap/labels{/name}","releases_url":"https://api.github.com/repos/marcin-krolik/snap/releases{/id}","deployments_url":"https://api.github.com/repos/marcin-krolik/snap/deployments","created_at":"2015-12-04T16:09:45Z","updated_at":"2015-12-04T16:09:46Z","pushed_at":"2016-08-16T17:12:37Z","git_url":"git://github.com/marcin-krolik/snap.git","ssh_url":"git@github.com:marcin-krolik/snap.git","clone_url":"https://github.com/marcin-krolik/snap.git","svn_url":"https://github.com/marcin-krolik/snap","homepage":"http://github.com/intelsdi-x/snap","size":10791,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"intelsdi-x:master","ref":"master","sha":"4027d4a10cb8fcb3f4a5469749f7f964cfa2375e","user":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"repo":{"id":22931257,"name":"snap","full_name":"intelsdi-x/snap","owner":{"login":"intelsdi-x","id":8398747,"avatar_url":"https://avatars.githubusercontent.com/u/8398747?v=3","gravatar_id":"","url":"https://api.github.com/users/intelsdi-x","html_url":"https://github.com/intelsdi-x","followers_url":"https://api.github.com/users/intelsdi-x/followers","following_url":"https://api.github.com/users/intelsdi-x/following{/other_user}","gists_url":"https://api.github.com/users/intelsdi-x/gists{/gist_id}","starred_url":"https://api.github.com/users/intelsdi-x/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/intelsdi-x/subscriptions","organizations_url":"https://api.github.com/users/intelsdi-x/orgs","repos_url":"https://api.github.com/users/intelsdi-x/repos","events_url":"https://api.github.com/users/intelsdi-x/events{/privacy}","received_events_url":"https://api.github.com/users/intelsdi-x/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/intelsdi-x/snap","description":"The open telemetry framework","fork":false,"url":"https://api.github.com/repos/intelsdi-x/snap","forks_url":"https://api.github.com/repos/intelsdi-x/snap/forks","keys_url":"https://api.github.com/repos/intelsdi-x/snap/keys{/key_id}","collaborators_url":"https://api.github.com/repos/intelsdi-x/snap/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/intelsdi-x/snap/teams","hooks_url":"https://api.github.com/repos/intelsdi-x/snap/hooks","issue_events_url":"https://api.github.com/repos/intelsdi-x/snap/issues/events{/number}","events_url":"https://api.github.com/repos/intelsdi-x/snap/events","assignees_url":"https://api.github.com/repos/intelsdi-x/snap/assignees{/user}","branches_url":"https://api.github.com/repos/intelsdi-x/snap/branches{/branch}","tags_url":"https://api.github.com/repos/intelsdi-x/snap/tags","blobs_url":"https://api.github.com/repos/intelsdi-x/snap/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/intelsdi-x/snap/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/intelsdi-x/snap/git/refs{/sha}","trees_url":"https://api.github.com/repos/intelsdi-x/snap/git/trees{/sha}","statuses_url":"https://api.github.com/repos/intelsdi-x/snap/statuses/{sha}","languages_url":"https://api.github.com/repos/intelsdi-x/snap/languages","stargazers_url":"https://api.github.com/repos/intelsdi-x/snap/stargazers","contributors_url":"https://api.github.com/repos/intelsdi-x/snap/contributors","subscribers_url":"https://api.github.com/repos/intelsdi-x/snap/subscribers","subscription_url":"https://api.github.com/repos/intelsdi-x/snap/subscription","commits_url":"https://api.github.com/repos/intelsdi-x/snap/commits{/sha}","git_commits_url":"https://api.github.com/repos/intelsdi-x/snap/git/commits{/sha}","comments_url":"https://api.github.com/repos/intelsdi-x/snap/comments{/number}","issue_comment_url":"https://api.github.com/repos/intelsdi-x/snap/issues/comments{/number}","contents_url":"https://api.github.com/repos/intelsdi-x/snap/contents/{+path}","compare_url":"https://api.github.com/repos/intelsdi-x/snap/compare/{base}...{head}","merges_url":"https://api.github.com/repos/intelsdi-x/snap/merges","archive_url":"https://api.github.com/repos/intelsdi-x/snap/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/intelsdi-x/snap/downloads","issues_url":"https://api.github.com/repos/intelsdi-x/snap/issues{/number}","pulls_url":"https://api.github.com/repos/intelsdi-x/snap/pulls{/number}","milestones_url":"https://api.github.com/repos/intelsdi-x/snap/milestones{/number}","notifications_url":"https://api.github.com/repos/intelsdi-x/snap/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/intelsdi-x/snap/labels{/name}","releases_url":"https://api.github.com/repos/intelsdi-x/snap/releases{/id}","deployments_url":"https://api.github.com/repos/intelsdi-x/snap/deployments","created_at":"2014-08-13T21:04:51Z","updated_at":"2016-08-15T05:53:07Z","pushed_at":"2016-08-16T17:43:57Z","git_url":"git://github.com/intelsdi-x/snap.git","ssh_url":"git@github.com:intelsdi-x/snap.git","clone_url":"https://github.com/intelsdi-x/snap.git","svn_url":"https://github.com/intelsdi-x/snap","homepage":"http://snap-telemetry.io","size":25344,"stargazers_count":891,"watchers_count":891,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":127,"mirror_url":null,"open_issues_count":116,"forks":127,"open_issues":116,"watchers":891,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109"},"html":{"href":"https://github.com/intelsdi-x/snap/pull/1109"},"issue":{"href":"https://api.github.com/repos/intelsdi-x/snap/issues/1109"},"comments":{"href":"https://api.github.com/repos/intelsdi-x/snap/issues/1109/comments"},"review_comments":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109/comments"},"review_comment":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/intelsdi-x/snap/pulls/1109/commits"},"statuses":{"href":"https://api.github.com/repos/intelsdi-x/snap/statuses/d4e00bbbfbc92c6cd07d8b46ad71049008b51e32"}}}}
{"actor":{"display_login":"bjray"}}