Skip to content

Commit ed1b41b

Browse files
committed
Adding first swarm parts
1 parent e2df25c commit ed1b41b

2 files changed

Lines changed: 36 additions & 1 deletion

File tree

images/swarm1.png

96.7 KB
Loading

readme.adoc

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,13 +528,48 @@ TODO: Pick, which parts we want to describe in more detail from here: https://go
528528
529529
530530
## Test Java EE Applications on Docker
531+
Testing Java EE applications is a very important aspect. Especially when it comes to in-container tests, link:http://www.arquillian.org[JBoss Arquillian] is well known to make this very easy.
532+
Picking up where unit tests leave off, Arquillian handles all the plumbing of container management, deployment and framework initialization so you can focus on the task at hand, writing your tests. Real tests.
533+
534+
Arquillian brings the test to the runtime so you don’t have to manage the runtime from the test (or the build). Arquillian eliminates this burden by covering all aspects of test execution, which entails:
535+
536+
. Managing the lifecycle of the container (or containers)
537+
. Bundling the test case, dependent classes and resources into a ShrinkWrap archive (or archives)
538+
. Deploying the archive (or archives) to the container (or containers)
539+
. Enriching the test case by providing dependency injection and other declarative services
540+
. Executing the tests inside (or against) the container
541+
. Capturing the results and returning them to the test runner for reporting
542+
. To avoid introducing unnecessary complexity into the developer’s build environment, Arquillian integrates seamlessly with familiar testing frameworks (e.g., JUnit 4, TestNG 5), allowing tests to be launched using existing IDE, Ant and Maven test plugins — without any add-ons.
543+
544+
Basically, you can just use Arquillian with the link:http://arquillian.org/modules/wildfly-arquillian-wildfly-remote-container-adapter/[WildFly Remote container adapter] and connect to any WildFly instance running in a Docker container. But this wouldn't help with the Docker container lifycycle management.
545+
This is where a new Arquillian extension, named link:http://arquillian.org/blog/2014/11/17/arquillian-cube-1-0-0-Alpha1/["Cube"] comes in.
546+
With this extension you can start a Docker container with a server installed, deploy the required deployable file within it and execute Arquillian tests.
547+
548+
The key point here is that if Docker is used as deployable platform in production, your tests are executed in a the same container as it will be in production, so your tests are even more real than before.
549+
550+
TODO: Finalize the Cubification of Ticket Monster and describe it.
531551
532552
http://blog.arungupta.me/run-javaee-tests-wildfly-docker-arquillian-cube/
533553
534554
535555
## Cluster using Swarm
556+
One of the key updates as part of Docker 1.6 is Docker Swarm 0.2.0. Docker Swarm solves one of the fundamental limitations of Docker where the containers could only run on a single Docker host. Docker Swarm is native clustering for Docker. It turns a pool of Docker hosts into a single, virtual host.
557+
558+
.Key Components of Docker Swarm
559+
image::images/swarm1.png[]
560+
561+
**Swarm Manager:** Docker Swarm has a Master or Manager, that is a pre-defined Docker Host, and is a single point for all administration. Currently only a single instance of manager is allowed in the cluster. This is a SPOF for high availability architectures and additional managers will be allowed in a future version of Swarm with #598.
562+
563+
**Swarm Nodes:** The containers are deployed on Nodes that are additional Docker Hosts. Each Swarm Node must be accessible by the manager, each node must listen to the same network interface (TCP port). Each node runs a node agent that registers the referenced Docker daemon, monitors it, and updates the discovery backend with the node’s status. The containers run on a node.
564+
565+
**Scheduler Strategy:** Different scheduler strategies (binpack, spread, and random) can be applied to pick the best node to run your container. The default strategy is spread which optimizes the node for least number of running containers. There are multiple kinds of filters, such as constraints and affinity. This should allow for a decent scheduling algorithm.
566+
567+
**Node Discovery Service:** By default, Swarm uses hosted discovery service, based on Docker Hub, using tokens to discover nodes that are part of a cluster. However etcd, consul, and zookeeper can be also be used for service discovery as well. This is particularly useful if there is no access to Internet, or you are running the setup in a closed network. A new discovery backend can be created as explained here. It would be useful to have the hosted Discovery Service inside the firewall and #660 will discuss this.
568+
569+
**Standard Docker API:** Docker Swarm serves the standard Docker API and thus any tool that talks to a single Docker host will seamlessly scale to multiple hosts now. That means if you were using shell scripts using Docker CLI to configure multiple Docker hosts, the same CLI would can now talk to Swarm cluster and Docker Swarm will then act as proxy and run it on the cluster.
570+
571+
There are lots of other concepts but these are the main ones.
536572
537-
We don't setup Kubernetes on Windows yet (might be an option to use jube someday)
538573
539574
. https://github.com/rafabene/devops-demo
540575
. Docker Swarm: http://blog.arungupta.me/clustering-docker-swarm-techtip85/

0 commit comments

Comments
 (0)