Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Fuse Service Works on Docker

Fuse Service Works on Docker

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.

Kenneth Peeples

August 28, 2014
Tweet

More Decks by Kenneth Peeples

Other Decks in Technology

Transcript

  1. 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.
  2. 6 RED HAT A service design, development and integration platform

    that enables organizations to transition to open hybrid cloud
  3. 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
  4. 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
  5. 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
  6. 10 RED HAT Docker with Red Hat JBoss Products and

    Projects JBoss.org Docker Microsite JBoss Dockerfiles repository
  7. 12 RED HAT What is Docker  Docker Engine –

    Open Source Container Management  Docker Hub – Online home and hub for managing Docker Containers
  8. 13 RED HAT • Lightweight • Portable • Self-sufficient •

    Developers – Build Once, Run AnywherePortable • DevOps – Configure Once, Run Anything The Code Shipping Container
  9. 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
  10. 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
  11. 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.
  12. 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
  13. 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.
  14. 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
  15. 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??
  16. 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:
  17. 24 RED HAT Examining commands now lets see what the

    container is doing by looking at the logs for the container with docker logs <container_id>. Then lets attach to the container and see the results in realtime with docker attach <container_id>. Then let’s stop it with docker stop <container_id> and show the container list with docker ps. We can also inspect the container to get the IPAddress with docker inspect <container_id>
  18. 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
  19. 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)
  20. 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
  21. 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.
  22. 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.
  23. 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 .
  24. 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://<dockerd host ip>:9000
  25. 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
  26. 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