Infrastructure Design Patterns with Python, Buildbot, and Linux Containers

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

Linux System Management with Puppet, Gitlab, and R10k. Scott Nolin, SSEC Technical Computing 22 June 2017

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

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

Connect with Remedy: SmartIT: Social Event Manager Webinar Q&A

Aspirin as a Service: Using the Cloud to Cure Security Headaches

Handel-CodePipeline Documentation

AALOK INSTITUTE. DevOps Training

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

2012 Microsoft Corporation. All rights reserved. Microsoft, Active Directory, Excel, Lync, Outlook, SharePoint, Silverlight, SQL Server, Windows,

DevOps and Continuous Delivery USE CASE

AZURE CONTAINER INSTANCES

Jenkins: AMPLab s Friendly Butler. He will build your projects so you don t have to!

DISQUS. Continuous Deployment Everything. David

SnowAlert Documentation. Snowflake Security

Building (Better) Data Pipelines using Apache Airflow

Configuring the Oracle Network Environment. Copyright 2009, Oracle. All rights reserved.

PHP Composer 9 Benefits of Using a Binary Repository Manager

Continuous Integration and Delivery with Spinnaker

Simplified CICD with Jenkins and Git on the ZeroStack Platform

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

Containers, Serverless and Functions in a nutshell. Eugene Fedorenko

Orchestrator ver

OpenStack Havana All-in-One lab on VMware Workstation

Google on BeyondCorp: Empowering employees with security for the cloud era

Securing ArcGIS for Server. David Cordes, Raj Padmanabhan

Automation with Meraki Provisioning API

9 Reasons To Use a Binary Repository for Front-End Development with Bower

DevOps Course Content

BUILDING MICROSERVICES ON AZURE. ~ Vaibhav

CloudCenter for Developers

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

INDIGO PAAS TUTORIAL. ! Marica Antonacci RIA INFN-Bari

LAB EXERCISE: RedHat OpenShift with Contrail 5.0

Installing and Using Docker Toolbox for Mac OSX and Windows

SLI Learning Search Connect For Magento 2

Rancher Part 4: Using the Catalog Example with GlusterFS

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Basic Linux Security. Roman Bohuk University of Virginia

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

Building a high-performance, scalable ML & NLP platform with Python. Sheer El Showk CTO, Lore Ai

Jenkins User Conference Israel. #jenkinsconf. CI / Liveperson. Gidi Samuels. July 16, #jenkinsconf

Getting Started With Containers

Hybrid Cloud Automation using Cisco CloudCenter API

Index. Chaminda Chandrasekara 2017 C. Chandrasekara, Beginning Build and Release Management with TFS 2017 and VSTS, DOI /

Provisioning Intel Rack Scale Design Bare Metal Resources in the OpenStack Environment

Multi-Cloud and Application Centric Modeling, Deployment and Management with Cisco CloudCenter (CliQr)

Baremetal with Apache CloudStack

Verteego VDS Documentation

DEVOPS COURSE CONTENT

Two years of on Kubernetes

Continuous Integration using Docker & Jenkins

ThinkPalm s BreakThrough DevOps Capabilities ThinkPalm

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

Containers OpenStack. Murano brings Docker & Kubernetes to OpenStack. Serg Melikyan. software.mirantis.com. January 27, 2015

Advanced Java Testing. What s next?

Automation and Programmability using Cisco Open NXOS and DevOps Tools

Puppet 101 Basic installation for master and agent machines on Ubuntu with VMware Workstation

I'm Andy Glover and this is the Java Technical Series of. the developerworks podcasts. My guest is Brian Jakovich. He is the

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

OpenIAM Identity and Access Manager Technical Architecture Overview

6.001 Notes: Section 17.5

Pusher Documentation. Release. Top Free Games

git-pr Release dev2+ng5b0396a

FROM VSTS TO AZURE DEVOPS

Siegfried Goeschl. Gatling Tales From A Journey

Multi-Arch Layered Image Build System

Kuber-what?! Learn about Kubernetes

6.001 Notes: Section 8.1

TrueSight 10 Architecture & Scalability Q&A Best Practice Webinar 8/18/2015

Docker and Security. September 28, 2017 VASCAN Michael Irwin

ArcGIS Enterprise: Advanced Topics in Administration. Thomas Edghill & Moginraj Mohandas

Firefox Crash Reporting.

Debugging Your Python Code: For Dummies

DevOps Course Content

Ruby in the Sky with Diamonds. August, 2014 Sao Paulo, Brazil

Containerised Development of a Scientific Data Management System Ben Leighton, Andrew Freebairn, Ashley Sommer, Jonathan Yu, Simon Cox LAND AND WATER

InterCall Virtual Environments and Webcasting

Serverless Single Page Web Apps, Part Four. CSCI 5828: Foundations of Software Engineering Lecture 24 11/10/2016

Luigi Build Data Pipelines of batch jobs. - Pramod Toraskar

swiftenv Documentation

The new Docker networking put into action to spin up a SLURM cluster

DevOps Technologies. for Deployment

A DEVOPS STATE OF MIND. Chris Van Tuin Chief Technologist, West

Patching and Updating your VM SUSE Manager. Donald Vosburg, Sales Engineer, SUSE

With IBM BPM 8.5.5, the features needed to express both BPM solutions and case management oriented solutions comes together in one offering.

ASP.NET Core & Docker

The Total Newbie s Introduction to Heat Orchestration in OpenStack

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

Zadara Enterprise Storage in

Citrix Connector Citrix Systems, Inc. All rights reserved. p.1. About this release. System requirements. Technical overview.

Office 365 and Azure Active Directory Identities In-depth

IERG 4080 Building Scalable Internet-based Services

Polarion 18.2 Enterprise Setup

Look ma, no hands Jenkins Configuration-as-Code All Rights Reserved.

BUILDING A GPU-FOCUSED CI SOLUTION

Django MFA Documentation

Alexander Klein. #SQLSatDenmark. ETL meets Azure

Comparison of Service Description and Composition for Complex 3-tier Cloud-based Services

StreamSets Control Hub Installation Guide

Transcription:

Infrastructure Design Patterns with Python,, and Linux Containers David Liu Python Technical Consultant Engineer Intel Corporation Overview Introduction Breaking out of CI: Infrastructure Design patterns with framework pieces Hooking things up in weird ways: Ports, multi-masters, and pseudo- RPC When things don t fit: Linux Containers, and keeping things movable Pulling it all together with Python Real-world architectures that have worked Summary 1

Introduction: On Infrastructure What does it mean to have infrastructure? Is it automation? Is it orchestration? Is it task runners? Many options exist depending on what needs you have Full on orchestration with Chef, Puppet Dask, IPyParallel, Joblib (These are mostly numerical) Celery, Kafka Many of these examples are heavy-handed or square peg/round hole problems On Infrastructure (con t) Examples Trying to get a distributed task system such as Dask to run a CRON is not exactly the best use case Trying to get Celery to do a map-reduce operation Trying to get puppet to make a task graph In essence, every one of these frameworks are meant for vastly different things! 2

Breaking out of CI: Infrastructure Design patterns with is normally meant for Continuous Integration (CI), but you can construct things out of the elements in weird ways. Just like Lego blocks for infrastructure; this differs heavily from things such as Jenkins or TeamCity CI Tasks normally encompass interesting pieces: A scheduler, dependencies, a result However, these main task components are actually composed of many other primitives that have been assembled together Breaking out of CI: Infrastructure Design patterns with (Con t) Examples: Resource pools Roles and triggers Task runners Distributed System + communications State Logic Change triggers Schedulers Build steps (scripting steps) Master/worker system Barriers and semaphores Dependency tree 3

Breaking out of CI: Infrastructure Design patterns with (Con t) Because splits all these items up, one may be able to wire the components up in unusual ways to meet commonly occurring infrastructure patterns Warning: Before going any farther, I want to reiterate that what I am about to show is conceptual and used for proof-of-concepts, and is no replacement for sound orchestration and proper security This is considered a very off use of (and was not intended by the developers), so just be mindful of this Breaking out of CI: Infrastructure Design patterns with (Con t) Infrastructure design patterns are the common tasks/roles, and interconnects that occur in software deployments Using is just one way of solving such examples One can utilize this to prototype something and then convert it to enterpriselevel deployments Examples: CI->Package->Deployment (common use) Enterprise application deployment License Server Linux Session launching/landing on Servers Home Weather Server w/ Machine Learning tasks 4

Hooking things up in weird ways: Ports, multimasters, and pseudo-rpc Normally, most CI systems do not expose such controls, but because of the flexibility in, one may use it quite freely The change-port allows for usage of a script or symlinked call to trigger a task-which gives user-level triggers By passing in arguments of the script in, one can essentially RPC to a worker with a known resource i.e. run some task where the right version of Python/NumPy is is controlled via the logic of the master.cfg, which is interpreted as majority Python code Hooking things up in weird ways: Ports, multimasters, and pseudo-rpc (Con t) In the buildmaster s configuration, normal change sources look like the following: c['change_source'] = [] c['change_source'].append(changes.gitpoller( 'git://github.com/buildbot/pyflakes.git', workdir='gitpoller-workdir', branch='master', pollinterval=300)) However, you can add a secondary trigger source: c['change_source'].append(changes.pbchangesource(port=9999, user= myapp', passwd= AppPassword')) 5

7/13/17 Hooking things up in weird ways: Ports, multimasters, and pseudo-rpc (Con t) Matched with the fakechange.py script in buildbot-contrib, one can initiate and pass arguments (such as X11 info, user info) to a buildmaster Utilizes the twisted.internet and twisted.spread capabilities Sends change to the scheduler in the master.cfg Example of using the change-port to launch apps 6

Hooking things up in weird ways: Ports, multimasters, and pseudo-rpc (Con t) Multi-master gives the ability to chain tasks and resource pools together to grant capabilities such as load balancers to certain tasks Don t hesitate to have one task kick off another subset of instances Image from Docs Hooking things up in weird ways: Ports, multimasters, and pseudo-rpc (Con t) Use util.buildfactory() to send commands to workers via ShellCommand Note that the worker must be privileged to run command and must have resources, so define workers well 7

When things don t fit: Linux Containers, and keeping things movable What happens when things don t want to fit together? or you have security concepts to worry about? Use Linux Containers to provide additional design flexibility through composition techniques (docker-compose, as an example) Use Containers to also cordon off the riskier bits (prevent volume maps, etc.) Provide privilege/non-privileged barriers to separate users from fullprivileged resources When things don t fit: Linux Containers, and keeping things movable (con t) At some point, you may need orchestration to pull off tasks, so just know what responsibilities you want in what technologies Depending on how you approach the problem, you might be able to get away with little or no orchestration If all else fails, you can somewhat cheat by having the entire + logic inside of a container, and use those as building blocks 8

Pulling it all together with Python So with Python at the forefront, you can utilize the Python scripts injected into buildbot itself, or have the master.cfg unpack code that it receives The scripting capabilities mean that you can use calls in build steps to achieve things in an RPC format on the workers Python can call the build masters easily, so scripting it to do your bidding is free-form Mixing this with file opening, web calls and requests, are just some of the advantages of using Python glue Real-world architectures that have worked Company-wide server application deployment Used Applications set in containers, called by symlinked python scripts calling ports to start program Company used Orchestration to scale up and down the available workers as a resource pool depending on server loads License server for a floating license Company only had one license, and software had no ability to gate phone home data or queue Implemented with buildbot worker, and a master that queued/scheduled/gated the users. 9

7/13/17 Company-wide server application deployment Buildmaster handles queue, session details Spin up new workers for larger pool Update applications via Docker repository on Server with resource & full privilege User session or Login Node User /usr/bin mapped change port script Application Screen Change port Master Request Application Session Launch Docker App Mount Volume Forward X Session (Screen) Company-wide server application deployment 10

7/13/17 Company-wide server application deployment (con t) Company-wide server application deployment (con t) 11

License Server for a floating license License(s) can be held by master or the attached stock DB Either use available pool to block licenses, or via DB or logic Can also just hold a lock on the license file instead of application screen User A User B User session or Login Node Application Screen /usr/bin mapped change port script Change port Server with resource & full privilege Master DB or License Logic Request Application License Launch Docker App Mount Volume Forward X Session (Screen) License Server for a floating license 12

Real-world architectures that have worked Compute server Linux session handler Company used master/worker with workers and X11 forwarding to hand sessions to users; queue system via the master s bone stock scheduler Home Machine Learning server Used successfully to create a dashboard and compute center for my home system, which pulls in aggregate data and does ML on large datasets with classifiers Compute server Linux Session Handler (Tier setup w/ Multimaster) User session Login Node Server with resource & full privilege User A User B Landed Session(s) /usr/bin mapped change port script Change port Master DB Session Queue Task Master Applications, other setup details and advanced tasks Launch Xterm Session Mount Volume Forward X Session (Screen) 13

Machine Learning Server Local machine Web layer Buildmaster layer Server with resource & full privilege Web UI Localhost:8080 Dashboard Master DB Session Queue Retrieved data Compute Get Data from URLs and sources Clean up data, close task Post new result of ML on dashboard Summary Through a little bit of ingenuity and creative use of components, one may fashion many of the infrastructure design patterns that appear in software and IT Being able to rapidly design proof-of-concepts is possible with this method, and can reveal design considerations before making a proper solution Remember that the examples shown are not shown with any security or orchestration Keeping an open mind and an eye on upcoming technology can widen the available infrastructure patterns one can design Experiment with new tools often to see what patterns can be made next 14

References http://buildbot.net https://github.com/buildbot Repo for examples (To be posted soon): https://github.com/triskadecaepyon/infrastructure_patterns Q&A? https://github.com/triskadecaepyon https://triskadecaepyon.github.io/ 15