{"action":"created","comment":{"url":"https://api.github.com/repos/istio/istio/pulls/comments/147866991","pull_request_review_id":73022642,"id":147866991,"diff_hunk":"@@ -0,0 +1,240 @@\n+// Copyright 2017 Istio Authors\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+package framework\n+\n+import (\n+\t\"flag\"\n+\t\"fmt\"\n+\t\"io/ioutil\"\n+\t\"path/filepath\"\n+\t\"strings\"\n+\t\"time\"\n+\n+\tu \"istio.io/istio/tests/e2e/util\"\n+)\n+\n+// RawVM interfaces different cloud venders to support e2e testing with VM\n+type RawVM interface {\n+\tCleanable\n+\tGetInternalIP() (string, error)\n+\tGetExternalIP() (string, error)\n+\tSecureShell(cmd string) (string, error)\n+\tSecureCopy(files ...string) (string, error)\n+}\n+\n+var (\n+\t// flags to select vm with specific configuration\n+\tprojectID     = flag.String(\"project_id\", \"istio-testing\", \"Project ID\")\n+\tprojectNumber = flag.String(\"project_number\", \"450874614208\", \"Project Number\")\n+\tvmZone        = flag.String(\"vm_zone\", \"us-west1-a\", \"The zone in which the VM resides\")\n+\tclusterName   = flag.String(\"cluster_name\", \"istio-e2e-rbac-rotation-1\", \"The name of the istio cluster that the VM extends\")\n+\tclusterZone   = flag.String(\"cluster_zone\", \"us-east4-c\", \"The zone of the istio cluster that the VM extends\")\n+\timage         = flag.String(\"image\", \"debian-9-stretch-v20170816\", \"Image Name\")\n+\timageProject  = flag.String(\"image_project\", \"debian-cloud\", \"Image Project\")\n+\t// paths\n+\tsetupMeshExScript  = \"\"\n+\tmashExpansionYaml  = \"\"\n+\tsetupIstioVMScript = \"\"\n+\t// kubectl delete resources on tear down\n+\tkubeDeleteYaml = []string{}\n+)\n+\n+// GCPRawVM is hosted on Google Cloud Platform\n+type GCPRawVM struct {\n+\tName        string\n+\tClusterName string\n+\tClusterZone string\n+\tNamespace   string\n+\t// ServiceAccount must have iam.serviceAccountActor or owner permissions\n+\t// to the project. Use IAM settings.\n+\tServiceAccount string\n+\tProjectID      string\n+\tZone           string\n+\tImage          string\n+\tImageProject   string\n+}\n+\n+// NewGCPRawVM creates a new vm on GCP\n+func NewGCPRawVM(namespace string) *GCPRawVM {\n+\treturn &GCPRawVM{\n+\t\tName:           \"raw-vm-test-new\", // TODO (chx) generate by vm pool server\n+\t\tClusterName:    *clusterName,\n+\t\tClusterZone:    *clusterZone,\n+\t\tNamespace:      namespace,\n+\t\tServiceAccount: fmt.Sprintf(\"%s-compute@developer.gserviceaccount.com\", *projectNumber), //\"istio-prow-test-job@istio-testing.iam.gserviceaccount.com\"\n+\t\tProjectID:      *projectID,\n+\t\tZone:           *vmZone,\n+\t\tImage:          *image,\n+\t\tImageProject:   *imageProject,\n+\t}\n+}\n+\n+// GetInternalIP returns the internal IP of the VM\n+func (vm *GCPRawVM) GetInternalIP() (string, error) {\n+\tcmd := vm.baseCommand(\"describe\") +\n+\t\t\" --format='value(networkInterfaces[0].accessConfigs[0].natIP)'\"\n+\to, e := u.Shell(cmd)\n+\treturn strings.Trim(o, \"\\n\"), e\n+}\n+\n+// GetExternalIP returns the internal IP of the VM\n+func (vm *GCPRawVM) GetExternalIP() (string, error) {\n+\tcmd := vm.baseCommand(\"describe\") +\n+\t\t\" --format='value(networkInterfaces[0].networkIP)'\"\n+\to, e := u.Shell(cmd)\n+\treturn strings.Trim(o, \"\\n\"), e\n+}\n+\n+// SecureShell execeutes cmd on vm through ssh\n+func (vm *GCPRawVM) SecureShell(cmd string) (string, error) {\n+\tssh := fmt.Sprintf(\"gcloud compute ssh --project %s --zone %s %s --command \\\"%s\\\"\",\n+\t\tvm.ProjectID, vm.Zone, vm.Name, cmd)\n+\treturn u.Shell(ssh)\n+}\n+\n+// SecureCopy copies files to vm via scp\n+func (vm *GCPRawVM) SecureCopy(files ...string) (string, error) {","path":"tests/e2e/framework/rawVM.go","position":108,"original_position":108,"commit_id":"0915271d7a19bb33114f80e258c238a8e52d8a16","original_commit_id":"0915271d7a19bb33114f80e258c238a8e52d8a16","user":{"login":"ldemailly","id":3664595,"avatar_url":"https://avatars2.githubusercontent.com/u/3664595?v=4","gravatar_id":"","url":"https://api.github.com/users/ldemailly","html_url":"https://github.com/ldemailly","followers_url":"https://api.github.com/users/ldemailly/followers","following_url":"https://api.github.com/users/ldemailly/following{/other_user}","gists_url":"https://api.github.com/users/ldemailly/gists{/gist_id}","starred_url":"https://api.github.com/users/ldemailly/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ldemailly/subscriptions","organizations_url":"https://api.github.com/users/ldemailly/orgs","repos_url":"https://api.github.com/users/ldemailly/repos","events_url":"https://api.github.com/users/ldemailly/events{/privacy}","received_events_url":"https://api.github.com/users/ldemailly/received_events","type":"User","site_admin":false},"body":"this isn't used right ?","created_at":"2017-10-31T00:00:50Z","updated_at":"2017-10-31T00:02:00Z","html_url":"https://github.com/istio/istio/pull/1039#discussion_r147866991","pull_request_url":"https://api.github.com/repos/istio/istio/pulls/1039","author_association":"OWNER","_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/comments/147866991"},"html":{"href":"https://github.com/istio/istio/pull/1039#discussion_r147866991"},"pull_request":{"href":"https://api.github.com/repos/istio/istio/pulls/1039"}}},"pull_request":{"url":"https://api.github.com/repos/istio/istio/pulls/1039","id":145047620,"html_url":"https://github.com/istio/istio/pull/1039","diff_url":"https://github.com/istio/istio/pull/1039.diff","patch_url":"https://github.com/istio/istio/pull/1039.patch","issue_url":"https://api.github.com/repos/istio/istio/issues/1039","number":1039,"state":"open","locked":false,"title":"Raw VM e2e framework","user":{"login":"chxchx","id":11745975,"avatar_url":"https://avatars1.githubusercontent.com/u/11745975?v=4","gravatar_id":"","url":"https://api.github.com/users/chxchx","html_url":"https://github.com/chxchx","followers_url":"https://api.github.com/users/chxchx/followers","following_url":"https://api.github.com/users/chxchx/following{/other_user}","gists_url":"https://api.github.com/users/chxchx/gists{/gist_id}","starred_url":"https://api.github.com/users/chxchx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chxchx/subscriptions","organizations_url":"https://api.github.com/users/chxchx/orgs","repos_url":"https://api.github.com/users/chxchx/repos","events_url":"https://api.github.com/users/chxchx/events{/privacy}","received_events_url":"https://api.github.com/users/chxchx/received_events","type":"User","site_admin":false},"body":"**What this PR does / why we need it**:\r\nAfter this PR, I will set up prow jobs to test VM daily and also start working on the pre-provisioning scheme. \r\n\r\n**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*: fixes #\r\n\r\n**Special notes for your reviewer**:\r\n\r\n**Release note**:\r\n<!--  Steps to write your release note:\r\n1. Use the release-note-* labels to set the release note state (if you have access)\r\n2. Enter your extended release note in the below block; leaving it blank means using the PR title as the release note. If no release note is required, just write `NONE`.\r\n-->\r\n```release-note\r\nNone\r\n```\r\n","created_at":"2017-10-05T23:59:07Z","updated_at":"2017-10-31T00:02:00Z","closed_at":null,"merged_at":null,"merge_commit_sha":"55207e5b4981a45921345fee8327ea4bac207986","assignee":{"login":"costinm","id":84202,"avatar_url":"https://avatars1.githubusercontent.com/u/84202?v=4","gravatar_id":"","url":"https://api.github.com/users/costinm","html_url":"https://github.com/costinm","followers_url":"https://api.github.com/users/costinm/followers","following_url":"https://api.github.com/users/costinm/following{/other_user}","gists_url":"https://api.github.com/users/costinm/gists{/gist_id}","starred_url":"https://api.github.com/users/costinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costinm/subscriptions","organizations_url":"https://api.github.com/users/costinm/orgs","repos_url":"https://api.github.com/users/costinm/repos","events_url":"https://api.github.com/users/costinm/events{/privacy}","received_events_url":"https://api.github.com/users/costinm/received_events","type":"User","site_admin":false},"assignees":[{"login":"costinm","id":84202,"avatar_url":"https://avatars1.githubusercontent.com/u/84202?v=4","gravatar_id":"","url":"https://api.github.com/users/costinm","html_url":"https://github.com/costinm","followers_url":"https://api.github.com/users/costinm/followers","following_url":"https://api.github.com/users/costinm/following{/other_user}","gists_url":"https://api.github.com/users/costinm/gists{/gist_id}","starred_url":"https://api.github.com/users/costinm/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/costinm/subscriptions","organizations_url":"https://api.github.com/users/costinm/orgs","repos_url":"https://api.github.com/users/costinm/repos","events_url":"https://api.github.com/users/costinm/events{/privacy}","received_events_url":"https://api.github.com/users/costinm/received_events","type":"User","site_admin":false},{"login":"sebastienvas","id":17773671,"avatar_url":"https://avatars1.githubusercontent.com/u/17773671?v=4","gravatar_id":"","url":"https://api.github.com/users/sebastienvas","html_url":"https://github.com/sebastienvas","followers_url":"https://api.github.com/users/sebastienvas/followers","following_url":"https://api.github.com/users/sebastienvas/following{/other_user}","gists_url":"https://api.github.com/users/sebastienvas/gists{/gist_id}","starred_url":"https://api.github.com/users/sebastienvas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sebastienvas/subscriptions","organizations_url":"https://api.github.com/users/sebastienvas/orgs","repos_url":"https://api.github.com/users/sebastienvas/repos","events_url":"https://api.github.com/users/sebastienvas/events{/privacy}","received_events_url":"https://api.github.com/users/sebastienvas/received_events","type":"User","site_admin":false}],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/istio/istio/pulls/1039/commits","review_comments_url":"https://api.github.com/repos/istio/istio/pulls/1039/comments","review_comment_url":"https://api.github.com/repos/istio/istio/pulls/comments{/number}","comments_url":"https://api.github.com/repos/istio/istio/issues/1039/comments","statuses_url":"https://api.github.com/repos/istio/istio/statuses/0915271d7a19bb33114f80e258c238a8e52d8a16","head":{"label":"chxchx:rawvme2e","ref":"rawvme2e","sha":"0915271d7a19bb33114f80e258c238a8e52d8a16","user":{"login":"chxchx","id":11745975,"avatar_url":"https://avatars1.githubusercontent.com/u/11745975?v=4","gravatar_id":"","url":"https://api.github.com/users/chxchx","html_url":"https://github.com/chxchx","followers_url":"https://api.github.com/users/chxchx/followers","following_url":"https://api.github.com/users/chxchx/following{/other_user}","gists_url":"https://api.github.com/users/chxchx/gists{/gist_id}","starred_url":"https://api.github.com/users/chxchx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chxchx/subscriptions","organizations_url":"https://api.github.com/users/chxchx/orgs","repos_url":"https://api.github.com/users/chxchx/repos","events_url":"https://api.github.com/users/chxchx/events{/privacy}","received_events_url":"https://api.github.com/users/chxchx/received_events","type":"User","site_admin":false},"repo":{"id":95500771,"name":"istio","full_name":"chxchx/istio","owner":{"login":"chxchx","id":11745975,"avatar_url":"https://avatars1.githubusercontent.com/u/11745975?v=4","gravatar_id":"","url":"https://api.github.com/users/chxchx","html_url":"https://github.com/chxchx","followers_url":"https://api.github.com/users/chxchx/followers","following_url":"https://api.github.com/users/chxchx/following{/other_user}","gists_url":"https://api.github.com/users/chxchx/gists{/gist_id}","starred_url":"https://api.github.com/users/chxchx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/chxchx/subscriptions","organizations_url":"https://api.github.com/users/chxchx/orgs","repos_url":"https://api.github.com/users/chxchx/repos","events_url":"https://api.github.com/users/chxchx/events{/privacy}","received_events_url":"https://api.github.com/users/chxchx/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/chxchx/istio","description":"Sample code, build and tests and governance material for the Istio project.","fork":true,"url":"https://api.github.com/repos/chxchx/istio","forks_url":"https://api.github.com/repos/chxchx/istio/forks","keys_url":"https://api.github.com/repos/chxchx/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/chxchx/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/chxchx/istio/teams","hooks_url":"https://api.github.com/repos/chxchx/istio/hooks","issue_events_url":"https://api.github.com/repos/chxchx/istio/issues/events{/number}","events_url":"https://api.github.com/repos/chxchx/istio/events","assignees_url":"https://api.github.com/repos/chxchx/istio/assignees{/user}","branches_url":"https://api.github.com/repos/chxchx/istio/branches{/branch}","tags_url":"https://api.github.com/repos/chxchx/istio/tags","blobs_url":"https://api.github.com/repos/chxchx/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/chxchx/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/chxchx/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/chxchx/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/chxchx/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/chxchx/istio/languages","stargazers_url":"https://api.github.com/repos/chxchx/istio/stargazers","contributors_url":"https://api.github.com/repos/chxchx/istio/contributors","subscribers_url":"https://api.github.com/repos/chxchx/istio/subscribers","subscription_url":"https://api.github.com/repos/chxchx/istio/subscription","commits_url":"https://api.github.com/repos/chxchx/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/chxchx/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/chxchx/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/chxchx/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/chxchx/istio/contents/{+path}","compare_url":"https://api.github.com/repos/chxchx/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/chxchx/istio/merges","archive_url":"https://api.github.com/repos/chxchx/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/chxchx/istio/downloads","issues_url":"https://api.github.com/repos/chxchx/istio/issues{/number}","pulls_url":"https://api.github.com/repos/chxchx/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/chxchx/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/chxchx/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/chxchx/istio/labels{/name}","releases_url":"https://api.github.com/repos/chxchx/istio/releases{/id}","deployments_url":"https://api.github.com/repos/chxchx/istio/deployments","created_at":"2017-06-27T00:21:47Z","updated_at":"2017-06-27T00:21:49Z","pushed_at":"2017-10-30T20:13:58Z","git_url":"git://github.com/chxchx/istio.git","ssh_url":"git@github.com:chxchx/istio.git","clone_url":"https://github.com/chxchx/istio.git","svn_url":"https://github.com/chxchx/istio","homepage":"https://istio.io","size":84163,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"istio:master","ref":"master","sha":"4bc13818eb53c1645b90d7acebaaf41b23035199","user":{"login":"istio","id":23534644,"avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"repo":{"id":74175805,"name":"istio","full_name":"istio/istio","owner":{"login":"istio","id":23534644,"avatar_url":"https://avatars1.githubusercontent.com/u/23534644?v=4","gravatar_id":"","url":"https://api.github.com/users/istio","html_url":"https://github.com/istio","followers_url":"https://api.github.com/users/istio/followers","following_url":"https://api.github.com/users/istio/following{/other_user}","gists_url":"https://api.github.com/users/istio/gists{/gist_id}","starred_url":"https://api.github.com/users/istio/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/istio/subscriptions","organizations_url":"https://api.github.com/users/istio/orgs","repos_url":"https://api.github.com/users/istio/repos","events_url":"https://api.github.com/users/istio/events{/privacy}","received_events_url":"https://api.github.com/users/istio/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/istio/istio","description":"Sample code, build and tests and governance material for the Istio project.","fork":false,"url":"https://api.github.com/repos/istio/istio","forks_url":"https://api.github.com/repos/istio/istio/forks","keys_url":"https://api.github.com/repos/istio/istio/keys{/key_id}","collaborators_url":"https://api.github.com/repos/istio/istio/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/istio/istio/teams","hooks_url":"https://api.github.com/repos/istio/istio/hooks","issue_events_url":"https://api.github.com/repos/istio/istio/issues/events{/number}","events_url":"https://api.github.com/repos/istio/istio/events","assignees_url":"https://api.github.com/repos/istio/istio/assignees{/user}","branches_url":"https://api.github.com/repos/istio/istio/branches{/branch}","tags_url":"https://api.github.com/repos/istio/istio/tags","blobs_url":"https://api.github.com/repos/istio/istio/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/istio/istio/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/istio/istio/git/refs{/sha}","trees_url":"https://api.github.com/repos/istio/istio/git/trees{/sha}","statuses_url":"https://api.github.com/repos/istio/istio/statuses/{sha}","languages_url":"https://api.github.com/repos/istio/istio/languages","stargazers_url":"https://api.github.com/repos/istio/istio/stargazers","contributors_url":"https://api.github.com/repos/istio/istio/contributors","subscribers_url":"https://api.github.com/repos/istio/istio/subscribers","subscription_url":"https://api.github.com/repos/istio/istio/subscription","commits_url":"https://api.github.com/repos/istio/istio/commits{/sha}","git_commits_url":"https://api.github.com/repos/istio/istio/git/commits{/sha}","comments_url":"https://api.github.com/repos/istio/istio/comments{/number}","issue_comment_url":"https://api.github.com/repos/istio/istio/issues/comments{/number}","contents_url":"https://api.github.com/repos/istio/istio/contents/{+path}","compare_url":"https://api.github.com/repos/istio/istio/compare/{base}...{head}","merges_url":"https://api.github.com/repos/istio/istio/merges","archive_url":"https://api.github.com/repos/istio/istio/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/istio/istio/downloads","issues_url":"https://api.github.com/repos/istio/istio/issues{/number}","pulls_url":"https://api.github.com/repos/istio/istio/pulls{/number}","milestones_url":"https://api.github.com/repos/istio/istio/milestones{/number}","notifications_url":"https://api.github.com/repos/istio/istio/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/istio/istio/labels{/name}","releases_url":"https://api.github.com/repos/istio/istio/releases{/id}","deployments_url":"https://api.github.com/repos/istio/istio/deployments","created_at":"2016-11-18T23:57:21Z","updated_at":"2017-10-30T23:39:01Z","pushed_at":"2017-10-30T23:31:09Z","git_url":"git://github.com/istio/istio.git","ssh_url":"git@github.com:istio/istio.git","clone_url":"https://github.com/istio/istio.git","svn_url":"https://github.com/istio/istio","homepage":"https://istio.io","size":102936,"stargazers_count":3381,"watchers_count":3381,"language":"Go","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":346,"mirror_url":null,"archived":false,"open_issues_count":143,"forks":346,"open_issues":143,"watchers":3381,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/istio/istio/pulls/1039"},"html":{"href":"https://github.com/istio/istio/pull/1039"},"issue":{"href":"https://api.github.com/repos/istio/istio/issues/1039"},"comments":{"href":"https://api.github.com/repos/istio/istio/issues/1039/comments"},"review_comments":{"href":"https://api.github.com/repos/istio/istio/pulls/1039/comments"},"review_comment":{"href":"https://api.github.com/repos/istio/istio/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/istio/istio/pulls/1039/commits"},"statuses":{"href":"https://api.github.com/repos/istio/istio/statuses/0915271d7a19bb33114f80e258c238a8e52d8a16"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"ldemailly"}}