DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is...

25
DSFederal Inc. - “Connecting the dots” 1 Presented by Hunde Keba & Ashish Pagar DEPLOYMENT MADE EASY!

Transcript of DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is...

Page 1: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”1

Presented byHunde Keba

&Ashish Pagar

DEPLOYMENT MADE EASY!

Page 2: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”2

DSFederal Inc.

» We provide solutions to Federal Agencies

» Our technology solutions connect customers to the people they serve

Page 3: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Necessity is the Mother of Invention

» Project Requirements– Budget– Team Size– Time

» Need for Standardized Deployments» Workflow with CI/CD» Onboarding Developers

– Classic local development– Virtual Machine

3

Page 4: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Classic Dev Environment

Problems?» Host OS Support; tedious configurations» Non-transferable» Deployment Hassle

4

Page 5: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Virtual Machines

» Pros– Pristine host; highly customizable– Multiple VMs, 1 per project– Clone, share and transfer to other hosts

» Cons– Resource heavy– Difficult to share images

5

Page 6: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Docker to the Rescue

6

Page 7: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Docker

Docker is an open platform for developers and sysadmins to build, ship, and run distributed applications, whether on laptops, data center VMs, or the cloud.

7

Page 8: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Why Docker?

» Lightweight

» Portable

» Consistent Environment

8

Page 9: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Docker Containers

» Docker container wrap up a piece of software in a complete filesystem that contains everything it needs to run: code, runtime, system tools, system libraries – anything you can install on a server

» A container is a runtime instance of an image

9

Page 10: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Docker Images

» Docker container runs an Image» Binary package with root filesystem and

metadata» Metadata includes:

– Application Process– Volumes– Ports, etc.

10

Page 11: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Compose Docker Image

» Images are built from DockerFile» DockerFile is sequential list of commands» Images can inherit from other images

Example: php:5.6-fpm inherits from debian:jessie

11

Page 12: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

DockerFile example

#Docker File 2 (Here we don’t care about the OS)FROM php:7.2-apache

WORKDIR /var/www/htmlEXPOSE 80

12

#Docker file 1 (Installing apache on an Ubuntu 12 image )FROM ubuntu:12.04

RUN apt-get update && apt-get install -y apache2 && apt-get clean && rm -rf /var/lib/apt/lists/*

ENV APACHE_RUN_USER www-dataENV APACHE_RUN_GROUP www-dataENV APACHE_LOG_DIR /var/log/apache2

EXPOSE 80CMD ["/usr/sbin/apache2", "-D", "FOREGROUND"]

Page 13: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Lets Setup Local

» Dockerfile for Applications» Compose File» Environment Variables» Volumes» Git Branches

13

Page 14: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Amazon Web Services

» Provides secured hosting service» Scalable» Complies with Fed. Govt. and is

FEDRAMP Certified» Pay as you go» Great set of tools

14

Page 15: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Setup AWS EC2 Instance

» Create AWS Account» Configure EC2 Instance» Setup SSH Access» Install Docker & Docker

Compose

15

Page 16: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Setup Nginx

» Organize domains» Redirect incoming requests

for eg.,govcondev.dsfederal.com 127.0.0.1:10080govconstg.dsfederal.com 127.0.0.1:10081

16

Page 17: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

CI Jenkins

» Automation Server» Makes deployment easier» Works great with EC2, github, etc.» For our purposes we will use plugins:

– Github Plugin– Publish Over SSH

17

Page 18: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”18

SSH

SSH Server

Page 19: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Github Personal Token

19

Page 20: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Token Access

20

Page 21: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Github Credentials in Jenkins

21

Page 22: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Github Connection

22

Page 23: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Jenkins Build Tasks

» Build tasks for each path» Git Polling triggers

individual tasks» Task Definition:

– DrupalGovConDev– DrupalGovConStage– DrupalGovConProd

23

Page 24: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

Demo

https://youtu.be/qZalwRMcQk0 https://youtu.be/GHTRZyfXc2M

24

Page 25: DEPLOYMENT MADE EASY! - Drupal GovCon Made...DSFederal Inc. - “Connecting the dots” Necessity is the Mother of Invention »Project Requirements – Budget – Team Size – Time

DSFederal Inc. - “Connecting the dots”

QUESTIONS?

https://github.com/DSFederalInc/Drupal4GovConDemo:

https://youtu.be/qZalwRMcQk0 https://youtu.be/GHTRZyfXc2M

Hunde KebaTwitter: @hunde_keba [email protected]

Ashish PagarTwitter: @ashishpagar [email protected]

THANK YOU

25