lviv pmday: Дов Німрац Як зробити процес continuous integration...
TRANSCRIPT
E-Mail: [email protected]: dovnmr
About me
• 30 years in R&D
• 17 years in Israel HighTech
• ECI, Telrad, RAD, Audiocodes companies
• HW, SW, Mechanical design engineer
• Project & Product Manager
• Business developer for EMEA & CIS countries
• 22 publications, US patent
• Counseling & SW development teaching
E-Mail: [email protected]: dovnmr
What this speech is about?
• Immutable concepts in R&D
• Major CD fails
• Solutions
E-Mail: [email protected]: dovnmr
Basement - SDLC
The smaller radius creates
smaller amplitude. It closer
to the line.
E-Mail: [email protected]: dovnmr
SDLC pyramid view
Requirement Analysis
Design
Implementation
Testing
EvaluationRefactoring
V - Model
Bug fixing
E-Mail: [email protected]: dovnmr
Monitoring and testing
Infrastructure configuration
CI Server
CD parts
Version control
E-Mail: [email protected]: dovnmr
Three primary tasks for effective CD
• The trouble with monolithic codebases and approaches
to break it down
• Designing the test suite for optimal feedback
• Setting up a deployment pipeline as the backbone of CD
E-Mail: [email protected]: dovnmrMonolithic code immediate symptoms
–«Adagissimo»
• Sluggish build
• App start-up time
• Slow Auto test
E-Mail: [email protected]: dovnmrHarmful impact
Less ownership for team members – ”broken build not
mine”
E-Mail: [email protected]: dovnmr
Monolithic code, Harmful impact
• Slow build bushes devs not to do it even locally before ci
• Only night CI server build or rarely
• Time cost for tasks are Up to (x10 more) x N devs
• Many manual tests required
• This creates a lot of friction in the pipeline.
E-Mail: [email protected]: dovnmr
Solution - Decomposing the codebase
Service 1
Service 2
Service 2
REST
DLL 1
DLL 2
DLL 3
BUILD
Compile Flags
The Entropy principle works in the development
After build
E-Mail: [email protected]: dovnmr
The Scale Cube
Scale by cloning
Scale by split differentservices
Resource duplication
Functional decomposition
Data Partitioning
Scale by splitting similar services
Z
X
Y
E-Mail: [email protected]: dovnmr
The Scale Cube Z axis
• Scaled as X but for data subset
• Commonly used:• Scale DB by primary key
• Treatment customers by SLA
• Scale DB or Application
• Combine result in later stage
• Each server only deals with a subset of the data.
• Improves utilization (memory usage, I/O), reliability, performance
• But only Y-axis scaling solve application complexity grow
E-Mail: [email protected]: dovnmrTesting & Problem areas
Requirement Analysis
Design
Implementation
Testing
Evaluation Technical
Problems
Architectural
or
Business
ProblemsBug
fixing
Refactoring
E-Mail: [email protected]: dovnmr
Testing pyramid
Automated Unit Test
Code reading
Auto API test
Auto Integration
Auto component
Auto
GUI
Test
Manual
Technical
Problems
Architectural
or
Business
Problems
E-Mail: [email protected]: dovnmrAQA daily mail
E-Mail: [email protected]: dovnmr
Deployment Pipeline
Commit Stage
Auto Acceptance
Testing
Auto Capacity Testing
Manual Testing
Release
Compile
Unit test
Analysis
Build
Functional
Testing
Performanc
e
Load test
Business
logic
Two
button
Deploy
E-Mail: [email protected]: dovnmr
TBD
TRUNK
Release 2.0
MB
Release 1.0
M
B
*Release 1.0M
Release 1.1
MB
M
M
E-Mail: [email protected]: dovnmrCommon anti-patterns with
branch based workflows
• Long-lived feature branches
• Branch per environment (Dev, QA, Staging and
Production)
• Shadow process flow steps - limiting work in process
(WIP)
E-Mail: [email protected]: dovnmr
Conclusions – Effective CD when:
• Short Dev Life Cycle
• Non monolithic code with Library and Services
• Correct test suite
• Trunk Base Development
• Dev pipeline without shadow steps