Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Similar documents
DEVOPS COURSE CONTENT

DevOps Course Content

Java Architectures A New Hope. Eberhard Wolff

Think Small to Scale Big

AALOK INSTITUTE. DevOps Training

SBB. Java User Group 27.9 & Tobias Denzler, Philipp Oser

The age of orchestration

Distributed CI: Scaling Jenkins on Mesos and Marathon. Roger Ignazio Puppet Labs, Inc. MesosCon 2015 Seattle, WA

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

Continuous Integration using Docker & Jenkins

Important DevOps Technologies (3+2+3days) for Deployment

By: Jeeva S. Chelladhurai

Docker and Oracle Everything You Wanted To Know

Using AWS to Build a Large Scale Dockerized Microservices Architecture. Dr. Oliver Wahlen moovel Group GmbH Frankfurt, 30.

CONTINUOUS DELIVERY WITH MESOS, DC/OS AND JENKINS

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

DOCKER 101 FOR JS AFFICIONADOS. Christian Ulbrich, Zalari UG

CONTINUOUS DELIVERY WITH DC/OS AND JENKINS

[Docker] Containerization

ONAP Developer Typical Setup 2017 July ONAP Virtual Developers Event

Con$nuous Deployment with Docker Andrew Aslinger. Oct

FROM MONOLITH TO DOCKER DISTRIBUTED APPLICATIONS

Best Practices for Developing & Deploying Java Applications with Docker

DevOps in the Cloud A pipeline to heaven?! Robert Cowham BCS CMSG Vice Chair

BUILDING A GPU-FOCUSED CI SOLUTION

Docker at Lyft Speeding up development Matthew #dockercon

Using DC/OS for Continuous Delivery

Welcome to Docker Birthday # Docker Birthday events (list available at Docker.Party) RSVPs 600 mentors Big thanks to our global partners:

Microservices. Chaos Kontrolle mit Kubernetes. Robert Kubis - Developer Advocate,

Docker 101 Workshop. Eric Smalling - Solution Architect, Docker

Lessons Learned: Deploying Microservices Software Product in Customer Environments Mark Galpin, Solution Architect, JFrog, Inc.

Supporting Docker in Emulab-Based Network Testbeds. David Johnson, Elijah Grubb, Eric Eide University of Utah

Creating pipelines that build, test and deploy containerized artifacts Slides: Tom Adams

DevOps Technologies. for Deployment

UP! TO DOCKER PAAS. Ming

Amazon EC2 Container Service: Manage Docker-Enabled Apps in EC2

Use Case: Scalable applications

ACCELERATE APPLICATION DELIVERY WITH OPENSHIFT. Siamak Sadeghianfar Sr Technical Marketing Manager, April 2016

Docker and Security. September 28, 2017 VASCAN Michael Irwin

We are ready to serve Latest Testing Trends, Are you ready to learn?? New Batches Info

Container Orchestration on Amazon Web Services. Arun

Who is Docker and how he can help us? Heino Talvik

Docker for People. A brief and fairly painless introduction to Docker. Friday, November 17 th 11:00-11:45

The Long Road from Capistrano to Kubernetes

WHITE PAPER. RedHat OpenShift Container Platform. Benefits: Abstract. 1.1 Introduction

Sunil Shah SECURE, FLEXIBLE CONTINUOUS DELIVERY PIPELINES WITH GITLAB AND DC/OS Mesosphere, Inc. All Rights Reserved.

/ Cloud Computing. Recitation 5 February 14th, 2017

Azure DevOps. Randy Pagels Intelligent Cloud Technical Specialist Great Lakes Region

Cloud I - Introduction

DEVOPS TRAINING COURSE CONTENT

SQL Server inside a docker container. Christophe LAPORTE SQL Server MVP/MCM SQL Saturday 735 Helsinki 2018

Jenkins: A complete solution. From Continuous Integration to Continuous Delivery For HSBC

USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV

Running Splunk Enterprise within Docker

Docker for Development: Getting Started

Fixing the "It works on my machine!" Problem with Docker

JenkinsPipelineUnit. Test your Continuous Delivery Pipeline. Ozan Gunalp - Emmanuel Quincerot

Getting Started With Amazon EC2 Container Service

Getting Started With Containers

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

利用 Mesos 打造高延展性 Container 環境. Frank, Microsoft MTC

Technical Manual. Software Quality Analysis as a Service (SQUAAD) Team No.1. Implementers: Aleksandr Chernousov Chris Harman Supicha Phadungslip

How to Keep UP Through Digital Transformation with Next-Generation App Development

Parallelizing CI using Docker Swarm-Mode

Running MarkLogic in Containers (Both Docker and Kubernetes)

Microservices on AWS. Matthias Jung, Solutions Architect AWS

LSST software stack and deployment on other architectures. William O Mullane for Andy Connolly with material from Owen Boberg

OpenShift 3 Technical Architecture. Clayton Coleman, Dan McPherson Lead Engineers

DevOps Online Training

YOUR APPLICATION S JOURNEY TO THE CLOUD. What s the best way to get cloud native capabilities for your existing applications?

CONTINUOUS DELIVERY IN THE ORACLE CLOUD

Kuber-what?! Learn about Kubernetes

/ Cloud Computing. Recitation 5 September 27 th, 2016

DevOps Foundations : Infrastructure as Code

Top five Docker performance tips

SCREENING TEST & TELEPHONIC

DevOps on AWS Deep Dive on Continuous Delivery and the AWS Developer Tools

HOW TO STAND OUT IN DEVOPS

It s probably the most popular containerization technology on Linux these days

The four forces of Cloud Native

DEPLOYMENT MADE EASY!

Continuous Delivery of your infrastructure. Christophe

Investigating Containers for Future Services and User Application Support

12 (15) Factor App Workshop

Zero to Microservices in 5 minutes using Docker Containers. Mathew Lodge Weaveworks

Harbor Registry. VMware VMware Inc. All rights reserved.

P a g e 1. Teknologisk Institut. Online kursus k SysAdmin & DevOps Collection

DevOps Workflow. From 0 to kube in 60 min. Christian Kniep, v Technical Account Manager, Docker Inc.

Docker II - Judgement Day

Pipeline as Code for your IAC. Kris

Docker und IBM Digital Experience in Docker Container

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Arup Nanda VP, Data Services Priceline.com

IBM Planning Analytics Workspace Local Distributed Soufiane Azizi. IBM Planning Analytics

Installation and setup guide of 1.1 demonstrator

Continuous integration & continuous delivery. COSC345 Software Engineering

Container-based virtualization: Docker

Red Hat Atomic Details Dockah, Dockah, Dockah! Containerization as a shift of paradigm for the GNU/Linux OS

Wrapp. Powered by AWS EC2 Container Service. Jude D Souza Solutions Wrapp Phone:

Midterm Presentation Schedule

Transcription:

Developing and Testing Java Microservices on Docker Todd Fasullo Dir. Engineering

Agenda Who is Smartsheet + why we started using Docker Docker fundamentals Demo - creating a service Demo - building service + Docker container Demo - deploying service for testing Versioning containers, logging, local dev environment, etc Tips + future plans

Smartsheet The collaborative work management tool for businesses of all sizes 82,000 8,000,000 300 190 45% 10 Paying Organizations Users Employees Countries International Revenue Years Old Tech Partners Customers

Technical Background Primary Technologies Java/Tomcat Javascript MySQL Data Store Native Mobile ios/android Hosted in redundant colo data centers Monolithic app with migration to services starting in 2014

Our Nomenclature apps + services users interact with apps apps talk with services git-flow low style development for appcore linear (semantic) versioned development for everything else monthly release cycle

Challenges - How do you? provide flexibility for service teams to choose their technologies create consistent build pipeline for all apps and services in test environments allow QA teams to deploy any combination of app/service version they want to test Perform upgrade/rollback scenarios where multiple different versions of the same app/service are running at the same time in local development environments simulate networked services on single host make sure all developers are running current versions of all infrastructure, apps, and services

All environments are not created equal Production $$$$ Test / Integration $ QA

Load Balancer & SSL & Websocket Proxy (Nginx) Web Server (Apache) App Server (Tomcat) Develop Next Current Feature1 Feature2 Feature3 Feature4 Last Feature5 Feature6 Feature7 Feature8 Postfix Elastic Search SMTP Dev DBs DBs DBs DBs DBs DBs Next DBs DBs TokuDB Memcache DBs DBs DBs DBs RabbitMQ

Pain Points lack of isolation between lab slots rebuilds impacts everyone no flexibility with software versioning stability issues in one slot bleed into other slots fixed hourly build schedule lack of continuous integration testing

The solution - Docker + Jenkins April 2014 - start investigation and prototype with Docker 0.9.1 Migrate to Jenkins for build automation June 2014 - fully transitioned QA environment(s) Oct 2014 - transitioned local development environments Vagrant + VirtualBox + docker + docker-compose July 2015 - deployed 2nd QA instance Sept 2015 - deployed 3rd QA instance March 2016 - consolidated to multi-host Swarm cluster currently a 6 node cluster - 1 EC2 m4.large + 5 EC2 r3.2xlarge instances 42 CPUs + 323 GB RAM capacity ~20 concurrent Smartsheet environments

Docker Fundamentals Docker provides a lightweight runtime environment for applications called a container Many containers can run on a single host OS and share the same Linux kernel Each has its own isolated file system Similar to a VM but...

Different than a VM Traditional VM Docker

Docker Building Blocks 1. Docker Engine runtime for containers 2. Dockerfiles definition of software/config in containers 3. Docker Registry central storage/sharing of containers 4. Docker Swarm clustering solution to turn pool of hosts into single virtual cluster separate product prior to 1.12 - now merged into Docker engine 5. Docker Compose tool for defining and running multi-container applications

Load Balancer & SSL & Websocket Proxy Jenkins Swarm Mgr Consul Swarm Agent manager develop current feature1 feature2 app-core tc app-core tc app-core tc app-core tc app-core db app-core db app-core db app-core db service-rm tc service-rm tc service-rm tc service-rm tc service-rm db elasticsearch service-rm db elasticsearch... service-rm db elasticsearch service-rm db elasticsearch...... memcache memcache memcache memcache rabbitmq rabbitmq rabbitmq rabbitmq tokumx...... tokumx... tokumx...... tokumx... Swarm Agent node01 Swarm Agent node02

Demo Create a Service

App + Service Build Process Build Server builds.json (Git) Jenkins Container Config Job https://registry... Nginx Docker Registry Maven Build Jobs Container Build Jobs app/service (Git) Artifacts Amazon S3 Docker

Demo Build the Service + Container

Initial Dockerfiles FROM registry.lab.smartsheet.com/smartsheetdev/java8tomcat:7 MAINTAINER smart.person@smartsheet.com # Download our release WAR from Jenkins RUN mkdir -p /opt/tomcat/webapps RUN (wget -q --continue -O /opt/tomcat/webapps/servicefoo.war https://builds.lab.smartsheet. com/jenkins/job/maven-service-builds/job/service-foo-release/lastsuccessfulbuild/artifact/target/smartsheetservice-foo-1.0.0.war) # Download our Tomcat context.xml RUN mkdir -p /opt/tomcat/conf/catalina/localhost RUN (wget -q --continue -O /opt/tomcat/conf/catalina/localhost/servicefoo.xml https://builds.lab.smartsheet. com/jenkins/job/maven-service-builds/job/service-foorelease/lastsuccessfulbuild/artifact/target/config/context.xml)...

Improved Dockerfiles FROM registry.lab.smartsheet.com/smartsheetdev/java8tomcat:7 MAINTAINER smart.person@smartsheet.com # Download our release WAR from Jenkins RUN mkdir -p /opt/tomcat/webapps RUN (wget -q --continue -O /opt/tomcat/webapps/servicefoo.war ${SMARTSHEET_SERVICE_FOO_WAR_FULL_URL}) # Download our Tomcat context.xml RUN mkdir -p /opt/tomcat/conf/catalina/localhost RUN (wget -q --continue -O /opt/tomcat/conf/catalina/localhost/servicefoo.xml ${CONTEXT_XML_FULL_URL})...

Templating Dockerfiles in Jenkins Job # Get build artifacts for service-foo-snapshot eval $(${WORKSPACE}/getArtifactEnvVars.py ${JENKINS_BUILD_URL}) # Generate Dockerfile for smartsheet-dev-service-foo next cat ${WORKSPACE}/smartsheet-dev-service-foo/Dockerfile-next envsubst > ${WORKSPACE}/smartsheet-devservice-foo/Dockerfile ${WORKSPACE}/build-images-jenkins.sh -f smartsheet-dev-service-foo -N "smartsheetdev/servicefoo" -t next...

Registry Version History curl https://registry.lab.smartsheet.com/v2/smartsheetdev/servicefoo/tags/list python -m json.tool { "name": "smartsheetdev/servicefoo", "tags": [ "1", "1.0", Last 1.0.1 build (master branch) "1.0.0", "1.0.1", "1.2", Last 1.2.2 build (master branch) "1.2.0", "1.2.1", Last 1.3.0 build (develop branch) "1.2.2", "1.3", "1.3.0", "current", "latest", "next" ] }

https://lab.smartsheet.com Load Balancer & SSL & Websocket Proxy Jenkins Container Develop https://registry.lab... app-core.json (Git) Config Job app-core tc app-core db Nginx service-rm tc Docker Registry app-core (Git) Build Jobs Artifacts Deploy Jobs service-rm db Elasticsearch... Amazon S3 Docker

Demo Deploy Service + App

Logging everyone does logging differently - many options but no perfect one mount host directory and write logs from containers there log only to stdout/stderr - goes to the Docker "logs" run log forwarder inside container and forward our approach - log forwarder in each container built into base image ELK stack (Elasticsearch + Logstash + Kibana) per slot events contain meta-data of container for filtering/searching example

Local Development we use Vagrant + docker-compose for local development docker-compose.yml file checked into app-core repo Vagrant image has Docker engine + Docker image cache Vagrant VM syncs on startup to get latest images app-core git:(develop) vagrant up... ==> develop: Pulling servicefoo (registry.lab.smartsheet.com/...) ==> develop: latest: Pulling from registry.lab.smartsheet.com/... ==> develop: Digest: sha256:59ea97dc12... ==> develop: Status: Image is up to date for registry.lab...:latest...

Future Plans Migrate to Docker 1.12 will simplify lab server deployment No need for Swarm Mgr, Swarm Agent, Consul, etc Hybrid local-dev + remote EC2 environment current full smartsheet environment + dev tools is hitting 16 GB new Docker client for Mac/Windows removes need for Vagrant/VirtualBox securely networks across multiple hosts build + deploy some apps/services locally - everything else remote

Key Tips + Takeaways Create a standard nomenclature Generate your build jobs from scripts and config (checked into scm) Jenkins Job DSL Plugin is great once you get going (https://github. com/jenkinsci/job-dsl-plugin/wiki) Version build artifacts and containers Use one system of record for version info - don't duplicate it in other places Allow deploy of various combinations of artifacts for QA but default to simplest scenario

Questions? Careers Page: http://www.smartsheet. com/careers Dev Events: dev-events@smartsheet.com