{"action":"created","comment":{"url":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments/64500694","id":64500694,"diff_hunk":"@@ -0,0 +1,248 @@\n+#!/bin/bash\n+# Copyright 2016 The Kubernetes Authors All rights reserved.\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+# Run command with no args for usage instructions.\n+\n+usage() {\n+  echo \"Usage: $(basename \"${0}\") [--large] <instance> [AUTO|create|delete|update|reboot|attach|detatch]\"\n+  exit 1\n+}\n+\n+\n+set -o nounset\n+set -o errexit\n+\n+DOCKER_VERSION='1.9.1-0~wheezy'\n+GO_VERSION='go1.6.2.linux-amd64.tar.gz'\n+TIMEZONE='America/Los_Angeles'\n+\n+# Defaults\n+DISK_SIZE='500GB'  # TODO(fejta): 300G for local-ssd\n+DISK_TYPE='pd-ssd'   # TODO(fejta): local-ssd\n+IMAGE='debian-7-backports'  # TODO(fejta): debian8\n+LARGE=\n+MACHINE_TYPE='n1-highmem-32'  # TODO(fejta): optimize to lower values\n+MASTER='jenkins-master'\n+SCOPES='cloud-platform,compute-rw,storage-full'  # TODO(fejta): verify\n+\n+if [[ -z \"${1:-}\" ]]; then\n+  usage\n+fi\n+\n+while true; do\n+  case \"${1:-}\" in\n+    --large)\n+      LARGE=yes\n+      shift\n+      ;;\n+    --pr)\n+      echo 'Talking to PR jenkins'\n+      MASTER='pull-jenkins-master'\n+      shift\n+      ;;\n+    *)\n+      break\n+      ;;\n+  esac\n+done\n+\n+if [[ -z \"${LARGE}\" ]]; then\n+  read -p \"Using ${MACHINE_TYPE} for testing. Continue [Y/n]: \" ans\n+  if [[ ! \"${ans}\" =~ '^[yY]' ]]; then\n+    echo 'Add --large'\n+    exit 1\n+  fi\n+  DISK_SIZE='200GB'\n+  DISK_TYPE='pd-standard'\n+  MACHINE_TYPE='n1-standard-1'\n+fi\n+\n+INSTANCE=\"${1}\"\n+CMD=\"${2:-auto}\"\n+\n+auto-agent() {\n+  echo \"Automatically creating ${INSTANCE}...\"\n+  detatch-agent\n+  delete-agent\n+  create-agent\n+  update-agent\n+  reboot-agent\n+  attach-agent\n+}\n+\n+tunnel-to-master() {\n+  for i in {1..10}; do\n+    if sudo netstat -anp | grep 8080 > /dev/null 2>&1 ; then\n+      sleep 1\n+    else\n+      break\n+    fi\n+  done\n+  sudo netstat -anp | grep 8080 && echo \"8080 already used\" && exit 1 \\\n+    || echo \"Tunneling to ${MASTER}...\"\n+  gcloud compute ssh \"${MASTER}\" --ssh-flag='-L8080:localhost:8080' sleep 5 &\n+  for i in {1..10}; do\n+    if sudo netstat -anp | grep 8080 > /dev/null 2>&1 ; then\n+      break\n+    fi\n+    sleep 1\n+  done\n+  sudo netstat -anp | grep 8080 > /dev/null 2>&1 || exit 1\n+}\n+\n+\n+master-change() {\n+  sudo pip install jenkinsapi\n+  tunnel-to-master\n+  cmd=\"${1}\"\n+  kind=\"${2}\"\n+  ini=\"${HOME}/jenkins-master-creds.ini\"  # /user/<user>/configure && show api token\n+  python \"$(dirname \"${0}\")/attach_agent.py\" \"${cmd}\" \"${INSTANCE}\" \"${kind}\" \"${ini}\" \"${MASTER}\"\n+  echo 'Waiting for tunnel to close...'\n+  wait\n+}\n+\n+\n+detatch-agent() {\n+  echo \"Detatching ${INSTANCE}...\"\n+  master-change delete ignore-kind\n+}\n+\n+\n+attach-agent() {\n+  gcloud compute ssh \"${INSTANCE}\" -- gcloud compute instances list \"--filter=name=${INSTANCE}\"\n+  echo \"Attaching ${INSTANCE}...\"\n+  if [[ \"${INSTANCE}\" =~ light- ]]; then","path":"jenkins/agent-ctl.sh","position":127,"original_position":127,"commit_id":"e4436b716162c139ec988907f417350618329591","original_commit_id":"e4436b716162c139ec988907f417350618329591","user":{"login":"ixdy","id":8061296,"avatar_url":"https://avatars.githubusercontent.com/u/8061296?v=3","gravatar_id":"","url":"https://api.github.com/users/ixdy","html_url":"https://github.com/ixdy","followers_url":"https://api.github.com/users/ixdy/followers","following_url":"https://api.github.com/users/ixdy/following{/other_user}","gists_url":"https://api.github.com/users/ixdy/gists{/gist_id}","starred_url":"https://api.github.com/users/ixdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixdy/subscriptions","organizations_url":"https://api.github.com/users/ixdy/orgs","repos_url":"https://api.github.com/users/ixdy/repos","events_url":"https://api.github.com/users/ixdy/events{/privacy}","received_events_url":"https://api.github.com/users/ixdy/received_events","type":"User","site_admin":false},"body":"ah, so the instance name does have special meaning. this needs to be better noted in the usage instructions.","created_at":"2016-05-25T00:59:22Z","updated_at":"2016-05-25T00:59:22Z","html_url":"https://github.com/kubernetes/test-infra/pull/63#discussion_r64500694","pull_request_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/63","_links":{"self":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments/64500694"},"html":{"href":"https://github.com/kubernetes/test-infra/pull/63#discussion_r64500694"},"pull_request":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/63"}}},"pull_request":{"url":"https://api.github.com/repos/kubernetes/test-infra/pulls/63","id":70792776,"html_url":"https://github.com/kubernetes/test-infra/pull/63","diff_url":"https://github.com/kubernetes/test-infra/pull/63.diff","patch_url":"https://github.com/kubernetes/test-infra/pull/63.patch","issue_url":"https://api.github.com/repos/kubernetes/test-infra/issues/63","number":63,"state":"open","locked":false,"title":"Script to create a jenkins slave","user":{"login":"fejta","id":940341,"avatar_url":"https://avatars.githubusercontent.com/u/940341?v=3","gravatar_id":"","url":"https://api.github.com/users/fejta","html_url":"https://github.com/fejta","followers_url":"https://api.github.com/users/fejta/followers","following_url":"https://api.github.com/users/fejta/following{/other_user}","gists_url":"https://api.github.com/users/fejta/gists{/gist_id}","starred_url":"https://api.github.com/users/fejta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejta/subscriptions","organizations_url":"https://api.github.com/users/fejta/orgs","repos_url":"https://api.github.com/users/fejta/repos","events_url":"https://api.github.com/users/fejta/events{/privacy}","received_events_url":"https://api.github.com/users/fejta/received_events","type":"User","site_admin":false},"body":"","created_at":"2016-05-20T02:15:47Z","updated_at":"2016-05-25T00:59:22Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0788c7ef803ab634d5e69d739d01a29d4a383d95","assignee":{"login":"ixdy","id":8061296,"avatar_url":"https://avatars.githubusercontent.com/u/8061296?v=3","gravatar_id":"","url":"https://api.github.com/users/ixdy","html_url":"https://github.com/ixdy","followers_url":"https://api.github.com/users/ixdy/followers","following_url":"https://api.github.com/users/ixdy/following{/other_user}","gists_url":"https://api.github.com/users/ixdy/gists{/gist_id}","starred_url":"https://api.github.com/users/ixdy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ixdy/subscriptions","organizations_url":"https://api.github.com/users/ixdy/orgs","repos_url":"https://api.github.com/users/ixdy/repos","events_url":"https://api.github.com/users/ixdy/events{/privacy}","received_events_url":"https://api.github.com/users/ixdy/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/63/commits","review_comments_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/63/comments","review_comment_url":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments{/number}","comments_url":"https://api.github.com/repos/kubernetes/test-infra/issues/63/comments","statuses_url":"https://api.github.com/repos/kubernetes/test-infra/statuses/e4436b716162c139ec988907f417350618329591","head":{"label":"fejta:autostart","ref":"autostart","sha":"e4436b716162c139ec988907f417350618329591","user":{"login":"fejta","id":940341,"avatar_url":"https://avatars.githubusercontent.com/u/940341?v=3","gravatar_id":"","url":"https://api.github.com/users/fejta","html_url":"https://github.com/fejta","followers_url":"https://api.github.com/users/fejta/followers","following_url":"https://api.github.com/users/fejta/following{/other_user}","gists_url":"https://api.github.com/users/fejta/gists{/gist_id}","starred_url":"https://api.github.com/users/fejta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejta/subscriptions","organizations_url":"https://api.github.com/users/fejta/orgs","repos_url":"https://api.github.com/users/fejta/repos","events_url":"https://api.github.com/users/fejta/events{/privacy}","received_events_url":"https://api.github.com/users/fejta/received_events","type":"User","site_admin":false},"repo":{"id":59241934,"name":"test-infra","full_name":"fejta/test-infra","owner":{"login":"fejta","id":940341,"avatar_url":"https://avatars.githubusercontent.com/u/940341?v=3","gravatar_id":"","url":"https://api.github.com/users/fejta","html_url":"https://github.com/fejta","followers_url":"https://api.github.com/users/fejta/followers","following_url":"https://api.github.com/users/fejta/following{/other_user}","gists_url":"https://api.github.com/users/fejta/gists{/gist_id}","starred_url":"https://api.github.com/users/fejta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fejta/subscriptions","organizations_url":"https://api.github.com/users/fejta/orgs","repos_url":"https://api.github.com/users/fejta/repos","events_url":"https://api.github.com/users/fejta/events{/privacy}","received_events_url":"https://api.github.com/users/fejta/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/fejta/test-infra","description":"Test infrastructure for the Kubernetes project.","fork":true,"url":"https://api.github.com/repos/fejta/test-infra","forks_url":"https://api.github.com/repos/fejta/test-infra/forks","keys_url":"https://api.github.com/repos/fejta/test-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/fejta/test-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/fejta/test-infra/teams","hooks_url":"https://api.github.com/repos/fejta/test-infra/hooks","issue_events_url":"https://api.github.com/repos/fejta/test-infra/issues/events{/number}","events_url":"https://api.github.com/repos/fejta/test-infra/events","assignees_url":"https://api.github.com/repos/fejta/test-infra/assignees{/user}","branches_url":"https://api.github.com/repos/fejta/test-infra/branches{/branch}","tags_url":"https://api.github.com/repos/fejta/test-infra/tags","blobs_url":"https://api.github.com/repos/fejta/test-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/fejta/test-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/fejta/test-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/fejta/test-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/fejta/test-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/fejta/test-infra/languages","stargazers_url":"https://api.github.com/repos/fejta/test-infra/stargazers","contributors_url":"https://api.github.com/repos/fejta/test-infra/contributors","subscribers_url":"https://api.github.com/repos/fejta/test-infra/subscribers","subscription_url":"https://api.github.com/repos/fejta/test-infra/subscription","commits_url":"https://api.github.com/repos/fejta/test-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/fejta/test-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/fejta/test-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/fejta/test-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/fejta/test-infra/contents/{+path}","compare_url":"https://api.github.com/repos/fejta/test-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/fejta/test-infra/merges","archive_url":"https://api.github.com/repos/fejta/test-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/fejta/test-infra/downloads","issues_url":"https://api.github.com/repos/fejta/test-infra/issues{/number}","pulls_url":"https://api.github.com/repos/fejta/test-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/fejta/test-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/fejta/test-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/fejta/test-infra/labels{/name}","releases_url":"https://api.github.com/repos/fejta/test-infra/releases{/id}","deployments_url":"https://api.github.com/repos/fejta/test-infra/deployments","created_at":"2016-05-19T20:53:03Z","updated_at":"2016-05-19T20:53:04Z","pushed_at":"2016-05-24T02:42:14Z","git_url":"git://github.com/fejta/test-infra.git","ssh_url":"git@github.com:fejta/test-infra.git","clone_url":"https://github.com/fejta/test-infra.git","svn_url":"https://github.com/fejta/test-infra","homepage":null,"size":495,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"kubernetes:master","ref":"master","sha":"1f4d151080a78de3dae911146c307b4c89627539","user":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"repo":{"id":57333709,"name":"test-infra","full_name":"kubernetes/test-infra","owner":{"login":"kubernetes","id":13629408,"avatar_url":"https://avatars.githubusercontent.com/u/13629408?v=3","gravatar_id":"","url":"https://api.github.com/users/kubernetes","html_url":"https://github.com/kubernetes","followers_url":"https://api.github.com/users/kubernetes/followers","following_url":"https://api.github.com/users/kubernetes/following{/other_user}","gists_url":"https://api.github.com/users/kubernetes/gists{/gist_id}","starred_url":"https://api.github.com/users/kubernetes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kubernetes/subscriptions","organizations_url":"https://api.github.com/users/kubernetes/orgs","repos_url":"https://api.github.com/users/kubernetes/repos","events_url":"https://api.github.com/users/kubernetes/events{/privacy}","received_events_url":"https://api.github.com/users/kubernetes/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/kubernetes/test-infra","description":"Test infrastructure for the Kubernetes project.","fork":false,"url":"https://api.github.com/repos/kubernetes/test-infra","forks_url":"https://api.github.com/repos/kubernetes/test-infra/forks","keys_url":"https://api.github.com/repos/kubernetes/test-infra/keys{/key_id}","collaborators_url":"https://api.github.com/repos/kubernetes/test-infra/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/kubernetes/test-infra/teams","hooks_url":"https://api.github.com/repos/kubernetes/test-infra/hooks","issue_events_url":"https://api.github.com/repos/kubernetes/test-infra/issues/events{/number}","events_url":"https://api.github.com/repos/kubernetes/test-infra/events","assignees_url":"https://api.github.com/repos/kubernetes/test-infra/assignees{/user}","branches_url":"https://api.github.com/repos/kubernetes/test-infra/branches{/branch}","tags_url":"https://api.github.com/repos/kubernetes/test-infra/tags","blobs_url":"https://api.github.com/repos/kubernetes/test-infra/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/kubernetes/test-infra/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/kubernetes/test-infra/git/refs{/sha}","trees_url":"https://api.github.com/repos/kubernetes/test-infra/git/trees{/sha}","statuses_url":"https://api.github.com/repos/kubernetes/test-infra/statuses/{sha}","languages_url":"https://api.github.com/repos/kubernetes/test-infra/languages","stargazers_url":"https://api.github.com/repos/kubernetes/test-infra/stargazers","contributors_url":"https://api.github.com/repos/kubernetes/test-infra/contributors","subscribers_url":"https://api.github.com/repos/kubernetes/test-infra/subscribers","subscription_url":"https://api.github.com/repos/kubernetes/test-infra/subscription","commits_url":"https://api.github.com/repos/kubernetes/test-infra/commits{/sha}","git_commits_url":"https://api.github.com/repos/kubernetes/test-infra/git/commits{/sha}","comments_url":"https://api.github.com/repos/kubernetes/test-infra/comments{/number}","issue_comment_url":"https://api.github.com/repos/kubernetes/test-infra/issues/comments{/number}","contents_url":"https://api.github.com/repos/kubernetes/test-infra/contents/{+path}","compare_url":"https://api.github.com/repos/kubernetes/test-infra/compare/{base}...{head}","merges_url":"https://api.github.com/repos/kubernetes/test-infra/merges","archive_url":"https://api.github.com/repos/kubernetes/test-infra/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/kubernetes/test-infra/downloads","issues_url":"https://api.github.com/repos/kubernetes/test-infra/issues{/number}","pulls_url":"https://api.github.com/repos/kubernetes/test-infra/pulls{/number}","milestones_url":"https://api.github.com/repos/kubernetes/test-infra/milestones{/number}","notifications_url":"https://api.github.com/repos/kubernetes/test-infra/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/kubernetes/test-infra/labels{/name}","releases_url":"https://api.github.com/repos/kubernetes/test-infra/releases{/id}","deployments_url":"https://api.github.com/repos/kubernetes/test-infra/deployments","created_at":"2016-04-28T21:05:35Z","updated_at":"2016-05-10T23:36:17Z","pushed_at":"2016-05-24T21:10:57Z","git_url":"git://github.com/kubernetes/test-infra.git","ssh_url":"git@github.com:kubernetes/test-infra.git","clone_url":"https://github.com/kubernetes/test-infra.git","svn_url":"https://github.com/kubernetes/test-infra","homepage":null,"size":544,"stargazers_count":3,"watchers_count":3,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":19,"forks":17,"open_issues":19,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/63"},"html":{"href":"https://github.com/kubernetes/test-infra/pull/63"},"issue":{"href":"https://api.github.com/repos/kubernetes/test-infra/issues/63"},"comments":{"href":"https://api.github.com/repos/kubernetes/test-infra/issues/63/comments"},"review_comments":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/63/comments"},"review_comment":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/kubernetes/test-infra/pulls/63/commits"},"statuses":{"href":"https://api.github.com/repos/kubernetes/test-infra/statuses/e4436b716162c139ec988907f417350618329591"}}}}
{"actor":{"display_login":"ixdy"}}