Saltar al contenido principal
April 3rd, 2019
Warsaw Group
All contents © MuleSoft Inc.
Our Partners
2
All contents © MuleSoft Inc.
Share
3
• Share the Meetup
• Use Hashtags
– #MuleMeetup
– #WarsawMuleMeetup
Agenda
All contents © MuleSoft Inc.
Agenda
5
6:00 PM Introductions
6:15 PM Dockerization & discussion
7:00 PM Break
7:25 PM Runtime Fabric
8:30 PM Closing the Meetup
8:40 PM Networking
Introduction
All contents © MuleSoft Inc.
Speaker
7
• Marek Wianecki
• Integration Developer since 2011 (PKO BP)
• Currently ESB Developer at IPF Digital
• Mule Developer for over 1 year nowMarek Wianecki
ESB Developer
All contents © MuleSoft Inc.
Organiser & Speaker
8
• Senior Integration Developer at PwC Poland
• MuleSoft Meetup Leader for Warsaw, Poland
• Recognized by MuleSoft as one of the top
contributors in the MuleSoft Community
• Mule blogger https://profit-online.pl/blog
• Doing Mule for over 7 years now
3 continents, 6 cities, 1000s of attendees
MuleSoft CONNECT 2019
All contents © MuleSoft Inc.
Atlanta
May 14 - 15, 2019
San Francisco
June 25 - 26, 2019
Sydney
September 3 - 4, 2019
Chicago
September 11 - 12, 2019
New York
September 17 - 18, 2019
London
October 9 - 10, 2019
All contents © MuleSoft Inc.
Meet the MuleSoft Community at CONNECT
11
• Community Booth in the MuleSoft Campground
– Meet the team behind the community
– Learn and engage with other users
– Brainstorm together in the whiteboard area
• Community Meetup on Day 1
– Learn with use cases and demos
– Meet top community contributors
– Network with peers
• Register at connect.mulesoft.com
Dockerizing Mule
Are You familiar with DOCKER ?
All contents © MuleSoft Inc.
Introduction
Mule dockerization
14
All contents © MuleSoft Inc.
Docker introduction
Mule dockerization
15
All contents © MuleSoft Inc.
Mule dockerization
16
Docker introduction
How can we use DOCKER?
Introduction
All contents © MuleSoft Inc.
Mule dockerization
18
Building base image
All contents © MuleSoft Inc.
Mule dockerization
19
Building base images Image to be
used as base
Environment
variables
available within
docker image
Content of
docker
image
FROM ubuntu:18.04
ENV IMAGE_VERSION=1.0.0
ENV PATH="${PATH}:/opt/jdk/jdk-8u201/bin"
ENV JAVA_OPTIONS='-Xmx2gb'
ENV LANG=en_US.UTF-8
ENV MULE_HOME=/opt/mule/mule-enterprise-standalone-3.9.2
COPY resources/jdk-8u201-linux-x64.tar.gz /opt/jdk/jdk-8u201/jdk-8u201-linux-x64.tar.gz
COPY resources/mule-ee-distribution-standalone-3.9.2.zip /opt/mule/mule-ee-distribution-standalone-3.9.2.zip
All contents © MuleSoft Inc.
Mule dockerization
20
Building base images
RUN tar -zxf /opt/jdk/jdk-8u201/jdk-8u201-linux-x64.tar.gz -C /opt/jdk/jdk-8u201 --strip-components=1 
&& rm -f /opt/jdk/jdk-8u201/jdk-8u201-linux-x64.tar.gz 
&& apt-get update 
&& apt-get install -y unzip 
&& apt-get install -y vim 
&& apt-get install -y apt-utils 
&& apt-get install -y locales 
&& locale-gen en_US.UTF-8 
&& rm -rf /var/lib/apt/lists/* 
&& unzip /opt/mule/mule-ee-distribution-standalone-3.9.2.zip -d /opt/mule 
&& rm -f /opt/mule/mule-ee-distribution-standalone-3.9.2.zip
CMD [ "/opt/mule/mule-enterprise-standalone-3.9.2/bin/mule" ]
Content of
docker image
Defaults for
executing
Docker
container
All contents © MuleSoft Inc.
Mule dockerization
21
Building base images
All contents © MuleSoft Inc.
Mule dockerization
22
All contents © MuleSoft Inc.
Mule dockerization
23
Docker layers
All contents © MuleSoft Inc.
Mule dockerization
24
Building images – old way
All contents © MuleSoft Inc.
Mule dockerization
25
Building images –
groups
All contents © MuleSoft Inc.
Mule dockerization
26
Building images
Lets try to dockerize mule
application 
All contents © MuleSoft Inc.
Simple app to „dokerize”
Mule dockerization
28
All contents © MuleSoft Inc.
Mule application dokerization
Mule dockerization
29
FROM meetup/mule
ADD resources/meetupproject-1.0.0.zip $MULE_HOME/apps/
EXPOSE 8081
CMD [ "/opt/mule/mule-enterprise-standalone-3.9.2/bin/mule" ]
Copy app to
Mule/app
folder
Using previously
build image
All contents © MuleSoft Inc.
Mule application dokerization
Mule dockerization
30
Questions?
31
All contents © MuleSoft Inc.
Mule dockerization
32
QUIZ - What is wrong with this idea of „base image” ? Why ?
a) Too BLUE
b) Nothing. This is perfect image
c) Old Ubuntu version
d) We need JDK
e) I see 3 base images 
f) We need mule app. This won’t
work
example
Build docker from mvn
33
Questions?
34
All contents © MuleSoft Inc.
Mule dockerization
35
What next ?
• if image won’t be changed often - add new
configuration layer or parametrize image
Configure mule application!
• if image content will be changed often – externalize
config/code
All contents © MuleSoft Inc.
Mule dockerization
36
What do We got? Pros
• Consistency - environment similar to final environment as possible (not
identical)
• Simple application delivery
• Decoupled MR applications
– Easy to scale up/down
– Easy application partitioning
– Quick aplication removal, migration
– Resources control
• Wide cloud support
• Whole image history – easy to version control
• ...
All contents © MuleSoft Inc.
Mule dockerization
37
What do We got? Cons
• Not bare metal
• Decoupled MR application - MR isolation
• Higher resources use – memory footprint
• Anypoint disconnected (?)
• Any other ?
All contents © MuleSoft Inc.
Mule dockerization
38
Next steps
• Image management / repository
• Load balancer / API Gateway
• Service Discovery
• Configuration Service
• Continous integration
• Deployment flow
• Monitoring
• Log management
• ...
Docker compose
39
All contents © MuleSoft Inc.
Mule dockerization
40
Docker compose
• Defines and runs multi-container docker applications
• Multiple isolated environments on a single host
Managing lifecycle
• Start, stop, and rebuild services
• View the status of running services
• Stream the log output of running service
• …
All contents © MuleSoft Inc.
Mule dockerization
41
Docker compose - configuration
version: '2'
services:
muleapp1:
image: meetup/muleapp:latest
ports:
- "8881:8081"
volumes:
- C:/meetup/logs/mule1:/opt/mule/mule-enterprise-standalone-3.9.2/logs
networks:
- meetup-net
environment:
- NODE_ID=1
- MULE_ENV=dev
- http.port=8081
All contents © MuleSoft Inc.
Mule dockerization
42
Docker compose - configuration
nginx:
image: nginx:latest
container_name: nginx
volumes:
- ./resources/9000.conf:/etc/nginx/conf.d/9000.conf
ports:
- "9000:9000"
- "80:80"
environment:
- NGINX_HOST=mulemeetup.pl
- NGINX_port=80
depends_on:
- "muleapp1"
links:
- muleapp1
- muleapp2
networks:
- meetup-net
All contents © MuleSoft Inc.
Mule dockerization
43
Docker compose - example
Kubernetes
44
All contents © MuleSoft Inc.
Mule dockerization
45
Kubernetes and so on
• Kubernetes
• Docker Swarm
• Apache Mesos
• ...
All contents © MuleSoft Inc.
Mule dockerization
46
MuleSoft FAQ
• Mule Runtime is supported in Docker
• MuleSoft support can only help with issues related to products built by MuleSoft
• MuleSoft does not provide general guidance for Mule Runtime on Docker
configurations
• MuleSoft does not distribute Docker images for Mule Runtime
All contents © MuleSoft Inc.
Mule dockerization
47
Licensing ?
Fooooood
Break & Networking
Overview
Runtime Fabric
All contents © MuleSoft Inc.
Runtime Fabric – what it is?
50
„Anypoint Runtime Fabric is a container service that automates the
deployment and orchestration of Mule applications and API gateways.
Runtime Fabric runs within a customer-managed infrastructure on
AWS, Azure, virtual machines (VMs), and bare-metal servers.”
MuleSoft documentation
All contents © MuleSoft Inc.
Runtime Fabric – capabilities
51
• Run multiple Mule Runtime versions alongside
• Applications isolations from each other
• Consistent deployment model for various cloud providers
• Vertical/Horizontal scaling
• Load Balancer included
• Zero downtime
All contents © MuleSoft Inc.
Runtime Fabric
52
• X servers hosting Mule applications
(here are 2)
• Runtime Fabric controlling it
• MuleSoft Control plane for managing
our environment
All contents © MuleSoft Inc.
Runtime Fabric achitecture
53
All contents © MuleSoft Inc.
Runtime Fabric architecture
54
• Workers
– At least 3 to at most 16
– Host Mule Runtime
• Controller
– At least 3 to at most 5
– Internal load balancer
– Manages the traffic
– Manages the workers
All contents © MuleSoft Inc.
Development environment
Architecture
55
• Minimalistic
Production environment
• Minimalistic
Set up
Runtime Fabric
All contents © MuleSoft Inc.
What are the options?
57
• We may set it up
– By using terraform script on AWS platform
– By using terraform script on Azure platform
– By doing it manually
All contents © MuleSoft Inc.
Terraform script
58
• Configure Runtime Fabric o Anypoint Platform
• Configure terraform script
– AWS credentials
– Mule standalone license
– Environment configuration like:
• Number of workers and controllers
• Instance types (CPU, memory)
All contents © MuleSoft Inc.
Installation
59
• How long does it take to configure environment?
„For standard developer environment, one controller and
to workers, can take up to 25 minutes”
So you may grab a cup of coffee and wait patiently.
All contents © MuleSoft Inc.
Installation
60
m4.large -> 2CPU + 8GiB
r4.large -> 2CPU + 15,25GiB
All contents © MuleSoft Inc.
OPS Center
61
• Installed on the controller
• In the 11th step you receive
credentials
• Enable to log in into VMs
• Access to logs
• Basic configuration
Demo
How to set the environment on AWS platform
Deployment
Runtime Fabric
All contents © MuleSoft Inc.
New application
64
• Different view than for CloudHub application
• Configuration
– Runtime version
– Number of replicas (workers)
– Resources
• vCPU
• Memory
All contents © MuleSoft Inc.
Additional configuration
65
• Enable inbound traffic (ingress)
– For HTTP listener component
– TLS Context needs to be configured
for Runtime Fabric
• Properties
– Key & value pairs
– Have precedens over values defined
in deployed application
All contents © MuleSoft Inc.
Where are app logs?
66
• Log in to your Ops Center
• Navigate to Kubernetes
• Select the environment (hashed value)
• From all the application choose the one you would like to see
• It will naviagate you to Logs section
Demo
Deploy new applications & see logs
All contents © MuleSoft Inc.
High Availability
Benefits?
68
• Load Balancer
• Cluster Mode
– Queues
– Object Store
• Resilance for errors
Zero downtime
Demo
High Availabiliy
Resources & Licensing
Runtime Fabric
All contents © MuleSoft Inc.
Licensing
71
• For Platinum und Titanium releases
• Number of vCPU available on Runtime
Fabric details page
• 0,07 vCPU is the minium you can assign
to application
• Memory depends from the AWS instance
type
All contents © MuleSoft Inc.
Startup time
vCPU
72
Response time
All contents © MuleSoft Inc.
Find mistakes
73
In the statement below you can find two mistakes. Name them.
We have enterprice MuleSoft license and standard Anypoint Platform
subscription. We have decided to use Anypoint Runtime Fabric to
deploy our applications. For our development environment we will use
following configuration:
• 2 controllers
• 2 workers.
It should ...
All contents © MuleSoft Inc.
Find mistakes solution
74
In the statement below you can find two mistakes. Name them.
We have enterprice MuleSoft license and standard platium or
titanium Anypoint Platform subscription. We have decided to use
Anypoint Runtime Fabric to deploy our applications. For our
development environment we will use following configuration:
• 2 controllers 1 or 3 or 5 controllers.
• 2 workers.
It should ...
Materials
Runtime Fabric
All contents © MuleSoft Inc.
Where to learn more?
76
• Anypoint Platform Operations: Runtime Fabric training
– https://training.mulesoft.com/instructor-led-training/apops-rtf
– 2 days in-person or online
• MuleSoft Documentation:
– https://docs.mulesoft.com/runtime-fabric/1.2/
• Blog
– https://profit-online.pl/blog
– https://profit-online.pl/category/anypoint-platform/runtime-fabric/
• 4 posts are about to come
Questions?
77
What’s next
All contents © MuleSoft Inc.
What’s next
79
• Feedback:
– Contact your organizer Patryk Bandurski via e-mail or LinkedIn profile to suggest
topics
– Contact MuleSoft at meetup@mulesoft.com for ways to improve the program
• Our next meetup:
– Date: June/July 2019
– Location: PwC Poland
– Topic: Mule SDK – custom connectors???
All contents © MuleSoft Inc.
What’s next
80
Invite your network to join
– https://meetups.mulesoft.com/warsaw/
See you next time
Time to do a photo!
Warsaw MuleSoft Meetup - Runtime Fabric