SlideShare uma empresa Scribd logo
1 de 39
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 1
Agility. Security. Delivered.
DevOps in a Regulated and
Embedded Environment
By: Arjun Comar
(Was DevOps on a Legacy Project)
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 2
Agenda
• About Me
• Agile, DevOps, and Medical Devices: What’s the Problem?
• Git Flow in a Regulated World
• Expect to Deploy
• Scaling for Success and Resource Management
• Questions
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 3
About Me
• B.S. in Computer Science from the Rose-
Hulman Institute of Technology
• Worked on everything from the Linux
kernel to computer vision.
• Interested in software quality and
correctness.
• Been with Coveros for ~2.5 years.
• Run the local HaskellDC meetup group.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 4
About Coveros
• Coveros builds security-critical applications using
agile methods.
• Coveros Services
• Agile transformations
• Agile development and testing
• DevOps and continuous integration
• Application security analysis
• Agile & Security training
• Government qualifications
• DCAA approved rates and accounting
• TS facility clearance
Areas of Expertise
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 5
Select Clients
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 6
Medical Devices and the Law
• It isn’t sufficient to write the code, release requires regulatory
approval.
• Approval is per feature (epic)
• Contingent on development, testing, risk mitigation, etc.
• We want short-lived branches, but…
• If we don’t get approval for one feature, business still wants to release
the others
• Unmerge all the feature branches that went into an epic?
• Further requirements around documentation, especially:
• Design
• Testing
• Risk Management
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 7
Legacy Problems
• C code, embedded device target
• cross compilation: Windows -> QNX
• Some modules only built on WinXP
• Manual build, deploy, test process
• Custom hardware, custom firmware
• Old codebase, not written to be unit tested
• Unit test execution requires target environment
• Rough order of magnitude, 200 kloc codebase
• Hardware platform ~25 years old
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 8
Integration and Deployment
• Manual builds, deploy to unit test?
• Unmaintained deployment scripts
• Written by a contractor in ksh,
• Last maintainer had already left the company
• Working deployments flashed unit with usb stick and physical dongle
• Rewrite with Chef? ...Ansible? … Bash?
• try: sh run over telnet
• No ruby, python, perl, bash, ssh, dhcp
• Network deployments/updates to a device that goes in a human
being…?
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 9
Feedback Cycles
• Deployments took ~30 minutes and required physical interaction
through the process
• Testing involved long protocols with detailed and very particular
steps
• ~5-6 weeks for the test team, maybe 8 weeks, but at least 3-4.
• Release cycle on the order of years.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 10
Resource Needs and Team Size
• Business wanted multiple features in development in parallel
• Different tests take different lengths of time to run
• even when automated
• seconds -> weeks
• Business needed 4 teams like the one they had
• Continuous integration targets, unit test targets, deployment
testing targets, full functional test targets, partially automated test
targets
• Performance, reliability, security, durability, etc.?
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 11
Solutions
One thing at a time...
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 12
Git Flow
in a Regulated World
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 13
Git Workflows
• Linux Kernel: benevolent dictator, many trusted lieutenants, an
insane number of contributors.
• GitHub: Single (or small team) of maintainers, contributors submit
pull-requests
• Corporate git usage: Trusted team of developers, co-maintain
shared repository
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 14
Enter: Git Flow
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 15
But I can’t merge back daily...
• No, really. Daily merges back to develop means pulling an epic out
requires a virtually impossible unmerge.
• Might be legally required not to go forward with a feature
• Can’t get approval until feature is developed and tested with
known risks documented and mitigated
• Business still wants to release what they can
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 16
Can’t not integrate...
• Long lived lines of development, all separate
• Tested independently prior to release
• Business wants to release, integrate necessary branches and…
• Disaster: merge conflicts, retest everything, unknown interactions
everywhere
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 17
Extending the
workflow to deal with
regulation
Extend the git flow model
Keep epic specific code in ‘develop/epic-
name’ branches
Use ‘feature/epic-name/feature-name’
branches for daily work
Merge these back daily!
Epic branches get merged back for a
release
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 18
Integrating Continuously
• Use tooling to manage the problem for you
• Have Jenkins (or your CI stack of choice) do builds by merging
develop with the epic branches first
• develop holds code that will be released, features that conflict must be
fixed
• Run the normal deployment and testing cycle on these builds
• merge conflicts are failed builds
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 19
Integrating even more continuously
• Still need to know if there’s potential conflicts between epic
branches
• fail early, fail often, right?
• Take all the epic branches and merge them with develop
• Run a full build/deploy/test cycle on this mess as well.
• Any failures found -> failed build
• If it doesn’t cleanly merge, we can’t release, right?
• The software should always be ready to release; make it a business
decision, not a technical one.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 20
Digging deeper to unearth conflict
• Better error detection and reporting:
• If we merge everything together, it looks like the later branches cause
conflicts more often
• Branches that conflict exclude each other
• Find conflicting pairs and report them both as failed
• Conflicts may only show up with the interaction of 3+ branches
• But this gets exponentially hard to detect
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 21
Do what you can
• Merge all possible epic branch pairs together, track+report failures
• Report these failures once or the team will ignore you...
• Branches that cleanly merge with everything get merged together
with development and built
• This assesses the health of the software as it exists at this moment
• This might be expensive, so do it overnight.
• Shortcuts:
• If ‘A’ merges with ‘B’, then ‘B’ merges with ‘A’
• ‘A’ always merges with ‘A’
• (You only need the top half of the n x n matrix)
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 22
This is a lot of work...
• Long-lived branches are hard to deal with.
• You could even go further and build the sets of conflicting
branches that can be merged together
• This is really hard; it’s easier to ask the team to fix the mess.
• If you don’t have to do it, don’t.
• You probably don’t unless regulatory constraints make you.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 23
Expect to Deploy
What a lifesaver
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 24
Expect?
• Tcl scripting language used to automate interactive programs
• ...like telnet and ftp
• Was used to automate testing way back in the day
• Turns out to be rather perfect for scripting deployments, testing,
etc. in this tool restricted environment
• sh, ksh, telnet, ftp
• not: bash, python, ruby, ssh, perl, etc.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 25
Wait, why not use ...
• Yes, we could have tried to beat that wall down
• Lots of effort/expertise to produce a working build of python for
the target environment
• QNX support would probably have been willing to help
• But loading new software onto the target environment to increase
its capabilities is fundamentally risky
• Business was understandably risk averse
• Rather limited DevOps team at this point of me, myself, and I.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 26
A little expect script
$ cat login.expect
#!/usr/bin/expect
set timeout 20
set addr [lindex $argv 0]
set user [lindex $argv 1]
set pass [lindex $argv 2]
spawn telnet $addr
expect "login:"
send "$userr"
expect "Password:"
send "$passr"
expect "#"
interact
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 27
Adding a little abstraction
proc login { addr user pass } {
spawn telnet $addr
expect {
timeout { send_user "Could not connectn"; exit 1 }
eof { send_user "Connection refusedn"; exit 1 }
"login:"
}
send "$userr"
expect "Password:"
send "$passr"
expect {
timeout { send_user "Failed to login.n"; exit 1 }
"#"
}
}
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 28
Separation of Concerns
• It only takes minor modifications to use the same logic to connect
to ftp
• Use ftp to upload deployment archive, install sh script
• Use telnet to set permissions and execute install script on archive
• Deployment logic is now separate from connecting, setup, etc.
• “talking to the target” vs “doing stuff on the target”
• This is exactly the separation chef/puppet/ansible provide
• (They also provide a whole lot of other value as well, but it’s nice to
recover any of it!)
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 29
Towards a deployment framework
• How many environments like this are out there?
• limited tooling, embedded platform, etc.
• If there are a lot… we have the start of a deployment framework to
target these environments
• Dependencies are very minimal, can be used to target virtually
anything
• With work, we could get something idempotent with clean
modularity and composability.
• A whole lot of work… Is there a market that needs this?
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 30
Scaling for Success
and Resource Management
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 31
Resource Needs
• Embedded device with potential hardware attachments for
particular tests -- virtualization is out.
• Unit tests need to run in the target environment so one target is
needed at a minimum just for rapid feedback CI.
• Basic integration testing (i.e. devint env) takes ~1 min to ~ 10 mins
• Fully automated functional testing takes ~10 mins to 1+ hours to
run (i.e. test env)
• Partially automated tests require interaction, need another target.
• Longer term testing (i.e. stress, durability, performance, etc.) takes
weeks and needs its own target.
• ~5 targets minimum to support development for basic CI/CD
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 32
Tackling Resource Allocation
• If a new build kicks off and reaches deployment testing while the
previous round of smoke testing is still on-going, what happens?
• Probably: target gets bricked as OS level code is updated while the
machine is in use.
• Even if the pipeline is built carefully so these things can’t happen,
there’s always PEBKAC
• Deployment and testing tools need to be smart enough to check if
a console is available before attempting to use it
• We need a resource allocator...
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 33
Making a first pass
• Track the target state on the target
• Use an old Unix trick -- drop a lock file in a well-known spot, and
make tools attempt to acquire the lock before using the target
• Pros: Extremely simple to implement and use; it’s a really simple
pair of shell scripts.
• Cons: If the lockfile isn’t cleaned up, the target is unavailable; if the
tool (user) doesn’t check for the lock, they could still cause
problems. It’s hard to track what targets are in use where, there’s
no centralized management.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 34
Aside: Jenkins Pipeline
• Specifying the pipeline in groovy
instead of shell/jenkins xml
prevented a lot of bugs.
• acquireLock and releaseLock have
simple contracts and provide
strong guarantees with try/finally
idiom.
• This is tricky/hard to achieve with
traditional jenkins.
def locking(target, action) {
try {
acquireLock(target)
action()
} finally {
releaseLock(target)
}
}
downloadTests(latest)
locking(targetAddr) {
deploy(targetAddr)
runTests(targetAddr, myBuild, testTags)
}
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 35
Multiple teams, multiple workstreams
• Goal is to reduce cycle time. If one team has to wait for feedback
for another team’s build to finish, we’re wasting time.
• Key takeaway: we can’t effectively share environments between
parallel streams of development.
• Business wanted ~4 streams of work progressing in parallel.
• Team needs to be able to support old releases via hotfixes (~2 old,
previous release, current stream of development).
• Hardware/firmware platform changes between releases
• Test automation team needs to an environment to test their tests.
• DevOps team needs to be able to test pipeline changes.
• ~40 target machines to effectively support CI/CD pipeline.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 36
That’s a lot of equipment...
• Where do you put it all?
• Shelving/rackspace, cooling, switches, networking…
• Units are expensive; if they aren’t in use/needed, business is going
to get annoyed.
• Hard to track utilization, load, etc. from a really decentralized
place.
• We might also be able to save money / use fewer targets if we’re
more intelligent about allocating them; i.e. allocate on demand.
• Centralization also means we can start hitting nice-to-haves:
• console access from the web browser for debugging
• status/health check daemon reporting to the manager
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 37
Centralized Resource Management
• Pool available targets, expose REST API to acquire a target for use,
release a target, check a target, etc.
• Track target status, usage metrics, target requester statistics in
backend database.
• Set up a simple frontend to display statistics about usage, provide
a manual form to acquire a target for manual/ad-hoc testing, etc.
• Like a library; acquire target for duration, get grumpy emails if it’s
not returned in time.
• Can be easily expanded to provide additional services over time.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 38
Lightning Quick Recap
• Integrate continuously to keep software testable, increase quality,
and build confidence.
• Prioritize the delivery of working software.
• Fail early, fail often.
• Make your tools serve your needs.
• Set yourself up to success -- plan ahead to cover scaling needs.
twitter: @arjuncomar email: arjun.comar@coveros.com
© COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 39
That was fast...
• There’s a lot more I’d love to talk about.
• Please feel free to ask me questions during the break or
afterwards.
• Thanks for your time!
twitter: @arjuncomar email: arjun.comar@coveros.com

Mais conteúdo relacionado

Mais procurados

Mais procurados (20)

ApacheCon NA 2015 - Gabriele Columbro - Is Open Source the right model in the...
ApacheCon NA 2015 - Gabriele Columbro - Is Open Source the right model in the...ApacheCon NA 2015 - Gabriele Columbro - Is Open Source the right model in the...
ApacheCon NA 2015 - Gabriele Columbro - Is Open Source the right model in the...
 
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.Jenkinsconf Presentation - Advance jenkins management with multiple projects.
Jenkinsconf Presentation - Advance jenkins management with multiple projects.
 
Transforming Software Development
Transforming Software Development Transforming Software Development
Transforming Software Development
 
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec JenkinsJournée DevOps : De l'intégration continue au déploiement continu avec Jenkins
Journée DevOps : De l'intégration continue au déploiement continu avec Jenkins
 
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
CI and CD Across the Enterprise with Jenkins (devops.com Nov 2014)
 
Monitoring and alerting as code with Terraform and New Relic
Monitoring and alerting as code with Terraform and New RelicMonitoring and alerting as code with Terraform and New Relic
Monitoring and alerting as code with Terraform and New Relic
 
Using Go in DevOps
Using Go in DevOpsUsing Go in DevOps
Using Go in DevOps
 
Using Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure SecurityUsing Chef InSpec for Infrastructure Security
Using Chef InSpec for Infrastructure Security
 
Building a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containersBuilding a CICD pipeline for deploying to containers
Building a CICD pipeline for deploying to containers
 
OpenSlava 2015 When DevOps Hurts
OpenSlava 2015 When DevOps HurtsOpenSlava 2015 When DevOps Hurts
OpenSlava 2015 When DevOps Hurts
 
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) PipelineAnatomy of a Continuous Integration and Delivery (CICD) Pipeline
Anatomy of a Continuous Integration and Delivery (CICD) Pipeline
 
Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019Prescriptive Security with InSpec - All Things Open 2019
Prescriptive Security with InSpec - All Things Open 2019
 
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
From Continuous Integration to Continuous Delivery with Jenkins - javaland.de...
 
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
DOES14 - Gary Gruver - Macy's - Transforming Traditional Enterprise Software ...
 
PowerShell and Azure DevOps
PowerShell and Azure DevOpsPowerShell and Azure DevOps
PowerShell and Azure DevOps
 
Deploying Apps on OpenStack
Deploying Apps on OpenStackDeploying Apps on OpenStack
Deploying Apps on OpenStack
 
Introduction to CICD
Introduction to CICDIntroduction to CICD
Introduction to CICD
 
Continuously serving the developer community with Continuous Integration and...
Continuously serving the developer community with  Continuous Integration and...Continuously serving the developer community with  Continuous Integration and...
Continuously serving the developer community with Continuous Integration and...
 
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
Microsoft Tech Summit Switzerland 2019 - DOCKER + AZURE DEVOPS + KUBERNETES = ♥
 
Who *is* Jenkins?
Who *is* Jenkins?Who *is* Jenkins?
Who *is* Jenkins?
 

Destaque

Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are SecureSecurity & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Puppet
 

Destaque (20)

DevOps and IT security
DevOps and IT securityDevOps and IT security
DevOps and IT security
 
Release Engineering & Rugged DevOps: An Intersection - J. Paul Reed
Release Engineering & Rugged DevOps: An Intersection - J. Paul ReedRelease Engineering & Rugged DevOps: An Intersection - J. Paul Reed
Release Engineering & Rugged DevOps: An Intersection - J. Paul Reed
 
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are SecureSecurity & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
Security & DevOps- Ways To Make Sure Your Apps & Infrastructure Are Secure
 
Making Security Agile - Oleg Gryb
Making Security Agile - Oleg GrybMaking Security Agile - Oleg Gryb
Making Security Agile - Oleg Gryb
 
Building Security In - A Tale of Two Stories - Laksh Raghavan
Building Security In - A Tale of Two Stories - Laksh RaghavanBuilding Security In - A Tale of Two Stories - Laksh Raghavan
Building Security In - A Tale of Two Stories - Laksh Raghavan
 
Empowering Application Security Protection in the World of DevOps
Empowering Application Security Protection in the World of DevOpsEmpowering Application Security Protection in the World of DevOps
Empowering Application Security Protection in the World of DevOps
 
Application Security at DevOps Speed - DevOpsDays Singapore 2016
Application Security at DevOps Speed - DevOpsDays Singapore 2016Application Security at DevOps Speed - DevOpsDays Singapore 2016
Application Security at DevOps Speed - DevOpsDays Singapore 2016
 
Requirements Gathering for a Successful Rugged DevOps Implementation - Hasan ...
Requirements Gathering for a Successful Rugged DevOps Implementation - Hasan ...Requirements Gathering for a Successful Rugged DevOps Implementation - Hasan ...
Requirements Gathering for a Successful Rugged DevOps Implementation - Hasan ...
 
DevSecOps - Building Rugged Software
DevSecOps - Building Rugged SoftwareDevSecOps - Building Rugged Software
DevSecOps - Building Rugged Software
 
Integrating DevOps and Security
Integrating DevOps and SecurityIntegrating DevOps and Security
Integrating DevOps and Security
 
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate BottlenecksCampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
CampDevOps keynote - DevOps: Using 'Lean' to eliminate Bottlenecks
 
Implementing DevOps in a Regulated Environment - DJ Schleen
Implementing DevOps in a Regulated Environment - DJ SchleenImplementing DevOps in a Regulated Environment - DJ Schleen
Implementing DevOps in a Regulated Environment - DJ Schleen
 
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
DevOpsSec: Appling DevOps Principles to Security, DevOpsDays Austin 2012
 
The Rise of DevSecOps - Fabian Lim - DevSecOpsSg
The Rise of DevSecOps - Fabian Lim - DevSecOpsSgThe Rise of DevSecOps - Fabian Lim - DevSecOpsSg
The Rise of DevSecOps - Fabian Lim - DevSecOpsSg
 
DevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to SecurityDevSecOps: Taking a DevOps Approach to Security
DevSecOps: Taking a DevOps Approach to Security
 
The Journey to DevSecOps
The Journey to DevSecOpsThe Journey to DevSecOps
The Journey to DevSecOps
 
DevOps & Security: Here & Now
DevOps & Security: Here & NowDevOps & Security: Here & Now
DevOps & Security: Here & Now
 
What's My Security Policy Doing to My Help Desk w/ Chris Swan
What's My Security Policy Doing to My Help Desk w/ Chris SwanWhat's My Security Policy Doing to My Help Desk w/ Chris Swan
What's My Security Policy Doing to My Help Desk w/ Chris Swan
 
Devops security
Devops securityDevops security
Devops security
 
My Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is MagicMy Little Webap - DevOpsSec is Magic
My Little Webap - DevOpsSec is Magic
 

Semelhante a DevOps in a Regulated and Embedded Environment (AgileDC)

Experiences Bringing CD to a DoD Project
Experiences Bringing CD to a DoD ProjectExperiences Bringing CD to a DoD Project
Experiences Bringing CD to a DoD Project
Gene Gotimer
 

Semelhante a DevOps in a Regulated and Embedded Environment (AgileDC) (20)

DevOps Patterns to Enable Success in Microservices
DevOps Patterns to Enable Success in MicroservicesDevOps Patterns to Enable Success in Microservices
DevOps Patterns to Enable Success in Microservices
 
Experiences Bringing CD to a DoD Project
Experiences Bringing CD to a DoD ProjectExperiences Bringing CD to a DoD Project
Experiences Bringing CD to a DoD Project
 
DevOps in an Embedded and Regulated Environment
DevOps in an Embedded and Regulated EnvironmentDevOps in an Embedded and Regulated Environment
DevOps in an Embedded and Regulated Environment
 
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, CheaperTesting in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
 
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
Testing in a Continuous Delivery Pipeline - Better, Faster, Cheaper
 
DevOps Patterns to Enable Success in Microservices
DevOps Patterns to Enable Success in MicroservicesDevOps Patterns to Enable Success in Microservices
DevOps Patterns to Enable Success in Microservices
 
DevOpsing Greenfield - AgileDC2018 - Mills - v1.4 2018.10.15
DevOpsing Greenfield - AgileDC2018 - Mills - v1.4 2018.10.15DevOpsing Greenfield - AgileDC2018 - Mills - v1.4 2018.10.15
DevOpsing Greenfield - AgileDC2018 - Mills - v1.4 2018.10.15
 
Agile DevOps Transformation At HUD (AgileDC 2017)
Agile DevOps Transformation At HUD (AgileDC 2017)Agile DevOps Transformation At HUD (AgileDC 2017)
Agile DevOps Transformation At HUD (AgileDC 2017)
 
Case study
Case studyCase study
Case study
 
Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015Docker & aPaaS: Enterprise Innovation and Trends for 2015
Docker & aPaaS: Enterprise Innovation and Trends for 2015
 
Containers, microservices and serverless for realists
Containers, microservices and serverless for realistsContainers, microservices and serverless for realists
Containers, microservices and serverless for realists
 
Webinar-DevOps.pdf
Webinar-DevOps.pdfWebinar-DevOps.pdf
Webinar-DevOps.pdf
 
The Butler is still young – applying modern Jenkins features to the Embedded ...
The Butler is still young – applying modern Jenkins features to the Embedded ...The Butler is still young – applying modern Jenkins features to the Embedded ...
The Butler is still young – applying modern Jenkins features to the Embedded ...
 
Provision to Production with Terraform Enterprise
Provision to Production with Terraform EnterpriseProvision to Production with Terraform Enterprise
Provision to Production with Terraform Enterprise
 
10 tips for Cloud Native Security
10 tips for Cloud Native Security10 tips for Cloud Native Security
10 tips for Cloud Native Security
 
DevOps demystified
DevOps demystifiedDevOps demystified
DevOps demystified
 
DevOps Culture at Amazon
DevOps Culture at AmazonDevOps Culture at Amazon
DevOps Culture at Amazon
 
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024Analysis of-quality-of-pkgs-in-packagist-univ-20171024
Analysis of-quality-of-pkgs-in-packagist-univ-20171024
 
Meetup devops
Meetup devopsMeetup devops
Meetup devops
 
Advanced dev ops governance with terraform
Advanced dev ops governance with terraformAdvanced dev ops governance with terraform
Advanced dev ops governance with terraform
 

Último

Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
Nauman Safdar
 

Último (20)

Falcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investorsFalcon Invoice Discounting: The best investment platform in india for investors
Falcon Invoice Discounting: The best investment platform in india for investors
 
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book nowKalyan Call Girl 98350*37198 Call Girls in Escort service book now
Kalyan Call Girl 98350*37198 Call Girls in Escort service book now
 
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAIGetting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
Getting Real with AI - Columbus DAW - May 2024 - Nick Woo from AlignAI
 
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All TimeCall 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
Call 7737669865 Vadodara Call Girls Service at your Door Step Available All Time
 
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGBerhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Berhampur 70918*19311 CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
Mckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for ViewingMckinsey foundation level Handbook for Viewing
Mckinsey foundation level Handbook for Viewing
 
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDINGParadip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
Paradip CALL GIRL❤7091819311❤CALL GIRLS IN ESCORT SERVICE WE ARE PROVIDING
 
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur DubaiUAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
UAE Bur Dubai Call Girls ☏ 0564401582 Call Girl in Bur Dubai
 
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book nowPARK STREET 💋 Call Girl 9827461493 Call Girls in  Escort service book now
PARK STREET 💋 Call Girl 9827461493 Call Girls in Escort service book now
 
New 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck TemplateNew 2024 Cannabis Edibles Investor Pitch Deck Template
New 2024 Cannabis Edibles Investor Pitch Deck Template
 
Cannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 UpdatedCannabis Legalization World Map: 2024 Updated
Cannabis Legalization World Map: 2024 Updated
 
HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024HomeRoots Pitch Deck | Investor Insights | April 2024
HomeRoots Pitch Deck | Investor Insights | April 2024
 
WheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond InsightsWheelTug Short Pitch Deck 2024 | Byond Insights
WheelTug Short Pitch Deck 2024 | Byond Insights
 
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
Horngren’s Cost Accounting A Managerial Emphasis, Canadian 9th edition soluti...
 
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service AvailableNashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
Nashik Call Girl Just Call 7091819311 Top Class Call Girl Service Available
 
Phases of Negotiation .pptx
 Phases of Negotiation .pptx Phases of Negotiation .pptx
Phases of Negotiation .pptx
 
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
Lundin Gold - Q1 2024 Conference Call Presentation (Revised)
 
GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book nowGUWAHATI 💋 Call Girl 9827461493 Call Girls in  Escort service book now
GUWAHATI 💋 Call Girl 9827461493 Call Girls in Escort service book now
 
Arti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdfArti Languages Pre Seed Teaser Deck 2024.pdf
Arti Languages Pre Seed Teaser Deck 2024.pdf
 
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
Ooty Call Gril 80022//12248 Only For Sex And High Profile Best Gril Sex Avail...
 

DevOps in a Regulated and Embedded Environment (AgileDC)

  • 1. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 1 Agility. Security. Delivered. DevOps in a Regulated and Embedded Environment By: Arjun Comar (Was DevOps on a Legacy Project) twitter: @arjuncomar email: arjun.comar@coveros.com
  • 2. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 2 Agenda • About Me • Agile, DevOps, and Medical Devices: What’s the Problem? • Git Flow in a Regulated World • Expect to Deploy • Scaling for Success and Resource Management • Questions twitter: @arjuncomar email: arjun.comar@coveros.com
  • 3. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 3 About Me • B.S. in Computer Science from the Rose- Hulman Institute of Technology • Worked on everything from the Linux kernel to computer vision. • Interested in software quality and correctness. • Been with Coveros for ~2.5 years. • Run the local HaskellDC meetup group. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 4. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 4 About Coveros • Coveros builds security-critical applications using agile methods. • Coveros Services • Agile transformations • Agile development and testing • DevOps and continuous integration • Application security analysis • Agile & Security training • Government qualifications • DCAA approved rates and accounting • TS facility clearance Areas of Expertise twitter: @arjuncomar email: arjun.comar@coveros.com
  • 5. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS RESERVED. 5 Select Clients twitter: @arjuncomar email: arjun.comar@coveros.com
  • 6. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 6 Medical Devices and the Law • It isn’t sufficient to write the code, release requires regulatory approval. • Approval is per feature (epic) • Contingent on development, testing, risk mitigation, etc. • We want short-lived branches, but… • If we don’t get approval for one feature, business still wants to release the others • Unmerge all the feature branches that went into an epic? • Further requirements around documentation, especially: • Design • Testing • Risk Management twitter: @arjuncomar email: arjun.comar@coveros.com
  • 7. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 7 Legacy Problems • C code, embedded device target • cross compilation: Windows -> QNX • Some modules only built on WinXP • Manual build, deploy, test process • Custom hardware, custom firmware • Old codebase, not written to be unit tested • Unit test execution requires target environment • Rough order of magnitude, 200 kloc codebase • Hardware platform ~25 years old twitter: @arjuncomar email: arjun.comar@coveros.com
  • 8. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 8 Integration and Deployment • Manual builds, deploy to unit test? • Unmaintained deployment scripts • Written by a contractor in ksh, • Last maintainer had already left the company • Working deployments flashed unit with usb stick and physical dongle • Rewrite with Chef? ...Ansible? … Bash? • try: sh run over telnet • No ruby, python, perl, bash, ssh, dhcp • Network deployments/updates to a device that goes in a human being…? twitter: @arjuncomar email: arjun.comar@coveros.com
  • 9. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 9 Feedback Cycles • Deployments took ~30 minutes and required physical interaction through the process • Testing involved long protocols with detailed and very particular steps • ~5-6 weeks for the test team, maybe 8 weeks, but at least 3-4. • Release cycle on the order of years. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 10. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 10 Resource Needs and Team Size • Business wanted multiple features in development in parallel • Different tests take different lengths of time to run • even when automated • seconds -> weeks • Business needed 4 teams like the one they had • Continuous integration targets, unit test targets, deployment testing targets, full functional test targets, partially automated test targets • Performance, reliability, security, durability, etc.? twitter: @arjuncomar email: arjun.comar@coveros.com
  • 11. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 11 Solutions One thing at a time... twitter: @arjuncomar email: arjun.comar@coveros.com
  • 12. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 12 Git Flow in a Regulated World twitter: @arjuncomar email: arjun.comar@coveros.com
  • 13. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 13 Git Workflows • Linux Kernel: benevolent dictator, many trusted lieutenants, an insane number of contributors. • GitHub: Single (or small team) of maintainers, contributors submit pull-requests • Corporate git usage: Trusted team of developers, co-maintain shared repository twitter: @arjuncomar email: arjun.comar@coveros.com
  • 14. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 14 Enter: Git Flow twitter: @arjuncomar email: arjun.comar@coveros.com
  • 15. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 15 But I can’t merge back daily... • No, really. Daily merges back to develop means pulling an epic out requires a virtually impossible unmerge. • Might be legally required not to go forward with a feature • Can’t get approval until feature is developed and tested with known risks documented and mitigated • Business still wants to release what they can twitter: @arjuncomar email: arjun.comar@coveros.com
  • 16. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 16 Can’t not integrate... • Long lived lines of development, all separate • Tested independently prior to release • Business wants to release, integrate necessary branches and… • Disaster: merge conflicts, retest everything, unknown interactions everywhere twitter: @arjuncomar email: arjun.comar@coveros.com
  • 17. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 17 Extending the workflow to deal with regulation Extend the git flow model Keep epic specific code in ‘develop/epic- name’ branches Use ‘feature/epic-name/feature-name’ branches for daily work Merge these back daily! Epic branches get merged back for a release twitter: @arjuncomar email: arjun.comar@coveros.com
  • 18. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 18 Integrating Continuously • Use tooling to manage the problem for you • Have Jenkins (or your CI stack of choice) do builds by merging develop with the epic branches first • develop holds code that will be released, features that conflict must be fixed • Run the normal deployment and testing cycle on these builds • merge conflicts are failed builds twitter: @arjuncomar email: arjun.comar@coveros.com
  • 19. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 19 Integrating even more continuously • Still need to know if there’s potential conflicts between epic branches • fail early, fail often, right? • Take all the epic branches and merge them with develop • Run a full build/deploy/test cycle on this mess as well. • Any failures found -> failed build • If it doesn’t cleanly merge, we can’t release, right? • The software should always be ready to release; make it a business decision, not a technical one. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 20. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 20 Digging deeper to unearth conflict • Better error detection and reporting: • If we merge everything together, it looks like the later branches cause conflicts more often • Branches that conflict exclude each other • Find conflicting pairs and report them both as failed • Conflicts may only show up with the interaction of 3+ branches • But this gets exponentially hard to detect twitter: @arjuncomar email: arjun.comar@coveros.com
  • 21. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 21 Do what you can • Merge all possible epic branch pairs together, track+report failures • Report these failures once or the team will ignore you... • Branches that cleanly merge with everything get merged together with development and built • This assesses the health of the software as it exists at this moment • This might be expensive, so do it overnight. • Shortcuts: • If ‘A’ merges with ‘B’, then ‘B’ merges with ‘A’ • ‘A’ always merges with ‘A’ • (You only need the top half of the n x n matrix) twitter: @arjuncomar email: arjun.comar@coveros.com
  • 22. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 22 This is a lot of work... • Long-lived branches are hard to deal with. • You could even go further and build the sets of conflicting branches that can be merged together • This is really hard; it’s easier to ask the team to fix the mess. • If you don’t have to do it, don’t. • You probably don’t unless regulatory constraints make you. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 23. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 23 Expect to Deploy What a lifesaver twitter: @arjuncomar email: arjun.comar@coveros.com
  • 24. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 24 Expect? • Tcl scripting language used to automate interactive programs • ...like telnet and ftp • Was used to automate testing way back in the day • Turns out to be rather perfect for scripting deployments, testing, etc. in this tool restricted environment • sh, ksh, telnet, ftp • not: bash, python, ruby, ssh, perl, etc. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 25. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 25 Wait, why not use ... • Yes, we could have tried to beat that wall down • Lots of effort/expertise to produce a working build of python for the target environment • QNX support would probably have been willing to help • But loading new software onto the target environment to increase its capabilities is fundamentally risky • Business was understandably risk averse • Rather limited DevOps team at this point of me, myself, and I. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 26. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 26 A little expect script $ cat login.expect #!/usr/bin/expect set timeout 20 set addr [lindex $argv 0] set user [lindex $argv 1] set pass [lindex $argv 2] spawn telnet $addr expect "login:" send "$userr" expect "Password:" send "$passr" expect "#" interact twitter: @arjuncomar email: arjun.comar@coveros.com
  • 27. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 27 Adding a little abstraction proc login { addr user pass } { spawn telnet $addr expect { timeout { send_user "Could not connectn"; exit 1 } eof { send_user "Connection refusedn"; exit 1 } "login:" } send "$userr" expect "Password:" send "$passr" expect { timeout { send_user "Failed to login.n"; exit 1 } "#" } } twitter: @arjuncomar email: arjun.comar@coveros.com
  • 28. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 28 Separation of Concerns • It only takes minor modifications to use the same logic to connect to ftp • Use ftp to upload deployment archive, install sh script • Use telnet to set permissions and execute install script on archive • Deployment logic is now separate from connecting, setup, etc. • “talking to the target” vs “doing stuff on the target” • This is exactly the separation chef/puppet/ansible provide • (They also provide a whole lot of other value as well, but it’s nice to recover any of it!) twitter: @arjuncomar email: arjun.comar@coveros.com
  • 29. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 29 Towards a deployment framework • How many environments like this are out there? • limited tooling, embedded platform, etc. • If there are a lot… we have the start of a deployment framework to target these environments • Dependencies are very minimal, can be used to target virtually anything • With work, we could get something idempotent with clean modularity and composability. • A whole lot of work… Is there a market that needs this? twitter: @arjuncomar email: arjun.comar@coveros.com
  • 30. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 30 Scaling for Success and Resource Management twitter: @arjuncomar email: arjun.comar@coveros.com
  • 31. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 31 Resource Needs • Embedded device with potential hardware attachments for particular tests -- virtualization is out. • Unit tests need to run in the target environment so one target is needed at a minimum just for rapid feedback CI. • Basic integration testing (i.e. devint env) takes ~1 min to ~ 10 mins • Fully automated functional testing takes ~10 mins to 1+ hours to run (i.e. test env) • Partially automated tests require interaction, need another target. • Longer term testing (i.e. stress, durability, performance, etc.) takes weeks and needs its own target. • ~5 targets minimum to support development for basic CI/CD twitter: @arjuncomar email: arjun.comar@coveros.com
  • 32. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 32 Tackling Resource Allocation • If a new build kicks off and reaches deployment testing while the previous round of smoke testing is still on-going, what happens? • Probably: target gets bricked as OS level code is updated while the machine is in use. • Even if the pipeline is built carefully so these things can’t happen, there’s always PEBKAC • Deployment and testing tools need to be smart enough to check if a console is available before attempting to use it • We need a resource allocator... twitter: @arjuncomar email: arjun.comar@coveros.com
  • 33. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 33 Making a first pass • Track the target state on the target • Use an old Unix trick -- drop a lock file in a well-known spot, and make tools attempt to acquire the lock before using the target • Pros: Extremely simple to implement and use; it’s a really simple pair of shell scripts. • Cons: If the lockfile isn’t cleaned up, the target is unavailable; if the tool (user) doesn’t check for the lock, they could still cause problems. It’s hard to track what targets are in use where, there’s no centralized management. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 34. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 34 Aside: Jenkins Pipeline • Specifying the pipeline in groovy instead of shell/jenkins xml prevented a lot of bugs. • acquireLock and releaseLock have simple contracts and provide strong guarantees with try/finally idiom. • This is tricky/hard to achieve with traditional jenkins. def locking(target, action) { try { acquireLock(target) action() } finally { releaseLock(target) } } downloadTests(latest) locking(targetAddr) { deploy(targetAddr) runTests(targetAddr, myBuild, testTags) } twitter: @arjuncomar email: arjun.comar@coveros.com
  • 35. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 35 Multiple teams, multiple workstreams • Goal is to reduce cycle time. If one team has to wait for feedback for another team’s build to finish, we’re wasting time. • Key takeaway: we can’t effectively share environments between parallel streams of development. • Business wanted ~4 streams of work progressing in parallel. • Team needs to be able to support old releases via hotfixes (~2 old, previous release, current stream of development). • Hardware/firmware platform changes between releases • Test automation team needs to an environment to test their tests. • DevOps team needs to be able to test pipeline changes. • ~40 target machines to effectively support CI/CD pipeline. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 36. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 36 That’s a lot of equipment... • Where do you put it all? • Shelving/rackspace, cooling, switches, networking… • Units are expensive; if they aren’t in use/needed, business is going to get annoyed. • Hard to track utilization, load, etc. from a really decentralized place. • We might also be able to save money / use fewer targets if we’re more intelligent about allocating them; i.e. allocate on demand. • Centralization also means we can start hitting nice-to-haves: • console access from the web browser for debugging • status/health check daemon reporting to the manager twitter: @arjuncomar email: arjun.comar@coveros.com
  • 37. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 37 Centralized Resource Management • Pool available targets, expose REST API to acquire a target for use, release a target, check a target, etc. • Track target status, usage metrics, target requester statistics in backend database. • Set up a simple frontend to display statistics about usage, provide a manual form to acquire a target for manual/ad-hoc testing, etc. • Like a library; acquire target for duration, get grumpy emails if it’s not returned in time. • Can be easily expanded to provide additional services over time. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 38. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 38 Lightning Quick Recap • Integrate continuously to keep software testable, increase quality, and build confidence. • Prioritize the delivery of working software. • Fail early, fail often. • Make your tools serve your needs. • Set yourself up to success -- plan ahead to cover scaling needs. twitter: @arjuncomar email: arjun.comar@coveros.com
  • 39. © COPYRIGHT 2016 COVEROS, INC. ALL RIGHTS 39 That was fast... • There’s a lot more I’d love to talk about. • Please feel free to ask me questions during the break or afterwards. • Thanks for your time! twitter: @arjuncomar email: arjun.comar@coveros.com