{"action":"created","comment":{"url":"https://api.github.com/repos/broadinstitute/agora/pulls/comments/36301834","id":36301834,"diff_hunk":"@@ -0,0 +1,62 @@\n+package org.broadinstitute.dsde.agora.server.webservice.util\n+\n+import akka.actor.ActorSystem\n+import spray.client.pipelining._\n+import spray.http.HttpResponse\n+import spray.http.StatusCodes._\n+import org.broadinstitute.dsde.agora.server.webservice.util.DockerHubJsonSupport._\n+\n+import scala.concurrent.duration._\n+import scala.concurrent.{Await, Future}\n+\n+case class DockerImageReference(user: Option[String], repo: String, tag: String)\n+\n+case class DockerTagInfo(pk: Int, id: String)\n+\n+object DockerHubClient {\n+  case class DockerConnectionException(text: String = \"There was a problem connecting to Docker Hub APIs.\") extends Exception(text)\n+\n+  case class DockerImageNotFoundException(dockerImage: DockerImageReference) extends Exception {\n+    override def getMessage: String = {\n+      s\"Docker Image for User ${dockerImage.user.getOrElse(\"'Official'\")}/\" + s\"${dockerImage.repo}\" + s\":${dockerImage.tag} not found.\"\n+    }\n+  }\n+\n+  implicit val actorSystem = ActorSystem(\"agora\")\n+\n+  import actorSystem.dispatcher\n+\n+  val timeout = 5.seconds\n+\n+  def pipeline = sendReceive\n+\n+  def gcsGET(url: String): Future[HttpResponse] = pipeline(Get(url))\n+\n+  def doesDockerImageExist(dockerImage: DockerImageReference): Boolean = {\n+    val dockerImageInfo = gcsGET(dockerImageTagUrl(dockerImage))","path":"src/main/scala/org/broadinstitute/dsde/agora/server/webservice/util/DockerHubClient.scala","position":36,"original_position":36,"commit_id":"9554e7abda47e189c75a114f2fcdb4cb14dbfd7e","original_commit_id":"9554e7abda47e189c75a114f2fcdb4cb14dbfd7e","user":{"login":"jacarey","id":6933549,"avatar_url":"https://avatars.githubusercontent.com/u/6933549?v=3","gravatar_id":"","url":"https://api.github.com/users/jacarey","html_url":"https://github.com/jacarey","followers_url":"https://api.github.com/users/jacarey/followers","following_url":"https://api.github.com/users/jacarey/following{/other_user}","gists_url":"https://api.github.com/users/jacarey/gists{/gist_id}","starred_url":"https://api.github.com/users/jacarey/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacarey/subscriptions","organizations_url":"https://api.github.com/users/jacarey/orgs","repos_url":"https://api.github.com/users/jacarey/repos","events_url":"https://api.github.com/users/jacarey/events{/privacy}","received_events_url":"https://api.github.com/users/jacarey/received_events","type":"User","site_admin":false},"body":"gcs?","created_at":"2015-08-05T13:39:36Z","updated_at":"2015-08-05T13:39:36Z","html_url":"https://github.com/broadinstitute/agora/pull/97#discussion_r36301834","pull_request_url":"https://api.github.com/repos/broadinstitute/agora/pulls/97","_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/comments/36301834"},"html":{"href":"https://github.com/broadinstitute/agora/pull/97#discussion_r36301834"},"pull_request":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/97"}}},"pull_request":{"url":"https://api.github.com/repos/broadinstitute/agora/pulls/97","id":41639840,"html_url":"https://github.com/broadinstitute/agora/pull/97","diff_url":"https://github.com/broadinstitute/agora/pull/97.diff","patch_url":"https://github.com/broadinstitute/agora/pull/97.patch","issue_url":"https://api.github.com/repos/broadinstitute/agora/issues/97","number":97,"state":"open","locked":false,"title":"Validate that a docker image referenced in WDL payload validates","user":{"login":"gbggrant","id":4129081,"avatar_url":"https://avatars.githubusercontent.com/u/4129081?v=3","gravatar_id":"","url":"https://api.github.com/users/gbggrant","html_url":"https://github.com/gbggrant","followers_url":"https://api.github.com/users/gbggrant/followers","following_url":"https://api.github.com/users/gbggrant/following{/other_user}","gists_url":"https://api.github.com/users/gbggrant/gists{/gist_id}","starred_url":"https://api.github.com/users/gbggrant/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gbggrant/subscriptions","organizations_url":"https://api.github.com/users/gbggrant/orgs","repos_url":"https://api.github.com/users/gbggrant/repos","events_url":"https://api.github.com/users/gbggrant/events{/privacy}","received_events_url":"https://api.github.com/users/gbggrant/received_events","type":"User","site_admin":false},"body":"Validate that a docker image referenced in WDL payload validates (that it exists in docker hub).\r\n\r\nValidate that if WDL contains a docker reference and it is properly formatted,\r\nthat the docker image exists.  Dealt with both 'official' and 'personal'\r\ndocker hub images and optional tags.  Added integration tests.","created_at":"2015-08-05T03:12:44Z","updated_at":"2015-08-05T13:39:36Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3866fc665258d221fd4c171e9289d5cbfa2538ab","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/broadinstitute/agora/pulls/97/commits","review_comments_url":"https://api.github.com/repos/broadinstitute/agora/pulls/97/comments","review_comment_url":"https://api.github.com/repos/broadinstitute/agora/pulls/comments{/number}","comments_url":"https://api.github.com/repos/broadinstitute/agora/issues/97/comments","statuses_url":"https://api.github.com/repos/broadinstitute/agora/statuses/9554e7abda47e189c75a114f2fcdb4cb14dbfd7e","head":{"label":"broadinstitute:gg_DSDEEPB-306_ref_valid_task_docker_images","ref":"gg_DSDEEPB-306_ref_valid_task_docker_images","sha":"9554e7abda47e189c75a114f2fcdb4cb14dbfd7e","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34753721,"name":"agora","full_name":"broadinstitute/agora","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/agora","description":"It's a methods repository!","fork":false,"url":"https://api.github.com/repos/broadinstitute/agora","forks_url":"https://api.github.com/repos/broadinstitute/agora/forks","keys_url":"https://api.github.com/repos/broadinstitute/agora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/agora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/agora/teams","hooks_url":"https://api.github.com/repos/broadinstitute/agora/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/agora/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/agora/events","assignees_url":"https://api.github.com/repos/broadinstitute/agora/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/agora/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/agora/tags","blobs_url":"https://api.github.com/repos/broadinstitute/agora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/agora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/agora/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/agora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/agora/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/agora/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/agora/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/agora/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/agora/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/agora/subscription","commits_url":"https://api.github.com/repos/broadinstitute/agora/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/agora/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/agora/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/agora/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/agora/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/agora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/agora/merges","archive_url":"https://api.github.com/repos/broadinstitute/agora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/agora/downloads","issues_url":"https://api.github.com/repos/broadinstitute/agora/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/agora/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/agora/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/agora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/agora/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/agora/releases{/id}","created_at":"2015-04-28T20:18:52Z","updated_at":"2015-05-08T19:49:06Z","pushed_at":"2015-08-05T03:12:44Z","git_url":"git://github.com/broadinstitute/agora.git","ssh_url":"git@github.com:broadinstitute/agora.git","clone_url":"https://github.com/broadinstitute/agora.git","svn_url":"https://github.com/broadinstitute/agora","homepage":"","size":9689,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"broadinstitute:master","ref":"master","sha":"9160eef08fa6f1503b7355e2b720f9ec14b2d7a4","user":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"repo":{"id":34753721,"name":"agora","full_name":"broadinstitute/agora","owner":{"login":"broadinstitute","id":393552,"avatar_url":"https://avatars.githubusercontent.com/u/393552?v=3","gravatar_id":"","url":"https://api.github.com/users/broadinstitute","html_url":"https://github.com/broadinstitute","followers_url":"https://api.github.com/users/broadinstitute/followers","following_url":"https://api.github.com/users/broadinstitute/following{/other_user}","gists_url":"https://api.github.com/users/broadinstitute/gists{/gist_id}","starred_url":"https://api.github.com/users/broadinstitute/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/broadinstitute/subscriptions","organizations_url":"https://api.github.com/users/broadinstitute/orgs","repos_url":"https://api.github.com/users/broadinstitute/repos","events_url":"https://api.github.com/users/broadinstitute/events{/privacy}","received_events_url":"https://api.github.com/users/broadinstitute/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/broadinstitute/agora","description":"It's a methods repository!","fork":false,"url":"https://api.github.com/repos/broadinstitute/agora","forks_url":"https://api.github.com/repos/broadinstitute/agora/forks","keys_url":"https://api.github.com/repos/broadinstitute/agora/keys{/key_id}","collaborators_url":"https://api.github.com/repos/broadinstitute/agora/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/broadinstitute/agora/teams","hooks_url":"https://api.github.com/repos/broadinstitute/agora/hooks","issue_events_url":"https://api.github.com/repos/broadinstitute/agora/issues/events{/number}","events_url":"https://api.github.com/repos/broadinstitute/agora/events","assignees_url":"https://api.github.com/repos/broadinstitute/agora/assignees{/user}","branches_url":"https://api.github.com/repos/broadinstitute/agora/branches{/branch}","tags_url":"https://api.github.com/repos/broadinstitute/agora/tags","blobs_url":"https://api.github.com/repos/broadinstitute/agora/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/broadinstitute/agora/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/broadinstitute/agora/git/refs{/sha}","trees_url":"https://api.github.com/repos/broadinstitute/agora/git/trees{/sha}","statuses_url":"https://api.github.com/repos/broadinstitute/agora/statuses/{sha}","languages_url":"https://api.github.com/repos/broadinstitute/agora/languages","stargazers_url":"https://api.github.com/repos/broadinstitute/agora/stargazers","contributors_url":"https://api.github.com/repos/broadinstitute/agora/contributors","subscribers_url":"https://api.github.com/repos/broadinstitute/agora/subscribers","subscription_url":"https://api.github.com/repos/broadinstitute/agora/subscription","commits_url":"https://api.github.com/repos/broadinstitute/agora/commits{/sha}","git_commits_url":"https://api.github.com/repos/broadinstitute/agora/git/commits{/sha}","comments_url":"https://api.github.com/repos/broadinstitute/agora/comments{/number}","issue_comment_url":"https://api.github.com/repos/broadinstitute/agora/issues/comments{/number}","contents_url":"https://api.github.com/repos/broadinstitute/agora/contents/{+path}","compare_url":"https://api.github.com/repos/broadinstitute/agora/compare/{base}...{head}","merges_url":"https://api.github.com/repos/broadinstitute/agora/merges","archive_url":"https://api.github.com/repos/broadinstitute/agora/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/broadinstitute/agora/downloads","issues_url":"https://api.github.com/repos/broadinstitute/agora/issues{/number}","pulls_url":"https://api.github.com/repos/broadinstitute/agora/pulls{/number}","milestones_url":"https://api.github.com/repos/broadinstitute/agora/milestones{/number}","notifications_url":"https://api.github.com/repos/broadinstitute/agora/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/broadinstitute/agora/labels{/name}","releases_url":"https://api.github.com/repos/broadinstitute/agora/releases{/id}","created_at":"2015-04-28T20:18:52Z","updated_at":"2015-05-08T19:49:06Z","pushed_at":"2015-08-05T03:12:44Z","git_url":"git://github.com/broadinstitute/agora.git","ssh_url":"git@github.com:broadinstitute/agora.git","clone_url":"https://github.com/broadinstitute/agora.git","svn_url":"https://github.com/broadinstitute/agora","homepage":"","size":9689,"stargazers_count":0,"watchers_count":0,"language":"Scala","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/97"},"html":{"href":"https://github.com/broadinstitute/agora/pull/97"},"issue":{"href":"https://api.github.com/repos/broadinstitute/agora/issues/97"},"comments":{"href":"https://api.github.com/repos/broadinstitute/agora/issues/97/comments"},"review_comments":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/97/comments"},"review_comment":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/broadinstitute/agora/pulls/97/commits"},"statuses":{"href":"https://api.github.com/repos/broadinstitute/agora/statuses/9554e7abda47e189c75a114f2fcdb4cb14dbfd7e"}}}}