{"action":"created","comment":{"url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments/327742480","pull_request_review_id":292588407,"id":327742480,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDMyNzc0MjQ4MA==","diff_hunk":"@@ -0,0 +1,268 @@\n+//\"Update the custom data proc image used in leo.  The name of the job contains the name of the dataproc image created. This job will fail if master of terra-docker has not been updated since the last run, as the git hash has not changed. This is a happy side-effect of the fact image names must be unique.\"\n+\n+//populated by first step\n+def ArrayList<String> images = []\n+def shortHash = \"\"\n+\n+def shouldAbortBuild = false\n+def LinkedHashMap<String, String> imageToParamMap = [:]\n+def branchName = \"automated-custom-image-hash-update-\"\n+\n+def getShortHash(hash) {\n+  return hash.substring(0,7)\n+}\n+\n+def boolean hasHashChanges(ArrayList<String> images) {\n+  def Set imagesChanged = []\n+\n+  def String[] configPaths = readFile(\"jenkins/confLocations.txt\").trim().split(\"\\n\")\n+\n+\n+  for (String configFile: configPaths) {\n+\n+    println(\"in change detection loop, before bash. File: $configFile\") \n+    def gitOutput = sh(\n+      //TODO: revert\n+      script: \"git diff HEAD~60..HEAD $configFile\",\n+      returnStdout: true\n+    ).trim()\n+\n+      println(\"in change detection loop, after bash: $gitOutput\") \n+\n+    for (String image: images) {\n+\n+      if (gitOutput.contains(image)) {\n+        println(\"detected changed image for $image\")\n+        imagesChanged.add(image)\n+      }\n+    }\n+  }\n+\n+  return !imagesChanged.isEmpty()\n+}\n+\n+//if an image is in imageNames but not the confFile, the returned version will be an empty string\n+def LinkedHashMap<String,String> getVersionMap(ArrayList<String> imageNames, String configFile) {\n+  def LinkedHashMap<String,String> versionMap = [:]\n+\n+  //for example, if $image is 'welder-server', this line would isolate 'a4f0e04' from the line below in a $configFile\n+  // welderDockerImage = \"us.gcr.io/broad-dsp-gcr-public/welder-server:a4f0e04\"\n+  for (String image: imageNames) {\n+    def version = sh(\n+      script: \"cat $configFile | grep $image | tr ':' '\\n' | tail -1 | tr -d '\\\"' \",\n+      returnStdout: true\n+    ).trim()\n+\n+    versionMap[image] = version\n+  }\n+\n+  return versionMap\n+}\n+\n+pipeline {\n+  agent { label 'node210' } \n+\n+  options { \n+    //we don't want to be building more than one PR's changes at once, we will queue them instead\n+    disableConcurrentBuilds() \n+  }\n+\n+  triggers {\n+    // leaving the string empty causes it to trigger off pushes/PRs to the specified branch\n+    pollSCM(\"\")\n+    //dataproc images expire every 60 days\n+    cron(\"0 0 */59 * *\")\n+  }\n+\n+  parameters {\n+    string(name: \"IMAGE_BASE_NAME\", defaultValue: \"custom-leo-image\",\n+          description: \"The name to give the custom dataproc image. This will be appended with an hypen and the short version of the commit hash (first 7 characters).\")\n+    booleanParam(name: \"useCustomImages\", defaultValue: false)\n+    string(name: \"GOOGLE_PROJECT\", defaultValue: \"broad-dsp-gcr-public\",\n+          description: \"The google project to use\")\n+    string(name: \"BUCKET_NAME\", defaultValue: \"gs://leo-dataproc-image\",\n+          description: \"The bucket where the image will be stored\")\n+    string(name: \"terra_jupyter_base\", defaultValue: \"0.0.1\")\n+    string(name: \"terra_jupyter_hail\", defaultValue: \"0.0.1\",\n+          description: \"Is not currently baked into the image, but is here for future functionality\")\n+    string(name: \"terra_jupyter_r\", defaultValue: \"0.0.3\")\n+    string(name: \"terra_jupyter_python\", defaultValue: \"0.0.1\")\n+    string(name: \"terra_jupyter_bioconductor\", defaultValue: \"0.0.2\",\n+          description: \"Is not currently baked into the image, but is here for future functionality\")\n+    string(name: \"leonardo_jupyter\", defaultValue: \"dev\",","path":"jenkins/Jenkinsfile","position":92,"original_position":92,"commit_id":"59ff35a8530c440a822dcb8955d21e43b646051c","original_commit_id":"59ff35a8530c440a822dcb8955d21e43b646051c","user":{"login":"jdcanas","id":6465084,"node_id":"MDQ6VXNlcjY0NjUwODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6465084?v=4","gravatar_id":"","url":"https://api.github.com/users/jdcanas","html_url":"https://github.com/jdcanas","followers_url":"https://api.github.com/users/jdcanas/followers","following_url":"https://api.github.com/users/jdcanas/following{/other_user}","gists_url":"https://api.github.com/users/jdcanas/gists{/gist_id}","starred_url":"https://api.github.com/users/jdcanas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdcanas/subscriptions","organizations_url":"https://api.github.com/users/jdcanas/orgs","repos_url":"https://api.github.com/users/jdcanas/repos","events_url":"https://api.github.com/users/jdcanas/events{/privacy}","received_events_url":"https://api.github.com/users/jdcanas/received_events","type":"User","site_admin":false},"body":"is this the correct tag still?","created_at":"2019-09-24T17:31:34Z","updated_at":"2019-09-24T17:31:35Z","html_url":"https://github.com/DataBiosphere/leonardo/pull/1076#discussion_r327742480","pull_request_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments/327742480"},"html":{"href":"https://github.com/DataBiosphere/leonardo/pull/1076#discussion_r327742480"},"pull_request":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076"}}},"pull_request":{"url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076","id":320842233,"node_id":"MDExOlB1bGxSZXF1ZXN0MzIwODQyMjMz","html_url":"https://github.com/DataBiosphere/leonardo/pull/1076","diff_url":"https://github.com/DataBiosphere/leonardo/pull/1076.diff","patch_url":"https://github.com/DataBiosphere/leonardo/pull/1076.patch","issue_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/1076","number":1076,"state":"open","locked":false,"title":"Jc auto build dataproc","user":{"login":"jdcanas","id":6465084,"node_id":"MDQ6VXNlcjY0NjUwODQ=","avatar_url":"https://avatars1.githubusercontent.com/u/6465084?v=4","gravatar_id":"","url":"https://api.github.com/users/jdcanas","html_url":"https://github.com/jdcanas","followers_url":"https://api.github.com/users/jdcanas/followers","following_url":"https://api.github.com/users/jdcanas/following{/other_user}","gists_url":"https://api.github.com/users/jdcanas/gists{/gist_id}","starred_url":"https://api.github.com/users/jdcanas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdcanas/subscriptions","organizations_url":"https://api.github.com/users/jdcanas/orgs","repos_url":"https://api.github.com/users/jdcanas/repos","events_url":"https://api.github.com/users/jdcanas/events{/privacy}","received_events_url":"https://api.github.com/users/jdcanas/received_events","type":"User","site_admin":false},"body":"Still a WIP and testing some things. I left a comment on the line I'd like feedback on. Basically everything except the last 2 stages of the Jenkinsfile are ready for review.\r\n\r\nHave you read [CONTRIBUTING.md](https://github.com/DataBiosphere/leonardo/blob/develop/CONTRIBUTING.md) lately? If not, do that first.\r\n\r\nI, the developer opening this PR, do solemnly pinky swear that:\r\n\r\n- [ ] I've documented my API changes in Swagger\r\n\r\nIn all cases:\r\n\r\n- [ ] Get a thumbsworth of review and PO signoff if necessary\r\n- [ ] Verify all tests go green\r\n- [ ] Squash and merge; you can delete your branch after this\r\n- [ ] Test this change deployed correctly and works on dev environment after deployment\r\n","created_at":"2019-09-24T15:51:39Z","updated_at":"2019-09-24T17:31:35Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3a1c504274681232c661d5de68fc07f9b173bf59","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076/commits","review_comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076/comments","review_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments{/number}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/1076/comments","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/59ff35a8530c440a822dcb8955d21e43b646051c","head":{"label":"DataBiosphere:jc-auto-build-dataproc","ref":"jc-auto-build-dataproc","sha":"59ff35a8530c440a822dcb8955d21e43b646051c","user":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":96942484,"node_id":"MDEwOlJlcG9zaXRvcnk5Njk0MjQ4NA==","name":"leonardo","full_name":"DataBiosphere/leonardo","private":false,"owner":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataBiosphere/leonardo","description":"Notebook service","fork":false,"url":"https://api.github.com/repos/DataBiosphere/leonardo","forks_url":"https://api.github.com/repos/DataBiosphere/leonardo/forks","keys_url":"https://api.github.com/repos/DataBiosphere/leonardo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/leonardo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/leonardo/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/leonardo/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/leonardo/events","assignees_url":"https://api.github.com/repos/DataBiosphere/leonardo/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/leonardo/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/leonardo/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/leonardo/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/leonardo/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/leonardo/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/leonardo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/leonardo/merges","archive_url":"https://api.github.com/repos/DataBiosphere/leonardo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/leonardo/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/leonardo/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/leonardo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/leonardo/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/leonardo/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/leonardo/deployments","created_at":"2017-07-11T22:29:16Z","updated_at":"2019-09-24T14:52:15Z","pushed_at":"2019-09-24T16:50:41Z","git_url":"git://github.com/DataBiosphere/leonardo.git","ssh_url":"git@github.com:DataBiosphere/leonardo.git","clone_url":"https://github.com/DataBiosphere/leonardo.git","svn_url":"https://github.com/DataBiosphere/leonardo","homepage":null,"size":4750,"stargazers_count":16,"watchers_count":16,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":168,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":13,"open_issues":168,"watchers":16,"default_branch":"develop"}},"base":{"label":"DataBiosphere:develop","ref":"develop","sha":"095b635c07e88099b23553fd2cd4ff0dd46d5dc4","user":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"repo":{"id":96942484,"node_id":"MDEwOlJlcG9zaXRvcnk5Njk0MjQ4NA==","name":"leonardo","full_name":"DataBiosphere/leonardo","private":false,"owner":{"login":"DataBiosphere","id":32805087,"node_id":"MDEyOk9yZ2FuaXphdGlvbjMyODA1MDg3","avatar_url":"https://avatars0.githubusercontent.com/u/32805087?v=4","gravatar_id":"","url":"https://api.github.com/users/DataBiosphere","html_url":"https://github.com/DataBiosphere","followers_url":"https://api.github.com/users/DataBiosphere/followers","following_url":"https://api.github.com/users/DataBiosphere/following{/other_user}","gists_url":"https://api.github.com/users/DataBiosphere/gists{/gist_id}","starred_url":"https://api.github.com/users/DataBiosphere/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DataBiosphere/subscriptions","organizations_url":"https://api.github.com/users/DataBiosphere/orgs","repos_url":"https://api.github.com/users/DataBiosphere/repos","events_url":"https://api.github.com/users/DataBiosphere/events{/privacy}","received_events_url":"https://api.github.com/users/DataBiosphere/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/DataBiosphere/leonardo","description":"Notebook service","fork":false,"url":"https://api.github.com/repos/DataBiosphere/leonardo","forks_url":"https://api.github.com/repos/DataBiosphere/leonardo/forks","keys_url":"https://api.github.com/repos/DataBiosphere/leonardo/keys{/key_id}","collaborators_url":"https://api.github.com/repos/DataBiosphere/leonardo/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/DataBiosphere/leonardo/teams","hooks_url":"https://api.github.com/repos/DataBiosphere/leonardo/hooks","issue_events_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/events{/number}","events_url":"https://api.github.com/repos/DataBiosphere/leonardo/events","assignees_url":"https://api.github.com/repos/DataBiosphere/leonardo/assignees{/user}","branches_url":"https://api.github.com/repos/DataBiosphere/leonardo/branches{/branch}","tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/tags","blobs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/refs{/sha}","trees_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/trees{/sha}","statuses_url":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/{sha}","languages_url":"https://api.github.com/repos/DataBiosphere/leonardo/languages","stargazers_url":"https://api.github.com/repos/DataBiosphere/leonardo/stargazers","contributors_url":"https://api.github.com/repos/DataBiosphere/leonardo/contributors","subscribers_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscribers","subscription_url":"https://api.github.com/repos/DataBiosphere/leonardo/subscription","commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/commits{/sha}","git_commits_url":"https://api.github.com/repos/DataBiosphere/leonardo/git/commits{/sha}","comments_url":"https://api.github.com/repos/DataBiosphere/leonardo/comments{/number}","issue_comment_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues/comments{/number}","contents_url":"https://api.github.com/repos/DataBiosphere/leonardo/contents/{+path}","compare_url":"https://api.github.com/repos/DataBiosphere/leonardo/compare/{base}...{head}","merges_url":"https://api.github.com/repos/DataBiosphere/leonardo/merges","archive_url":"https://api.github.com/repos/DataBiosphere/leonardo/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/DataBiosphere/leonardo/downloads","issues_url":"https://api.github.com/repos/DataBiosphere/leonardo/issues{/number}","pulls_url":"https://api.github.com/repos/DataBiosphere/leonardo/pulls{/number}","milestones_url":"https://api.github.com/repos/DataBiosphere/leonardo/milestones{/number}","notifications_url":"https://api.github.com/repos/DataBiosphere/leonardo/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/DataBiosphere/leonardo/labels{/name}","releases_url":"https://api.github.com/repos/DataBiosphere/leonardo/releases{/id}","deployments_url":"https://api.github.com/repos/DataBiosphere/leonardo/deployments","created_at":"2017-07-11T22:29:16Z","updated_at":"2019-09-24T14:52:15Z","pushed_at":"2019-09-24T16:50:41Z","git_url":"git://github.com/DataBiosphere/leonardo.git","ssh_url":"git@github.com:DataBiosphere/leonardo.git","clone_url":"https://github.com/DataBiosphere/leonardo.git","svn_url":"https://github.com/DataBiosphere/leonardo","homepage":null,"size":4750,"stargazers_count":16,"watchers_count":16,"language":"Scala","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":13,"mirror_url":null,"archived":false,"disabled":false,"open_issues_count":168,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":13,"open_issues":168,"watchers":16,"default_branch":"develop"}},"_links":{"self":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076"},"html":{"href":"https://github.com/DataBiosphere/leonardo/pull/1076"},"issue":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/issues/1076"},"comments":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/issues/1076/comments"},"review_comments":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076/comments"},"review_comment":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/pulls/1076/commits"},"statuses":{"href":"https://api.github.com/repos/DataBiosphere/leonardo/statuses/59ff35a8530c440a822dcb8955d21e43b646051c"}},"author_association":"COLLABORATOR"}}
{"actor":{"display_login":"jdcanas"}}