{"action":"created","issue":{"url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/531","repository_url":"https://api.github.com/repos/fabric8io/docker-maven-plugin","labels_url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/531/labels{/name}","comments_url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/531/comments","events_url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/531/events","html_url":"https://github.com/fabric8io/docker-maven-plugin/pull/531","id":168495514,"number":531,"title":"- parallel StartMojo","user":{"login":"danielwegener","id":2953619,"avatar_url":"https://avatars.githubusercontent.com/u/2953619?v=3","gravatar_id":"","url":"https://api.github.com/users/danielwegener","html_url":"https://github.com/danielwegener","followers_url":"https://api.github.com/users/danielwegener/followers","following_url":"https://api.github.com/users/danielwegener/following{/other_user}","gists_url":"https://api.github.com/users/danielwegener/gists{/gist_id}","starred_url":"https://api.github.com/users/danielwegener/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/danielwegener/subscriptions","organizations_url":"https://api.github.com/users/danielwegener/orgs","repos_url":"https://api.github.com/users/danielwegener/repos","events_url":"https://api.github.com/users/danielwegener/events{/privacy}","received_events_url":"https://api.github.com/users/danielwegener/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-07-31T01:07:31Z","updated_at":"2016-08-03T15:17:38Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/pulls/531","html_url":"https://github.com/fabric8io/docker-maven-plugin/pull/531","diff_url":"https://github.com/fabric8io/docker-maven-plugin/pull/531.diff","patch_url":"https://github.com/fabric8io/docker-maven-plugin/pull/531.patch"},"body":"that respects dependencies and starts all containers in parallel as soon as all dependencies are resolved. This can greatly improve startup time if the waits that you use are mostly io- or sleep related.\r\n\r\nMy current use-case: Starting 5-8 different applications on tomcats and wait until each of them is fully operational and ready for e2e tests (including hazelcast cluster convergence and JPA h2 initialization).\r\n\r\nThis feature reduced my regular startup-time from ~5:00 minutes to 1:23.\r\n\r\nThis is a POC that adds an `ExecutionService` and `ExecutorCompletionService` to the `StartMojo`. The nonParallel configuration simply falls back to a guava SameThreadExecutionService.\r\n\r\nThe Parallel start is configurable (`docker.startParallel`, disabled by default).\r\n\r\nThis PR adds another imageRunConfiguration property `dependsOn` (naming from docker-compose) which is the link-equivalent to express inter container dependencies in docker custom networks (it delays the start of a container until all of its dependent containers are started (inclusive wait)). \r\n\r\nThere might be some concurrency bugs lurking around (I saw that most of the DockerAccess state is synchronized). Especially the ordered shutdown is a bit tricky (especially it would be great if we could shutdown the executor by not starting new tasks but also not stopping tasks that are running).\r\n\r\nI am open for feedback :)\r\n"},"comment":{"url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/comments/237269094","html_url":"https://github.com/fabric8io/docker-maven-plugin/pull/531#issuecomment-237269094","issue_url":"https://api.github.com/repos/fabric8io/docker-maven-plugin/issues/531","id":237269094,"user":{"login":"rhuss","id":99080,"avatar_url":"https://avatars.githubusercontent.com/u/99080?v=3","gravatar_id":"","url":"https://api.github.com/users/rhuss","html_url":"https://github.com/rhuss","followers_url":"https://api.github.com/users/rhuss/followers","following_url":"https://api.github.com/users/rhuss/following{/other_user}","gists_url":"https://api.github.com/users/rhuss/gists{/gist_id}","starred_url":"https://api.github.com/users/rhuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rhuss/subscriptions","organizations_url":"https://api.github.com/users/rhuss/orgs","repos_url":"https://api.github.com/users/rhuss/repos","events_url":"https://api.github.com/users/rhuss/events{/privacy}","received_events_url":"https://api.github.com/users/rhuss/received_events","type":"User","site_admin":false},"created_at":"2016-08-03T15:17:38Z","updated_at":"2016-08-03T15:17:38Z","body":"I just had the chance for a quick review, looks great ! And even if there are issues with the Unix socket (and soon to come, Windos named pipes, too), we could document that parallel execution is only supported for TCP connections.\r\n\r\nSome things still which I'd need:\r\n\r\n* Could you please sign-off your commit as described in https://github.com/fabric8io/docker-maven-plugin/blob/master/doc/contributing.md . Feel free to rebase or squash the commits, too.\r\n* Documentation would be awesome, too. This would go into https://github.com/fabric8io/docker-maven-plugin/blob/master/src/main/asciidoc/inc/start/_configuration.adoc for `dependsOn` and `https://github.com/fabric8io/docker-maven-plugin/blob/master/src/main/asciidoc/inc/start/_overview.adoc` for `docker.startParallel`\r\n* I know, its hard, but tests would be awesome ! Maybe one could extract the starting functionality into an external class which can be easier unit tested than the whole StartMojo. Also, it would make the Mojo smaller as these beasts tend to grow all the time ;-)\r\n\r\nBTW, I wonder whether this would make sense for building images, too ? well, probably not so much as one does not has many images to build anyway.\r\n\r\nThanks again, will add your contribution in the overnext release (since I have to cut a release right now)."}}
{"actor":{"display_login":"rhuss"}}