{"action":"created","comment":{"url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/comments/58341002","id":58341002,"diff_hunk":"@@ -0,0 +1,96 @@\n+package cloud.benchflow.experimentsmanager.resources.lifecycle.v1;\n+\n+import cloud.benchflow.experimentsmanager.db.DbSession;\n+import cloud.benchflow.experimentsmanager.db.DbSessionManager;\n+import cloud.benchflow.experimentsmanager.db.entities.Experiment;\n+import cloud.benchflow.experimentsmanager.db.entities.Trial;\n+import cloud.benchflow.experimentsmanager.exceptions.BenchmarkRunException;\n+import cloud.benchflow.experimentsmanager.exceptions.NoSuchBenchmarkException;\n+import cloud.benchflow.experimentsmanager.responses.lifecycle.TrialIdResponse;\n+import cloud.benchflow.experimentsmanager.utils.DriversMaker;\n+import cloud.benchflow.experimentsmanager.utils.minio.v1.MinioHandler;\n+\n+import cloud.benchflow.experimentsmanager.utils.minio.v2.BenchFlowMinioClientException;\n+import cloud.benchflow.faban.client.FabanClient;\n+import cloud.benchflow.faban.client.exceptions.BenchmarkNameNotFoundException;\n+import cloud.benchflow.faban.client.exceptions.FabanClientException;\n+\n+import cloud.benchflow.faban.client.responses.RunId;\n+import com.google.inject.Inject;\n+\n+import org.glassfish.jersey.media.multipart.FormDataContentDisposition;\n+import org.glassfish.jersey.media.multipart.FormDataParam;\n+\n+import com.google.inject.name.Named;\n+\n+import javax.ws.rs.*;\n+import javax.ws.rs.core.MediaType;\n+\n+import java.io.InputStream;\n+\n+/**\n+ * @author Simone D'Avico (simonedavico@gmail.com)\n+ *\n+ * Created on 04/12/15.\n+ */\n+@Path(\"/run\")\n+public class RunBenchmarkResource {\n+\n+    private final MinioHandler mh;\n+    private final DriversMaker dm;\n+    private final FabanClient fc;\n+    private final DbSession db;\n+\n+    @Inject\n+    public RunBenchmarkResource(@Named(\"minio.v1\") final MinioHandler mh,\n+                                @Named(\"drivers.maker\") final DriversMaker  dm,\n+                                @Named(\"faban\") final FabanClient fc,\n+                                @Named(\"db\") final DbSessionManager db) {\n+        this.mh = mh;\n+        this.dm = dm;\n+        this.fc = fc;\n+        this.db = db.getSession();\n+    }\n+\n+    @POST\n+    @Path(\"{benchmarkName}\")\n+    @Consumes(MediaType.MULTIPART_FORM_DATA)\n+    @Produces(\"application/vnd.experiments-manager.v1+json\")\n+    public TrialIdResponse runBenchmark(@PathParam(\"benchmarkName\") String benchmarkName,\n+                                        @DefaultValue(\"null\") @FormDataParam(\"benchflow-benchmark\")\n+                                        InputStream configInputStream,\n+                                        @DefaultValue(\"null\") @FormDataParam(\"benchflow-benchmark\")","path":"application/src/main/java/cloud/benchflow/experimentsmanager/resources/lifecycle/v1/RunBenchmarkResource.java","position":62,"original_position":62,"commit_id":"bb70ef44776f3707c9f0cfc1b2db369ad7a7c32b","original_commit_id":"bb70ef44776f3707c9f0cfc1b2db369ad7a7c32b","user":{"login":"simonedavico","id":4446853,"avatar_url":"https://avatars.githubusercontent.com/u/4446853?v=3","gravatar_id":"","url":"https://api.github.com/users/simonedavico","html_url":"https://github.com/simonedavico","followers_url":"https://api.github.com/users/simonedavico/followers","following_url":"https://api.github.com/users/simonedavico/following{/other_user}","gists_url":"https://api.github.com/users/simonedavico/gists{/gist_id}","starred_url":"https://api.github.com/users/simonedavico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonedavico/subscriptions","organizations_url":"https://api.github.com/users/simonedavico/orgs","repos_url":"https://api.github.com/users/simonedavico/repos","events_url":"https://api.github.com/users/simonedavico/events{/privacy}","received_events_url":"https://api.github.com/users/simonedavico/received_events","type":"User","site_admin":false},"body":"I know, but it is still data which is received by the `runBenchmark` method on an API call, and I prefer to make it explicit.","created_at":"2016-04-04T08:15:38Z","updated_at":"2016-04-04T08:15:38Z","html_url":"https://github.com/benchflow/experiments-manager/pull/28#discussion_r58341002","pull_request_url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28","_links":{"self":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/comments/58341002"},"html":{"href":"https://github.com/benchflow/experiments-manager/pull/28#discussion_r58341002"},"pull_request":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28"}}},"pull_request":{"url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28","id":63933044,"html_url":"https://github.com/benchflow/experiments-manager/pull/28","diff_url":"https://github.com/benchflow/experiments-manager/pull/28.diff","patch_url":"https://github.com/benchflow/experiments-manager/pull/28.patch","issue_url":"https://api.github.com/repos/benchflow/experiments-manager/issues/28","number":28,"state":"open","locked":false,"title":"Api v2","user":{"login":"simonedavico","id":4446853,"avatar_url":"https://avatars.githubusercontent.com/u/4446853?v=3","gravatar_id":"","url":"https://api.github.com/users/simonedavico","html_url":"https://github.com/simonedavico","followers_url":"https://api.github.com/users/simonedavico/followers","following_url":"https://api.github.com/users/simonedavico/following{/other_user}","gists_url":"https://api.github.com/users/simonedavico/gists{/gist_id}","starred_url":"https://api.github.com/users/simonedavico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonedavico/subscriptions","organizations_url":"https://api.github.com/users/simonedavico/orgs","repos_url":"https://api.github.com/users/simonedavico/repos","events_url":"https://api.github.com/users/simonedavico/events{/privacy}","received_events_url":"https://api.github.com/users/simonedavico/received_events","type":"User","site_admin":false},"body":"This pull request implements:\r\n\r\n- Multiple repetitions of the same experiment through version 2 of the API (implements #13);\r\n- Semantic ids for benchflow experiments and trials (fixes #20);\r\n- Provides a `BenchFlowMinioClient` which formalises the interactions and the keys structure on Minio (implements #8);","created_at":"2016-03-23T18:44:26Z","updated_at":"2016-04-04T08:15:38Z","closed_at":null,"merged_at":null,"merge_commit_sha":"8bddc7ef4d3783a12f5dd82313cd27b6d94e3d41","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28/commits","review_comments_url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28/comments","review_comment_url":"https://api.github.com/repos/benchflow/experiments-manager/pulls/comments{/number}","comments_url":"https://api.github.com/repos/benchflow/experiments-manager/issues/28/comments","statuses_url":"https://api.github.com/repos/benchflow/experiments-manager/statuses/bb70ef44776f3707c9f0cfc1b2db369ad7a7c32b","head":{"label":"simonedavico:api-v2","ref":"api-v2","sha":"bb70ef44776f3707c9f0cfc1b2db369ad7a7c32b","user":{"login":"simonedavico","id":4446853,"avatar_url":"https://avatars.githubusercontent.com/u/4446853?v=3","gravatar_id":"","url":"https://api.github.com/users/simonedavico","html_url":"https://github.com/simonedavico","followers_url":"https://api.github.com/users/simonedavico/followers","following_url":"https://api.github.com/users/simonedavico/following{/other_user}","gists_url":"https://api.github.com/users/simonedavico/gists{/gist_id}","starred_url":"https://api.github.com/users/simonedavico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonedavico/subscriptions","organizations_url":"https://api.github.com/users/simonedavico/orgs","repos_url":"https://api.github.com/users/simonedavico/repos","events_url":"https://api.github.com/users/simonedavico/events{/privacy}","received_events_url":"https://api.github.com/users/simonedavico/received_events","type":"User","site_admin":false},"repo":{"id":44680939,"name":"experiments-manager","full_name":"simonedavico/experiments-manager","owner":{"login":"simonedavico","id":4446853,"avatar_url":"https://avatars.githubusercontent.com/u/4446853?v=3","gravatar_id":"","url":"https://api.github.com/users/simonedavico","html_url":"https://github.com/simonedavico","followers_url":"https://api.github.com/users/simonedavico/followers","following_url":"https://api.github.com/users/simonedavico/following{/other_user}","gists_url":"https://api.github.com/users/simonedavico/gists{/gist_id}","starred_url":"https://api.github.com/users/simonedavico/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/simonedavico/subscriptions","organizations_url":"https://api.github.com/users/simonedavico/orgs","repos_url":"https://api.github.com/users/simonedavico/repos","events_url":"https://api.github.com/users/simonedavico/events{/privacy}","received_events_url":"https://api.github.com/users/simonedavico/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/simonedavico/experiments-manager","description":"Manages the experiments lifecycle","fork":true,"url":"https://api.github.com/repos/simonedavico/experiments-manager","forks_url":"https://api.github.com/repos/simonedavico/experiments-manager/forks","keys_url":"https://api.github.com/repos/simonedavico/experiments-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/simonedavico/experiments-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/simonedavico/experiments-manager/teams","hooks_url":"https://api.github.com/repos/simonedavico/experiments-manager/hooks","issue_events_url":"https://api.github.com/repos/simonedavico/experiments-manager/issues/events{/number}","events_url":"https://api.github.com/repos/simonedavico/experiments-manager/events","assignees_url":"https://api.github.com/repos/simonedavico/experiments-manager/assignees{/user}","branches_url":"https://api.github.com/repos/simonedavico/experiments-manager/branches{/branch}","tags_url":"https://api.github.com/repos/simonedavico/experiments-manager/tags","blobs_url":"https://api.github.com/repos/simonedavico/experiments-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/simonedavico/experiments-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/simonedavico/experiments-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/simonedavico/experiments-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/simonedavico/experiments-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/simonedavico/experiments-manager/languages","stargazers_url":"https://api.github.com/repos/simonedavico/experiments-manager/stargazers","contributors_url":"https://api.github.com/repos/simonedavico/experiments-manager/contributors","subscribers_url":"https://api.github.com/repos/simonedavico/experiments-manager/subscribers","subscription_url":"https://api.github.com/repos/simonedavico/experiments-manager/subscription","commits_url":"https://api.github.com/repos/simonedavico/experiments-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/simonedavico/experiments-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/simonedavico/experiments-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/simonedavico/experiments-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/simonedavico/experiments-manager/contents/{+path}","compare_url":"https://api.github.com/repos/simonedavico/experiments-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/simonedavico/experiments-manager/merges","archive_url":"https://api.github.com/repos/simonedavico/experiments-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/simonedavico/experiments-manager/downloads","issues_url":"https://api.github.com/repos/simonedavico/experiments-manager/issues{/number}","pulls_url":"https://api.github.com/repos/simonedavico/experiments-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/simonedavico/experiments-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/simonedavico/experiments-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/simonedavico/experiments-manager/labels{/name}","releases_url":"https://api.github.com/repos/simonedavico/experiments-manager/releases{/id}","deployments_url":"https://api.github.com/repos/simonedavico/experiments-manager/deployments","created_at":"2015-10-21T14:14:47Z","updated_at":"2016-01-11T10:25:02Z","pushed_at":"2016-03-23T18:37:25Z","git_url":"git://github.com/simonedavico/experiments-manager.git","ssh_url":"git@github.com:simonedavico/experiments-manager.git","clone_url":"https://github.com/simonedavico/experiments-manager.git","svn_url":"https://github.com/simonedavico/experiments-manager","homepage":null,"size":128,"stargazers_count":0,"watchers_count":0,"language":"Java","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":"dev"}},"base":{"label":"benchflow:dev","ref":"dev","sha":"4d19caaac03013e0e4b6675b26fbf8323e03381c","user":{"login":"benchflow","id":11681613,"avatar_url":"https://avatars.githubusercontent.com/u/11681613?v=3","gravatar_id":"","url":"https://api.github.com/users/benchflow","html_url":"https://github.com/benchflow","followers_url":"https://api.github.com/users/benchflow/followers","following_url":"https://api.github.com/users/benchflow/following{/other_user}","gists_url":"https://api.github.com/users/benchflow/gists{/gist_id}","starred_url":"https://api.github.com/users/benchflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benchflow/subscriptions","organizations_url":"https://api.github.com/users/benchflow/orgs","repos_url":"https://api.github.com/users/benchflow/repos","events_url":"https://api.github.com/users/benchflow/events{/privacy}","received_events_url":"https://api.github.com/users/benchflow/received_events","type":"Organization","site_admin":false},"repo":{"id":44520127,"name":"experiments-manager","full_name":"benchflow/experiments-manager","owner":{"login":"benchflow","id":11681613,"avatar_url":"https://avatars.githubusercontent.com/u/11681613?v=3","gravatar_id":"","url":"https://api.github.com/users/benchflow","html_url":"https://github.com/benchflow","followers_url":"https://api.github.com/users/benchflow/followers","following_url":"https://api.github.com/users/benchflow/following{/other_user}","gists_url":"https://api.github.com/users/benchflow/gists{/gist_id}","starred_url":"https://api.github.com/users/benchflow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/benchflow/subscriptions","organizations_url":"https://api.github.com/users/benchflow/orgs","repos_url":"https://api.github.com/users/benchflow/repos","events_url":"https://api.github.com/users/benchflow/events{/privacy}","received_events_url":"https://api.github.com/users/benchflow/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/benchflow/experiments-manager","description":"Manages the experiments lifecycle","fork":false,"url":"https://api.github.com/repos/benchflow/experiments-manager","forks_url":"https://api.github.com/repos/benchflow/experiments-manager/forks","keys_url":"https://api.github.com/repos/benchflow/experiments-manager/keys{/key_id}","collaborators_url":"https://api.github.com/repos/benchflow/experiments-manager/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/benchflow/experiments-manager/teams","hooks_url":"https://api.github.com/repos/benchflow/experiments-manager/hooks","issue_events_url":"https://api.github.com/repos/benchflow/experiments-manager/issues/events{/number}","events_url":"https://api.github.com/repos/benchflow/experiments-manager/events","assignees_url":"https://api.github.com/repos/benchflow/experiments-manager/assignees{/user}","branches_url":"https://api.github.com/repos/benchflow/experiments-manager/branches{/branch}","tags_url":"https://api.github.com/repos/benchflow/experiments-manager/tags","blobs_url":"https://api.github.com/repos/benchflow/experiments-manager/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/benchflow/experiments-manager/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/benchflow/experiments-manager/git/refs{/sha}","trees_url":"https://api.github.com/repos/benchflow/experiments-manager/git/trees{/sha}","statuses_url":"https://api.github.com/repos/benchflow/experiments-manager/statuses/{sha}","languages_url":"https://api.github.com/repos/benchflow/experiments-manager/languages","stargazers_url":"https://api.github.com/repos/benchflow/experiments-manager/stargazers","contributors_url":"https://api.github.com/repos/benchflow/experiments-manager/contributors","subscribers_url":"https://api.github.com/repos/benchflow/experiments-manager/subscribers","subscription_url":"https://api.github.com/repos/benchflow/experiments-manager/subscription","commits_url":"https://api.github.com/repos/benchflow/experiments-manager/commits{/sha}","git_commits_url":"https://api.github.com/repos/benchflow/experiments-manager/git/commits{/sha}","comments_url":"https://api.github.com/repos/benchflow/experiments-manager/comments{/number}","issue_comment_url":"https://api.github.com/repos/benchflow/experiments-manager/issues/comments{/number}","contents_url":"https://api.github.com/repos/benchflow/experiments-manager/contents/{+path}","compare_url":"https://api.github.com/repos/benchflow/experiments-manager/compare/{base}...{head}","merges_url":"https://api.github.com/repos/benchflow/experiments-manager/merges","archive_url":"https://api.github.com/repos/benchflow/experiments-manager/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/benchflow/experiments-manager/downloads","issues_url":"https://api.github.com/repos/benchflow/experiments-manager/issues{/number}","pulls_url":"https://api.github.com/repos/benchflow/experiments-manager/pulls{/number}","milestones_url":"https://api.github.com/repos/benchflow/experiments-manager/milestones{/number}","notifications_url":"https://api.github.com/repos/benchflow/experiments-manager/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/benchflow/experiments-manager/labels{/name}","releases_url":"https://api.github.com/repos/benchflow/experiments-manager/releases{/id}","deployments_url":"https://api.github.com/repos/benchflow/experiments-manager/deployments","created_at":"2015-10-19T08:11:59Z","updated_at":"2016-01-11T11:33:45Z","pushed_at":"2016-03-23T18:44:26Z","git_url":"git://github.com/benchflow/experiments-manager.git","ssh_url":"git@github.com:benchflow/experiments-manager.git","clone_url":"https://github.com/benchflow/experiments-manager.git","svn_url":"https://github.com/benchflow/experiments-manager","homepage":null,"size":102,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":9,"forks":1,"open_issues":9,"watchers":0,"default_branch":"dev"}},"_links":{"self":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28"},"html":{"href":"https://github.com/benchflow/experiments-manager/pull/28"},"issue":{"href":"https://api.github.com/repos/benchflow/experiments-manager/issues/28"},"comments":{"href":"https://api.github.com/repos/benchflow/experiments-manager/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/benchflow/experiments-manager/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/benchflow/experiments-manager/statuses/bb70ef44776f3707c9f0cfc1b2db369ad7a7c32b"}}}}