{"action":"created","comment":{"url":"https://api.github.com/repos/Microsoft/pai/pulls/comments/218285344","pull_request_review_id":156186424,"id":218285344,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxODI4NTM0NA==","diff_hunk":"@@ -23,19 +23,48 @@ pushd $(dirname \"$0\") > /dev/null\n echo \"refrash hadoop-name-node-configuration\"\n kubectl create configmap hadoop-name-node-configuration --from-file=hadoop-name-node-configuration/ --dry-run -o yaml | kubectl apply -f - || exit $?\n \n-echo \"relabel the node label\"\n-/bin/bash node-label.sh || exit $?\n+echo \"Re-label all the node in the cluster!\"\n+echo \"Keep pods consistent with labels.\"\n \n+# \"For NotIn rule, it's for Daemonset, so just update label is enough, Daemonset's status will change with labels.\"\n \n-{% for host in machinelist %}\n \n-    {% if 'hadoop-name-node' not in machinelist[ host ] %}\n-if kubectl describe node {{ machinelist[ host ][ 'nodename' ] }} | grep -q \"hadoop-name-node=\"; then\n-    echo \"Remove Node {{ machinelist[ host ][ 'nodename'] }}'s label, due to the node doesn't have hadoop-name-node's label\"\n-    kubectl label nodes {{ machinelist[ host ][ 'nodename' ] }} hadoop-name-node- || exit $?\n-fi\n-    {% endif %}\n+{% for host in machinelist %}\n+    {% for role in serviceinfo['deploy-rules'] %}\n+        \n+        {% if 'in' in role %}    \n+            {% if role['in'] in machinelist[host] %}\n+                kubectl label --overwrite=true nodes {{ machinelist[ host ][ 'nodename' ] }} {{role['in']}}='true' || exit $?\n+                if ! `kubectl get po -o wide | grep -1 {{machinelist[ host ]['nodename']}} | grep -q {{servicename}}`; then\n+                    echo \"Start service {{servicename}} frome Node {{ machinelist[ host ][ 'nodename'] }} according to the cluster-configuration label definithion change\"\n+                    chmod +x {{serviceinfo['start-script']}}\n+                    ./{{serviceinfo['start-script']}}","path":"src/hadoop-name-node/deploy/refresh.sh.template","position":28,"original_position":28,"commit_id":"688651dc5c6de553aed8bbcd3796ab94b1e9c9cd","original_commit_id":"688651dc5c6de553aed8bbcd3796ab94b1e9c9cd","user":{"login":"ydye","id":8675883,"node_id":"MDQ6VXNlcjg2NzU4ODM=","avatar_url":"https://avatars2.githubusercontent.com/u/8675883?v=4","gravatar_id":"","url":"https://api.github.com/users/ydye","html_url":"https://github.com/ydye","followers_url":"https://api.github.com/users/ydye/followers","following_url":"https://api.github.com/users/ydye/following{/other_user}","gists_url":"https://api.github.com/users/ydye/gists{/gist_id}","starred_url":"https://api.github.com/users/ydye/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ydye/subscriptions","organizations_url":"https://api.github.com/users/ydye/orgs","repos_url":"https://api.github.com/users/ydye/repos","events_url":"https://api.github.com/users/ydye/events{/privacy}","received_events_url":"https://api.github.com/users/ydye/received_events","type":"User","site_admin":false},"body":"remove or change","created_at":"2018-09-18T02:45:54Z","updated_at":"2018-09-18T02:53:07Z","html_url":"https://github.com/Microsoft/pai/pull/1388#discussion_r218285344","pull_request_url":"https://api.github.com/repos/Microsoft/pai/pulls/1388","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/comments/218285344"},"html":{"href":"https://github.com/Microsoft/pai/pull/1388#discussion_r218285344"},"pull_request":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/1388"}}},"pull_request":{"url":"https://api.github.com/repos/Microsoft/pai/pulls/1388","id":215887793,"node_id":"MDExOlB1bGxSZXF1ZXN0MjE1ODg3Nzkz","html_url":"https://github.com/Microsoft/pai/pull/1388","diff_url":"https://github.com/Microsoft/pai/pull/1388.diff","patch_url":"https://github.com/Microsoft/pai/pull/1388.patch","issue_url":"https://api.github.com/repos/Microsoft/pai/issues/1388","number":1388,"state":"open","locked":false,"title":"refresh service","user":{"login":"YitongFeng","id":11583225,"node_id":"MDQ6VXNlcjExNTgzMjI1","avatar_url":"https://avatars2.githubusercontent.com/u/11583225?v=4","gravatar_id":"","url":"https://api.github.com/users/YitongFeng","html_url":"https://github.com/YitongFeng","followers_url":"https://api.github.com/users/YitongFeng/followers","following_url":"https://api.github.com/users/YitongFeng/following{/other_user}","gists_url":"https://api.github.com/users/YitongFeng/gists{/gist_id}","starred_url":"https://api.github.com/users/YitongFeng/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YitongFeng/subscriptions","organizations_url":"https://api.github.com/users/YitongFeng/orgs","repos_url":"https://api.github.com/users/YitongFeng/repos","events_url":"https://api.github.com/users/YitongFeng/events{/privacy}","received_events_url":"https://api.github.com/users/YitongFeng/received_events","type":"User","site_admin":false},"body":"1. Update configmap\r\n2. Make the nodes' labels consistent with machinelist configuration. For labels in this config, relabel them, for labels not in this config, if still exist in node's labels, remove them.\r\n3. Make the service pods consistent with the label. For Daemonsets, they are sensitive to labels, so just keep the label's consistence is enough.","created_at":"2018-09-17T06:59:43Z","updated_at":"2018-09-18T02:53:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"88dbbecd1b23ee211aabfe513a35ab48d3c9d02d","assignee":null,"assignees":[],"requested_reviewers":[{"login":"sterowang","id":11206612,"node_id":"MDQ6VXNlcjExMjA2NjEy","avatar_url":"https://avatars2.githubusercontent.com/u/11206612?v=4","gravatar_id":"","url":"https://api.github.com/users/sterowang","html_url":"https://github.com/sterowang","followers_url":"https://api.github.com/users/sterowang/followers","following_url":"https://api.github.com/users/sterowang/following{/other_user}","gists_url":"https://api.github.com/users/sterowang/gists{/gist_id}","starred_url":"https://api.github.com/users/sterowang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sterowang/subscriptions","organizations_url":"https://api.github.com/users/sterowang/orgs","repos_url":"https://api.github.com/users/sterowang/repos","events_url":"https://api.github.com/users/sterowang/events{/privacy}","received_events_url":"https://api.github.com/users/sterowang/received_events","type":"User","site_admin":false}],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Microsoft/pai/pulls/1388/commits","review_comments_url":"https://api.github.com/repos/Microsoft/pai/pulls/1388/comments","review_comment_url":"https://api.github.com/repos/Microsoft/pai/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Microsoft/pai/issues/1388/comments","statuses_url":"https://api.github.com/repos/Microsoft/pai/statuses/688651dc5c6de553aed8bbcd3796ab94b1e9c9cd","head":{"label":"Microsoft:yife/refresh","ref":"yife/refresh","sha":"688651dc5c6de553aed8bbcd3796ab94b1e9c9cd","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":104741169,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ3NDExNjk=","name":"pai","full_name":"Microsoft/pai","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/pai","description":"Resource scheduling and cluster management for AI","fork":false,"url":"https://api.github.com/repos/Microsoft/pai","forks_url":"https://api.github.com/repos/Microsoft/pai/forks","keys_url":"https://api.github.com/repos/Microsoft/pai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/pai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/pai/teams","hooks_url":"https://api.github.com/repos/Microsoft/pai/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/pai/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/pai/events","assignees_url":"https://api.github.com/repos/Microsoft/pai/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/pai/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/pai/tags","blobs_url":"https://api.github.com/repos/Microsoft/pai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/pai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/pai/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/pai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/pai/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/pai/languages","stargazers_url":"https://api.github.com/repos/Microsoft/pai/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/pai/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/pai/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/pai/subscription","commits_url":"https://api.github.com/repos/Microsoft/pai/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/pai/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/pai/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/pai/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/pai/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/pai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/pai/merges","archive_url":"https://api.github.com/repos/Microsoft/pai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/pai/downloads","issues_url":"https://api.github.com/repos/Microsoft/pai/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/pai/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/pai/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/pai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/pai/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/pai/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/pai/deployments","created_at":"2017-09-25T11:24:51Z","updated_at":"2018-09-18T02:50:51Z","pushed_at":"2018-09-18T02:44:01Z","git_url":"git://github.com/Microsoft/pai.git","ssh_url":"git@github.com:Microsoft/pai.git","clone_url":"https://github.com/Microsoft/pai.git","svn_url":"https://github.com/Microsoft/pai","homepage":"","size":9425,"stargazers_count":453,"watchers_count":453,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"archived":false,"open_issues_count":108,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":114,"open_issues":108,"watchers":453,"default_branch":"master"}},"base":{"label":"Microsoft:master","ref":"master","sha":"ebc112ab1b8a84a2bb0ec01ad71fd9918ae0b752","user":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"repo":{"id":104741169,"node_id":"MDEwOlJlcG9zaXRvcnkxMDQ3NDExNjk=","name":"pai","full_name":"Microsoft/pai","private":false,"owner":{"login":"Microsoft","id":6154722,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxNTQ3MjI=","avatar_url":"https://avatars2.githubusercontent.com/u/6154722?v=4","gravatar_id":"","url":"https://api.github.com/users/Microsoft","html_url":"https://github.com/Microsoft","followers_url":"https://api.github.com/users/Microsoft/followers","following_url":"https://api.github.com/users/Microsoft/following{/other_user}","gists_url":"https://api.github.com/users/Microsoft/gists{/gist_id}","starred_url":"https://api.github.com/users/Microsoft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Microsoft/subscriptions","organizations_url":"https://api.github.com/users/Microsoft/orgs","repos_url":"https://api.github.com/users/Microsoft/repos","events_url":"https://api.github.com/users/Microsoft/events{/privacy}","received_events_url":"https://api.github.com/users/Microsoft/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/Microsoft/pai","description":"Resource scheduling and cluster management for AI","fork":false,"url":"https://api.github.com/repos/Microsoft/pai","forks_url":"https://api.github.com/repos/Microsoft/pai/forks","keys_url":"https://api.github.com/repos/Microsoft/pai/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Microsoft/pai/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Microsoft/pai/teams","hooks_url":"https://api.github.com/repos/Microsoft/pai/hooks","issue_events_url":"https://api.github.com/repos/Microsoft/pai/issues/events{/number}","events_url":"https://api.github.com/repos/Microsoft/pai/events","assignees_url":"https://api.github.com/repos/Microsoft/pai/assignees{/user}","branches_url":"https://api.github.com/repos/Microsoft/pai/branches{/branch}","tags_url":"https://api.github.com/repos/Microsoft/pai/tags","blobs_url":"https://api.github.com/repos/Microsoft/pai/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Microsoft/pai/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Microsoft/pai/git/refs{/sha}","trees_url":"https://api.github.com/repos/Microsoft/pai/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Microsoft/pai/statuses/{sha}","languages_url":"https://api.github.com/repos/Microsoft/pai/languages","stargazers_url":"https://api.github.com/repos/Microsoft/pai/stargazers","contributors_url":"https://api.github.com/repos/Microsoft/pai/contributors","subscribers_url":"https://api.github.com/repos/Microsoft/pai/subscribers","subscription_url":"https://api.github.com/repos/Microsoft/pai/subscription","commits_url":"https://api.github.com/repos/Microsoft/pai/commits{/sha}","git_commits_url":"https://api.github.com/repos/Microsoft/pai/git/commits{/sha}","comments_url":"https://api.github.com/repos/Microsoft/pai/comments{/number}","issue_comment_url":"https://api.github.com/repos/Microsoft/pai/issues/comments{/number}","contents_url":"https://api.github.com/repos/Microsoft/pai/contents/{+path}","compare_url":"https://api.github.com/repos/Microsoft/pai/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Microsoft/pai/merges","archive_url":"https://api.github.com/repos/Microsoft/pai/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Microsoft/pai/downloads","issues_url":"https://api.github.com/repos/Microsoft/pai/issues{/number}","pulls_url":"https://api.github.com/repos/Microsoft/pai/pulls{/number}","milestones_url":"https://api.github.com/repos/Microsoft/pai/milestones{/number}","notifications_url":"https://api.github.com/repos/Microsoft/pai/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Microsoft/pai/labels{/name}","releases_url":"https://api.github.com/repos/Microsoft/pai/releases{/id}","deployments_url":"https://api.github.com/repos/Microsoft/pai/deployments","created_at":"2017-09-25T11:24:51Z","updated_at":"2018-09-18T02:50:51Z","pushed_at":"2018-09-18T02:44:01Z","git_url":"git://github.com/Microsoft/pai.git","ssh_url":"git@github.com:Microsoft/pai.git","clone_url":"https://github.com/Microsoft/pai.git","svn_url":"https://github.com/Microsoft/pai","homepage":"","size":9425,"stargazers_count":453,"watchers_count":453,"language":"Java","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":114,"mirror_url":null,"archived":false,"open_issues_count":108,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":114,"open_issues":108,"watchers":453,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/1388"},"html":{"href":"https://github.com/Microsoft/pai/pull/1388"},"issue":{"href":"https://api.github.com/repos/Microsoft/pai/issues/1388"},"comments":{"href":"https://api.github.com/repos/Microsoft/pai/issues/1388/comments"},"review_comments":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/1388/comments"},"review_comment":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Microsoft/pai/pulls/1388/commits"},"statuses":{"href":"https://api.github.com/repos/Microsoft/pai/statuses/688651dc5c6de553aed8bbcd3796ab94b1e9c9cd"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"ydye"}}