Slide 1

Slide 1 text

Using JBoss FuseService Works with Docker Kenneth Peeples JBoss Technology Evangelist

Slide 2

Slide 2 text

2 RED HAT Abstract Red Hat JBoss Fuse Service Works is Red Hat’s middleware solution for application integration, messaging, SOA, and service governance requirements. It combines multiple technologies from the middleware portfolio. Camel, CXF and ActiveMQ comprise the core ESB technology, SwitchYard provides the lightweight service development framework, and Overlord provides the design-time and run-time governance. In this talk, we’ll walk you through the Red Hat Fuse Service Works home-loan application running on Docker. This application processes a home-loan application through the system to arrive at a decision. The application uses multiple technologies, including Camel, business processes, and rules. This will provide an opportunity for some hands-on work and to learn how to: • Run the Dockerfile to build the Docker image • Start and interact with the container • Run the Switchyard application • Review the SwitchYard application and the components including Camel, business processes, and rules in the application.

Slide 3

Slide 3 text

OVERVIEW OF FUSE SERVICE WORKS

Slide 4

Slide 4 text

4 RED HAT Red Hat JBoss Integration Product Line

Slide 5

Slide 5 text

5 RED HAT JBoss Middleware – Multiple Connectivity Options

Slide 6

Slide 6 text

6 RED HAT A service design, development and integration platform that enables organizations to transition to open hybrid cloud

Slide 7

Slide 7 text

7 RED HAT • Lightweight, SCA-based, structured • service development framework • Design, code, test at higher service • abstraction • Store and reuse business services - shared repository • Easily call BPMN based BPM processes • Visual Tooling: Model is the application Switchyard

Slide 8

Slide 8 text

8 RED HAT Overlord Design Time Governance • Service component and artifact registry (S-RAMP) • Store, share services/policies across teams • Team Notifications on content changes • Track and Visualize artifact relationships • Impact Discovery & Analysis • Web and CLI tools to simplify search and reporting

Slide 9

Slide 9 text

9 RED HAT Overlord Run Time Governance Grow service quality SLA enforcement, alerting and real-time transaction monitoring Realize IT Agility Independently manage SLA and runtime policy from service definition. Increase operational visibility Identify precisely where,why and how transactions are delayed by track SLA violations Understand and measure operational efficiency Long term storage of operational data to support analysis & optimization

Slide 10

Slide 10 text

10 RED HAT Docker with Red Hat JBoss Products and Projects JBoss.org Docker Microsite JBoss Dockerfiles repository

Slide 11

Slide 11 text

OVERVIEW OF DOCKER

Slide 12

Slide 12 text

12 RED HAT What is Docker  Docker Engine – Open Source Container Management  Docker Hub – Online home and hub for managing Docker Containers

Slide 13

Slide 13 text

13 RED HAT • Lightweight • Portable • Self-sufficient • Developers – Build Once, Run AnywherePortable • DevOps – Configure Once, Run Anything The Code Shipping Container

Slide 14

Slide 14 text

14 RED HAT Container vs VM

Slide 15

Slide 15 text

15 RED HAT Physical Containers Docker Content Agnostic The same container can hold almost any kind of cargo Can encapsulate any payload and its dependencies Hardware Agnostic Standard shape and interface allow same container to move from ship to train to semi-truck to warehouse to crane without being modified or opened Using operating system primitives (e.g. LXC) can run consistently on virtually any hardware - VMs, bare metal, openstack, public IAAS, etc. - without modification Content Isolation and Interaction No worry about anvils crushing bananas. Containers can be stacked and shipped together Resource, network, and content isolation. Avoids dependency hell Automation Standard interfaces make it easy to automate loading, unloading, moving, etc. Standard operations to run, start, stop, commit, search, etc. Perfect for devops: CI, CD, autoscaling, hybrid clouds Highly efficient No opening or modification, quick to move between waypoints Lightweight, virtually no perf or start-up penalty, quick to move and manipulate Separation of duties Shipper worries about inside of box, carrier worries about outside of box Developer worries about code, Ops worries about infrastructure. Features of Docker compared to shipping containers

Slide 16

Slide 16 text

16 RED HAT Docker Container Lifecycle (Functions) Conception  BUILD an image from a Dockerfile Birth  RUN (create+start) a container Reproduction  COMMIT (persist) a container to a new image  RUN a new container from an image Sleep  KILL a running container Wake  START a stopped container Death  RM (delete) a stop container Extinction  RMI a container image (delete) http://docs.docker.com/commandline/ • Create • Manage • Deploy code

Slide 17

Slide 17 text

17 RED HAT Terminology Image - An image is a read only layer used to build a container. They do not change. Container - Is basically a self contained runtime environment that is built using one or more images. You can commit your changes to a container and create an image. Index/Registry - These are public or private servers where people can upload their repositories so they can easily share what they made. Repository - A repository is a group of images located in the docker registry. So what's the difference between Containers and Images? • Containers represent an encapsulated set of processes based on an image. • You spawn them with the docker run command. • Images are like templates or stencils that you can create containers from.

Slide 18

Slide 18 text

18 RED HAT Image Namespaces There are three namespaces: • Root-like centos • User training/docker-fundamentals-image • Self-Hosted registry.example.com:5000/my-private-image

Slide 19

Slide 19 text

19 RED HAT Docker Architecture Docker is a client-server application. The Docker daemon • The Docker server. • Receives and processes incoming Docker API requests. The Docker client • Command line tool - the docker binary. • Talks to the Docker daemon via the Docker API. Docker Hub Registry • Public image registry. • The Docker daemon talks to it via the registry API.

Slide 20

Slide 20 text

20 RED HAT

Slide 21

Slide 21 text

21 RED HAT Getting Started Step 1: Install Docker - https://docs.docker.com/installation/#installation Step 2: Start Daemon with sudo service docker start Step 3: Verify docker with docker info or docker version Note: if you get an error with /var/ru/docker.sock run chmod a+rw /var/run/docker.sock

Slide 22

Slide 22 text

22 RED HAT First Example #run a simple echo command, that will echo hello world back to the console over standard out. $ docker run base /bin/echo hello world hello world 1.Generated a new container 2.Created a new file system 3.Mounted a read/write layer 4.Allocated network interface 5.Setup IP 6. Setup NATing 7. Executed the process in the container 8. Captured it's output 9. Printed to screen 10.Stopped the container What did Docker do??

Slide 23

Slide 23 text

23 RED HAT Examining commands #list images $ docker images If we want to see the container we just ran we can run the docker ps command. Since it isn't running anymore we need to use the -a flag to show us all of the image: Lets do something a little more complicated. We are going to do the same thing, but instead of having the container exit right after we start, we want it to keep running in the background, and print hello world every second:

Slide 24

Slide 24 text

24 RED HAT Examining commands now lets see what the container is doing by looking at the logs for the container with docker logs . Then lets attach to the container and see the results in realtime with docker attach . Then let’s stop it with docker stop and show the container list with docker ps. We can also inspect the container to get the IPAddress with docker inspect

Slide 25

Slide 25 text

25 RED HAT Downloading Images We downloaded on root image with base. Two type of download can be done: • Implicit, for example docker run busybox • Explicit, for example docker pull ubuntu

Slide 26

Slide 26 text

26 RED HAT Starting Over #stop all containers docker stop $(docker ps -a -q) #delete all containers docker rm $(docker ps -a -q) # Delete all images docker rmi $(docker images -q)

Slide 27

Slide 27 text

27 RED HAT Having a Docker Hub account will allow us to store our images in the registry. To sign up, you'll go to hub.docker.com and fill out the form. Our credentials are stored in ~/.dockercfg

Slide 28

Slide 28 text

FUSE SERVICE WORKS AND DOCKER

Slide 29

Slide 29 text

29 RED HAT Dockerfile Usage • Dockerfile instructions are executed in order. • Each instruction creates a new layer in the image. • Instructions are cached. If no changes are detected then the instruction is • skipped and the cached layer used. • The FROM instruction MUST be the first non-comment instruction. • Lines starting with # are treated as comments. • You can only have one CMD and one ENTRYPOINT instruction in a • Dockerfile.

Slide 30

Slide 30 text

30 RED HAT Our Dockerfile We will use with our base image for Fuse Service Works - https://github.com/JBoss-Dockerfiles/FSW600Base Prerequisites: • Install Docker • Download JBoss Fuse Service Works from jboss.org. • Put the downloaded file into software Some build command highlights: • FROM specifies a source image for our new image. It's mandatory. • MAINTAINER tells us who maintains this image. • Each RUN instruction executes a command to build our image. • CMD defines the default command to run when a container is launched from this image. • EXPOSE lists the network ports to open when a container is launched from this image.

Slide 31

Slide 31 text

31 RED HAT Working with the image To spin up a shell in the JBoss Fuse Service Works containers try: $ docker run -P -i -t kpeeples/jbossfsw600 /bin/bash You can then noodle around the container and run stuff & look at files etc. The /home/jboss/run.sh sript can be used to start JBoss Fuse Service Works 6.0.0.GA. Then you can run the container: $ docker run -P -d -t kpeeples/jbossfsw600 This will run the jbossfsw600 container and starts automatically JBoss FSW. You can then run docker attach $containerID or docker logs -f $containerID to get the logs at any time. Run docker ps to see all the running containers or docker inspect $containerID to view the IP address and details of a container. Build the Fuse Service Works image: $ docker build -t kpeeples/jbossfsw600 .

Slide 32

Slide 32 text

32 RED HAT Dockerui Step 1: docker build -t crosbymichael/dockerui github.com/crosbymichael/dockerui Step 2: docker run -d -p 9000:9000 -v /var/run/docker.sock:/docker.sock crosbymichael/dockerui -e /docker.sock Step 3: Open your browser to http://:9000

Slide 33

Slide 33 text

33 RED HAT Home Loan Application https://github.com/jboss-switchyard/learning/tree/master/summit2014 Lab 1: Build Switchyard Application. The Home Loan Application in the final jar is deployed to the container. • Get familiar with the development environment • Application design and implementation • Hands on experience with important SwitchYard principles Step 0 : Getting Started Step 1 : Component Service Step 2 : Component Reference Step 3 : Camel Routing Step 4 : Reference Binding Step 5 : Transformation Step 6 : Service Binding Step 7 : RESTful status service

Slide 34

Slide 34 text

34 RED HAT Home Loan Application Continued Lab 2: Design Time Governance Gain experience with service governance workflows in Fuse Service Works • Become familiar with the Design-Time Governance and S-RAMP consoles • Manage a service through the dev, qa, stage, and production tasks • Learn Service Lifecycle Management principles Lab 3: Run Time Governance Gain experience with Runtime Governance capabilities in Fuse Service Works • Become familiar with Service Activity Monitoring and reporting • Become familiar with Policy Enforcement

Slide 35

Slide 35 text

REFERENCES

Slide 36

Slide 36 text

36 RED HAT  http://kencochrane.net/blog/2013/08/the-docker-guidebook  http://cdn.oreillystatic.com/en/assets/1/event/115/Introduction%20to%20Docker_%20Contai nerization%20is%20the%20New%20Virtualization%20Presentation.pdf  http://scm.zoomquiet.io/data/20131004215734/index.html