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

Porting of an enterprise OSGi application to a ...

Porting of an enterprise OSGi application to a PaaS

This presentation show how to port an (enterprise OSGi) application to a platform-as-a-service-like infrastructure using Docker.

Thomas Uhrig

July 23, 2014
Tweet

More Decks by Thomas Uhrig

Other Decks in Programming

Transcript

  1. Agenda Cloud computing ………………………………………………………………………….. 3 Our goals ………………………………………………………………………….. 8 Containers

    as a platform ………………………………………………………………………….. 10 Deploying on AWS ………………………………………………………………………….. 18 Tooling ………………………………………………………………………….. 21 Demo ………………………………………………………………………….. 24 Conclusion ………………………………………………………………………….. 26 References ………………………………………………………………………….. 28 Slide 02/32
  2. Abstraction Cloud computing is all about abstraction and services! ❖

    Traditional resources become services (e.g. CPU or Storage). ❖ Services are on-demand, scalable and isolated. ❖ A set of services makes up a cloud offer. ❖ Different services target different problem domains and users. Abstraction Service Resources Slide 04/32
  3. Example IT and DevOps Developer Customers Slide 05/32 Virtual machines

    as a Service Application server as a Service Customer relations as a Service
  4. Levels Infrastructure as a Service Platform as a Service Software

    as a Service VMs Applications Containers Runtimes Environments Services Sandboxes ❖ PaaS is the most diverse layer. ❖ Vendors try to outstand in the market by unique concepts. ❖ However, there is no OSGi-as-a-Service! Slide 06/32
  5. Levels Compute Communicate Software Defined Networks Routing Infrastructure PaaS Applications

    Hardware Virtual Machines Application Containers Application PaaS Model driven platforms Compute App Services Software Defined Storage Object storage Database PaaS Store App Services IaaS Foundational PaaS PaaS SaaS Model driven App Services Infrastructure Engineers DevOps Developers End-users Business Engineers Developers 1 2 3 6 4 5 Communicate App Services ___________________________________________________________________________ Reference: Simplified cloud model according to Johan Den Haan at goo.gl/jexFPB Store Slide 07/32
  6. Goals ❖ A deployment strategy which is easy, automated, repeatable

    and generic. ❖ A PaaS or PaaS-like infrastructure. ❖ Usage of cloud services. Which platform? Which deployment? Informatica PIM Slide 09/32
  7. Containers ❖ A method to package and transport code ❖

    Package heterogeneous applications into a generic format ❖ A platform and environment for applications (an ideal OS) ❖ Raise the abstraction layer (an abstract OS) WAR-files Docker CDs OSGi framework a platform portable self-contained Slide 11/32
  8. Containers ❖ Reliable deployment in different environments (local machines, VMs

    or clouds) ❖ High performance and lightweight ❖ Loose decoupling and isolation of systems ❖ Basic building blocks for application stacks (see demo!) Slide 12/32 WAR-files Docker CDs OSGi framework a platform portable self-contained
  9. Docker ❖ An application container for Linux. ❖ Packages applications

    with all dependencies into a portable format. ❖ Open source under an Apache license (v2) and available on GitHub. ❖ Makes use of existing Linux tools for isolation. ❖ Nearly native performance. Docker Build System Container API Repository Slide 13/32
  10. Docker ❖ Docker is a tooling (glue code) for existing

    Linux technologies. ❖ Docker utilize those technologies to build a platform for application containers. Docker cgroups AUFS Namespaces Slide 14/32
  11. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/www/hsx/settings /var/www/hsx/filestorage

    9090 8443 HARDWARE LINUX Informatica Supplier Exchange Slide 15/32
  12. Example Java Tomcat SSL- Certificat HSX /var/log /var/www/hsx/settings /var/www/hsx/filestorage 9090

    8443 Informatica Supplier Exchange Slide 15/32 Completely self-contained!
  13. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/log /var/www/hsx/settings

    /home/ubuntu/hsx /var/www/hsx/filestorage /home/ubuntu/filestorage 80 9090 443 8443 HARDWARE LINUX Informatica Supplier Exchange Slide 15/32
  14. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/log /var/www/hsx/settings

    /home/ubuntu/hsx /var/www/hsx/filestorage /home/ubuntu/filestorage 80 9090 443 8443 HARDWARE LINUX Cloud Informatica Supplier Exchange Slide 15/32
  15. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/log /var/www/hsx/settings

    /home/ubuntu/hsx /var/www/hsx/filestorage /home/ubuntu/filestorage 80 9090 443 8443 HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange Slide 15/32
  16. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/log /var/www/hsx/settings

    /home/ubuntu/hsx /var/www/hsx/filestorage /home/ubuntu/filestorage 80 9090 443 8443 HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange (REST) API Slide 15/32
  17. Example DOCKER Java Tomcat SSL- Certificat HSX /var/log /var/www/hsx/settings /var/www/hsx/filestorage

    9090 8443 HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange (REST) API Build file Slide 15/32
  18. Example FROM ubuntu MAINTAINER Thomas Uhrig ([email protected]) RUN apt-get update

    && apt-get install -y openjdk-7-jre-headless RUN apt-get install -y tomcat7 ADD /hsx/tomcat/webapps/ /usr/share/tomcat7/webapps/ ADD /hsx/tomcat/conf/ /usr/share/tomcat7/conf/ RUN mkdir /usr/share/tomcat7/temp ADD /logging.properties /usr/share/tomcat7/conf/logging.properties ADD /server.xml /usr/share/tomcat7/conf/server.xml ADD /tomcat-users.xml /usr/share/tomcat7/conf/tomcat-users.xml ADD /hsx/configuration/ /var/www/hsx/configuration/ ADD /hsx/database/ /var/www/hsx/database/ ADD /hsx/filestorage/ /var/www/hsx/filestorage/ ADD /hsx/logs/ /var/www/hsx/logs/ ADD /run.sh /var/www/hsx/run.sh RUN /usr/lib/jvm/java-1.7.0-openjdk-amd64/bin/keytool -genkey -alias tomcat -keyalg RSA -keystore /root/.keystore -storepass password -keypass password -dname "CN=localhost, OU=Docker, O=Ubuntu, L=Stgt, S=Germany, C=DE" EXPOSE 9090 8443 CMD sh /var/www/hsx/run.sh Slide 16/32
  19. Example DOCKER HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange

    Informatica PIM Server Log Stash Slide 17/32 (REST) API I S O L A T E D I S O L A T E D
  20. Example DOCKER HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange

    (REST) API Informatica PIM Server Log Stash Java 7 Logstash Agent Java 8 Tomcat Linux Kernel Slide 17/32
  21. Example DOCKER HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange

    (REST) API Informatica PIM Server Log Stash Java 7 Logstash Agent Java 8 Tomcat Linux Kernel Slide 17/32 A complete image
  22. Example DOCKER HARDWARE LINUX HOST Cloud PaaS Informatica Supplier Exchange

    (REST) API Informatica PIM Server Log Stash Java 7 Logstash Agent Java 8 Tomcat Linux Kernel Slide 17/32 AUFS (advanced multi layered unification filesystem)
  23. AWS ❖ Amazon Web Services (AWS) is the cloud offer

    from Amazon ❖ 29 (decoupled) services (July 2014) from virtual machines to databases ❖ Support of many technologies (including Linux, Windows, Java, Python, Tomcat, Docker) ❖ Most mature and leading cloud offer ❖ Competitors are Microsoft, Google and dozens of small and medium companies Slide 19/32 #1
  24. AWS EC2 Virtual machines as a Service • Linux •

    Windows • On demand • Sizing • Root access RDS Databases as a Service • MSSQL • Oracle • MySQL • PostgreSQL • On demand (slow) • Sizing • Management S3 Storage as a Service • Storage • Key-Value • Any size API Language bindings (e.g. for Java, Python and C#) and REST API Slide 20/32
  25. DeployMan ❖ A command line tool to deploy Docker images

    to AWS. ❖ Build with Java on top of the AWS and Docker API. ❖ Stacks are defined in JSON-files and called “formations”. But also: ❖ A web interface (based on AngularJS) to monitor the deployment process. ❖ Ability to stop machines or images. Slide 22/32
  26. DeployMan Amazon Web Services Image Repository (S3) Source Code Repository

    Dockerfile build Container Build Machine Linux Docker Amazon & Docker API Config Config Repository (S3) create push Cloud (EC2) Linux Docker Deploy Man checkout push Slide 23/32 Maybe a build server such as Jenkins or any local developer machine!
  27. Stack Ubuntu VM Ubuntu VM EC2 Ubuntu VM Logstash Kibana

    Logstash forwarder Amazon Web Services Elasticsearch PIM Supplier Exchange Logstash Kibana Elasticsearch Logstash f. PIM Supplier Ex. Logstash f. Docker Docker Docker Configuration $: DeployMan DeployMan Ubuntu VM DeployMan Docker API Slide 25/32
  28. Results Compute Communicate Software Defined Networks Routing Infrastructure PaaS Applications

    Hardware Application Containers Application PaaS Model driven platforms Compute App Services Communicate Software Defined Storage Object storage Database PaaS Store App Services IaaS Foundational PaaS PaaS SaaS Model driven App Services Infrastructure Engineers DevOps Developers End-users Business Engineers Developers 1 2 3 6 4 5 Communicate App Services ___________________________________________________________________________ Reference: Simplified cloud model according to Johan Den Haan at goo.gl/jexFPB Virtual Machines AWS EC2 AWS Elastic IP AWS S3 AWS RDS Docker Docker Hub Docker API PIM + Supplier Exchange + Logstash Slide 27/32
  29. Graphics Docker whale and wave crest Docker Inc. http://www.docker.com Eclipse

    console own screenshot July, 2014 Cloudy sky own fotography June, 2014 Football goal Wikimedia Commons under Creative Commons Attribution 2.0 Generic license by Ronnie Macdonald https://commons.wikimedia.org/wiki/File:Goal_mouth_melee_1_(7100510129).jpg April, 2012 Container terminal at Port Elizabeth Wikimedia Commons under public domain https://commons.wikimedia.org/wiki/File:Line3174_-_Shipping_Containers_at_the_terminal_at_Port_Elizabeth,_New_Jersey_-_NOAA.jpg June, 2004 Tuk Tuk Wikimedia Commons under Creative Commons Attribution 2.0 Generic license by Heinrich Damm https://commons.wikimedia.org/wiki/File:Tuktukpktalad05b.jpg June, 2005 Solar car race Wikimedia Commons under Creative Commons Attribution 3.0 Unported license by Hideki Kimura https://commons.wikimedia.org/wiki/File:Solar_car_race_suzuka.jpg August, 2008 Slide 29/32
  30. Graphics IT Guy Wikimedia Commons under Creative Commons Attribution 2.0

    Generic license by Intel Free Press https://commons.wikimedia.org/wiki/File:Facebook_Data_Center_Server_Board.jpg September, 2013 Eclipse own fotography July, 2014 Walmart Wikimedia Commons under Public Domain https://commons.wikimedia.org/wiki/File:Remodeled_Walmart.jpg January, 2010 Construction Mechanics Wikimedia Commons under Public Domain http://goo.gl/HuyTHl October, 2009 Library Wikimedia Commons under Public Domain https://commons.wikimedia.org/wiki/File:SteacieLibrary.jpg November, 2008 Slide 30/32
  31. References The cloud landscape described, categorized, and compared Johan Den

    Haan http://www.theenterprisearchitect.eu/blog/2013/10/12/the-cloud-landscape-described-categorized-and-compared Slide 31/32