{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/helm/issues/2298","repository_url":"https://api.github.com/repos/kubernetes/helm","labels_url":"https://api.github.com/repos/kubernetes/helm/issues/2298/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/helm/issues/2298/comments","events_url":"https://api.github.com/repos/kubernetes/helm/issues/2298/events","html_url":"https://github.com/kubernetes/helm/issues/2298","id":222895051,"node_id":"MDU6SXNzdWUyMjI4OTUwNTE=","number":2298,"title":"Feature: Stream hook logs back to helm client","user":{"login":"johnw188","id":6454,"node_id":"MDQ6VXNlcjY0NTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6454?v=4","gravatar_id":"","url":"https://api.github.com/users/johnw188","html_url":"https://github.com/johnw188","followers_url":"https://api.github.com/users/johnw188/followers","following_url":"https://api.github.com/users/johnw188/following{/other_user}","gists_url":"https://api.github.com/users/johnw188/gists{/gist_id}","starred_url":"https://api.github.com/users/johnw188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnw188/subscriptions","organizations_url":"https://api.github.com/users/johnw188/orgs","repos_url":"https://api.github.com/users/johnw188/repos","events_url":"https://api.github.com/users/johnw188/events{/privacy}","received_events_url":"https://api.github.com/users/johnw188/received_events","type":"User","site_admin":false},"labels":[{"id":562687520,"node_id":"MDU6TGFiZWw1NjI2ODc1MjA=","url":"https://api.github.com/repos/kubernetes/helm/labels/feature","name":"feature","color":"0052cc","default":false},{"id":778129496,"node_id":"MDU6TGFiZWw3NzgxMjk0OTY=","url":"https://api.github.com/repos/kubernetes/helm/labels/lifecycle/stale","name":"lifecycle/stale","color":"795548","default":false}],"state":"open","locked":false,"assignee":{"login":"johnw188","id":6454,"node_id":"MDQ6VXNlcjY0NTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6454?v=4","gravatar_id":"","url":"https://api.github.com/users/johnw188","html_url":"https://github.com/johnw188","followers_url":"https://api.github.com/users/johnw188/followers","following_url":"https://api.github.com/users/johnw188/following{/other_user}","gists_url":"https://api.github.com/users/johnw188/gists{/gist_id}","starred_url":"https://api.github.com/users/johnw188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnw188/subscriptions","organizations_url":"https://api.github.com/users/johnw188/orgs","repos_url":"https://api.github.com/users/johnw188/repos","events_url":"https://api.github.com/users/johnw188/events{/privacy}","received_events_url":"https://api.github.com/users/johnw188/received_events","type":"User","site_admin":false},"assignees":[{"login":"johnw188","id":6454,"node_id":"MDQ6VXNlcjY0NTQ=","avatar_url":"https://avatars2.githubusercontent.com/u/6454?v=4","gravatar_id":"","url":"https://api.github.com/users/johnw188","html_url":"https://github.com/johnw188","followers_url":"https://api.github.com/users/johnw188/followers","following_url":"https://api.github.com/users/johnw188/following{/other_user}","gists_url":"https://api.github.com/users/johnw188/gists{/gist_id}","starred_url":"https://api.github.com/users/johnw188/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/johnw188/subscriptions","organizations_url":"https://api.github.com/users/johnw188/orgs","repos_url":"https://api.github.com/users/johnw188/repos","events_url":"https://api.github.com/users/johnw188/events{/privacy}","received_events_url":"https://api.github.com/users/johnw188/received_events","type":"User","site_admin":false}],"milestone":null,"comments":14,"created_at":"2017-04-19T22:50:06Z","updated_at":"2018-06-21T20:13:02Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"When performing helm release operations such as `install`, `upgrade`, `delete` and `rollback`, the helm client will block without feedback while hooks execute. If chart owners aren't careful with their error handling, kubernetes can put the hook job into an infinite loop of failure. Conversely, long running hooks such as database migrations can be executing successfully while the user is unaware that code is executing.\r\n\r\nTo mitigate these issues helm should stream hook logs back to the helm client.\r\n\r\n## UI\r\n\r\nSuccessful install:\r\n```\r\n› helm install internal/jenkins\r\nExecuting pre-install hooks: ldap-update-job, credential-update-job\r\n[credential-update-job] Updating Jenkins credentials\r\n[ldap-update-job] Updating LDAP configuration\r\n[credential-update-job] Validating credentials\r\n[credential-update-job] Successfully updated credentials!\r\n[ldap-update-job] Successfully updated LDAP!\r\n\r\nExecuting post-install hooks: migrate-db\r\n[migrate-db] Starting database migration\r\n[migrate-db] Database migration completed\r\n\r\nInstall was a success! Happy Helming!\r\n\r\n```\r\n\r\nInstall with issues:\r\n```\r\n› helm install internal/jenkins\r\n[credential-update-job] Updating Jenkins credentials\r\n[ldap-update-job] Updating LDAP configuration\r\n[credential-update-job] Validating credentials\r\n[credential-update-job] Successfully updated credentials!\r\n[ldap-update-job] ERROR: Invalid password/token for user: john.welsh\r\n[ldap-update-job] Updating LDAP failed\r\n[credential-update-job] Updating Jenkins credentials\r\n[ldap-update-job] ERROR: Invalid password/token for user: john.welsh\r\n[ldap-update-job] Updating LDAP failed\r\n...\r\n```\r\n\r\nOpen questions\r\n\r\n- Timestamps?\r\n- Should pod name be surfaced somewhere?\r\n  - Note that the pod name can change if the hook fails or gets evicted before it completes\r\n  - Pod names are super long (`john-ci-jenkins-update-credentials-xzz5f-1z166`)\r\n\r\nFuture enhancements\r\n\r\n- Retry counter for jobs?\r\n\r\n## Implementation\r\n\r\nIn the tiller proto definition:\r\n\r\n```\r\n// GetReleaseLogs gets a stream of log events for a given release.\r\n    rpc GetReleaseLogs(GetReleaseLogsRequest) returns (stream GetReleaseLogsResponse) {\r\n}\r\n\r\nmessage GetReleaseLogsRequest {\r\n    // Name is the name of the release\r\n    string name = 1;\r\n    // Version is the version of the release\r\n    int32 version = 2;\r\n}\r\n\r\nmessage GetReleaseLogsResponse {\r\n    // Source is the name of the hook that generated the log\r\n    string source = 1;\r\n    // Log is a single log line\r\n    string log = 2;\r\n}\r\n```\r\n\r\nThe helm client will then make two gRPC calls - one to install, the other to grab logs.\r\n\r\nQuestions\r\n\r\n- Is this too chatty? Should logs be collected and passed in chunks?\r\n- Should the API be made specific to hooks (`GetReleaseHookLogsRequest`) or left more generic for future expansion?\r\n- What other fields should be in the response object?"},"comment":{"url":"https://api.github.com/repos/kubernetes/helm/issues/comments/399227996","html_url":"https://github.com/kubernetes/helm/issues/2298#issuecomment-399227996","issue_url":"https://api.github.com/repos/kubernetes/helm/issues/2298","id":399227996,"node_id":"MDEyOklzc3VlQ29tbWVudDM5OTIyNzk5Ng==","user":{"login":"bacongobbler","id":1360539,"node_id":"MDQ6VXNlcjEzNjA1Mzk=","avatar_url":"https://avatars2.githubusercontent.com/u/1360539?v=4","gravatar_id":"","url":"https://api.github.com/users/bacongobbler","html_url":"https://github.com/bacongobbler","followers_url":"https://api.github.com/users/bacongobbler/followers","following_url":"https://api.github.com/users/bacongobbler/following{/other_user}","gists_url":"https://api.github.com/users/bacongobbler/gists{/gist_id}","starred_url":"https://api.github.com/users/bacongobbler/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bacongobbler/subscriptions","organizations_url":"https://api.github.com/users/bacongobbler/orgs","repos_url":"https://api.github.com/users/bacongobbler/repos","events_url":"https://api.github.com/users/bacongobbler/events{/privacy}","received_events_url":"https://api.github.com/users/bacongobbler/received_events","type":"User","site_admin":false},"created_at":"2018-06-21T20:13:02Z","updated_at":"2018-06-21T20:13:02Z","author_association":"COLLABORATOR","body":"No but feel free to pick this back up! It looks like the original author is unresponsive."}}
{"actor":{"display_login":"bacongobbler"}}