SlideShare a Scribd company logo
Marco Brandizi <marco.brandizi@rothamsted.ac.uk>
30/4/2021
Continuos Integration
@Knetminer
Find this presentation on SlidesShare
Background source: https://tinyurl.com/ydq2e6xn
What's Continuous Integration, by the
way?
Image source: https://pt.slideshare.net/thyagk/continuous-integration-system/3
Typical CI build workflow
1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP
2. Get and set variables (eg, github and Nexus credentials)
3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user)
4. "mvn deploy", or "mvn install"
1. depending on conditions (eg, if we're in the master branch and not in a pull request)
5. Are we releasing?
1. Tag github with new version and git-commit
2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user)
6. Local git commits (eg, because of POM's new versions and tagging)? => git push
Our (and not only)
Issues
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
• Pretty much the same for all
Java/Maven projects
• Copy-pasting is hard to maintain
• Can't we factorise?
Our (and not only)
Issues
• CIs in my past five years:
• Until 2016: Bamboo
• 2017-2021: Jenkins
• 2018-2020: Travis
• 2020-2021: GitHub Actions
• 2022 Yet another one?!
• Every time:
• New system to learn
• New syntax to describe CI jobs to learn
• Migrating previous jobs and test
• Migrating settings (eg, credentials)
• Can't we make it portable?
• (At least a little more?)
My Approach
Just plug-in in your CI
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
Your CI job (see archetype-resources/.github/workflows/build.yml)
mkdir -p ci-build
<Download install.sh>
./ci-build/install.sh
# was downloaded together with others (eg, maven-settings.xml)
./ci-build/build.sh
Need an example?
https://github.com/Rothamsted/rdf2pg/blob/master/.github/workflows/build.yml
Customisation
1. Pre-check if build is needed
2. Settings
3. Pre-build Release ops
4. Maven (includes deployment)
5. Post-build release ops
6. Git Push
• Uhm... aren't you throwing your CI
workflow at me?
• I've had the problem myself
• Solution: script hooks
Customisation with script hooks
1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP
2. Get and set variables (eg, github and Nexus credentials)
build-begin.sh
3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user)
4. build-before.sh
( "mvn deploy", or "mvn install" ) OR build-body.sh
build-after.sh
5. Are we releasing?
1. Tag github with new version and git-commit
2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user)
6. Local git commits (eg, because of POM's new versions and tagging)? => git push
build-end.sh
Customisation with script
hooks
Your CI job
1. Download
2. Run
1. Pre-check if build is needed
2. Settings
build-begin.sh
3. Pre-build Release ops
4. build-before.sh
Maven (includes deployment) OR build-body.sh
build-after.sh
5. Post-build release ops
6. Git Push
build-end.sh
Just add your hooks as needed
1. to <your-repo>/ci-build/
2. Only the ones you need
3. They see build variables (eg, IS_RELEASE,
NEW_RELEASE_VER)
4. They can expose their own variables (eg, for the next hook)
1. Or change existing ones (be careful)
Need an example?
https://github.com/Rothamsted/knetminer/tree/master/ci-build
• You'll see customisations for:
• Settings custom variables (docker_tag)
• Build on top of our own Docker-based environment, instead of GH Actions environment
• Much more portable
• post-build actions to push new Docker images (including release images)
• Invocation of Jenkins API to trigger internal deployment jobs
(which redeploy from the new Docker images)
Final notes
• build.sh isn't the bible, we can change/improve as we need, eg
• more hooks
• See if it can be adapted to other languages (eg, Python) or a new one is needed
• DO NOT copy it locally just because it doesn't fit your needs, try to reuse stuff!
• Please let me know about proposed/made changes
• Are there alternatives? => https://github.com/rosineygp/mkdkr
• + Entirely based on Docker + Make, more portable
• - Not sure using Docker even for the simplest builds is worth
• - I know Make very little, not sure I want to depend on it
• ~ Requires some CI configuration anyway (eg, to set up credentials and alike, should be solved with a
credential manager)
• - Presumably, would require volume mapping to manage the cache (and cache configuration at CI level)

More Related Content

What's hot (20)

PDF
FOSDEM 2017: GitLab CI
OlinData
 
PPTX
Github basics
Radoslav Georgiev
 
PPTX
Git extension-training
Eric Guo
 
PPTX
GitHub Presentation
BrianSchilder
 
PDF
Social Coding GitHub 2015
Kenu, GwangNam Heo
 
PPTX
Gitflow. A successful Git branching model.
documarezc
 
PPTX
Migrating To GitHub
Sridhar Peddinti
 
PPTX
Workflows using Git GitHub | Edureka
Edureka!
 
PPTX
Git,Github,How to host using Github
Sujata Regoti
 
PPTX
Github
MeetPatel710
 
PDF
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
PDF
Intro to Git, GitHub, and Devpost
Andrew Kerr
 
PDF
Git Version Control System
KMS Technology
 
PDF
Intro to Git and GitHub
Panagiotis Papadopoulos
 
PPTX
Introduction to git & GitHub
Poornachandrakashi
 
PPT
Git101
Jason Noble
 
PDF
What is version control software and why do you need it?
Leonid Mamchenkov
 
PDF
Git - An Introduction
Behzad Altaf
 
PPTX
Intro to git and git hub
Venkat Malladi
 
KEY
Travis CI
bsiggelkow
 
FOSDEM 2017: GitLab CI
OlinData
 
Github basics
Radoslav Georgiev
 
Git extension-training
Eric Guo
 
GitHub Presentation
BrianSchilder
 
Social Coding GitHub 2015
Kenu, GwangNam Heo
 
Gitflow. A successful Git branching model.
documarezc
 
Migrating To GitHub
Sridhar Peddinti
 
Workflows using Git GitHub | Edureka
Edureka!
 
Git,Github,How to host using Github
Sujata Regoti
 
Github
MeetPatel710
 
Drupal 8 DevOps . Profile and SQL flows.
Andrii Podanenko
 
Intro to Git, GitHub, and Devpost
Andrew Kerr
 
Git Version Control System
KMS Technology
 
Intro to Git and GitHub
Panagiotis Papadopoulos
 
Introduction to git & GitHub
Poornachandrakashi
 
Git101
Jason Noble
 
What is version control software and why do you need it?
Leonid Mamchenkov
 
Git - An Introduction
Behzad Altaf
 
Intro to git and git hub
Venkat Malladi
 
Travis CI
bsiggelkow
 

Similar to Continuos Integration @Knetminer (20)

PPTX
Git
Shinu Suresh
 
PDF
DrupalCon Los Angeles - Continuous Integration Toolbox
Andrii Podanenko
 
PPT
An introduction to maven gradle and sbt
Fabio Fumarola
 
PPTX
MoldCamp - multidimentional testing workflow. CIBox.
Andrii Podanenko
 
PDF
Gitlab and Lingvokot
Lingvokot
 
PPTX
Git usage (Basics and workflow)
Yeasin Abedin
 
PPTX
Git essential training & sharing self
Chen-Tien Tsai
 
PPT
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
 
PPTX
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
PPT
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 
PDF
[2015/2016] Collaborative software development with Git
Ivano Malavolta
 
PPTX
Git training (basic)
Arashdeepkaur16
 
PPTX
Git hub visualstudiocode
Rolands Krumbergs
 
PDF
git and github
Darren Oakley
 
PPT
Collaboration With Git and GitHub
Alec Clews
 
PPTX
GITHUB_ACTIONS_CICD_OVERVIEW_FOR_BEGINNERS
Mithilesh Singh
 
PPTX
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
PPTX
GIT in a nutshell
alignan
 
PDF
Introduction to GitHub Actions
Knoldus Inc.
 
PDF
DevOps Workshop Part 1
GDSC UofT Mississauga
 
DrupalCon Los Angeles - Continuous Integration Toolbox
Andrii Podanenko
 
An introduction to maven gradle and sbt
Fabio Fumarola
 
MoldCamp - multidimentional testing workflow. CIBox.
Andrii Podanenko
 
Gitlab and Lingvokot
Lingvokot
 
Git usage (Basics and workflow)
Yeasin Abedin
 
Git essential training & sharing self
Chen-Tien Tsai
 
391Lecture0909 Vision control of git.ppt
GevitaChinnaiah
 
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
CSE 390 Lecture 9 - Version Control with GIT
PouriaQashqai1
 
[2015/2016] Collaborative software development with Git
Ivano Malavolta
 
Git training (basic)
Arashdeepkaur16
 
Git hub visualstudiocode
Rolands Krumbergs
 
git and github
Darren Oakley
 
Collaboration With Git and GitHub
Alec Clews
 
GITHUB_ACTIONS_CICD_OVERVIEW_FOR_BEGINNERS
Mithilesh Singh
 
Introduction to GitHub, Open Source and Tech Article
PRIYATHAMDARISI
 
GIT in a nutshell
alignan
 
Introduction to GitHub Actions
Knoldus Inc.
 
DevOps Workshop Part 1
GDSC UofT Mississauga
 
Ad

More from Rothamsted Research, UK (20)

PPTX
FAIR Agronomy, where are we? The KnetMiner Use Case
Rothamsted Research, UK
 
PPTX
Interoperable Data for KnetMiner and DFW Use Cases
Rothamsted Research, UK
 
PPTX
AgriSchemas: Sharing Agrifood data with Bioschemas
Rothamsted Research, UK
 
PPTX
Publishing and Consuming FAIR Data A Case in the Agri-Food Domain
Rothamsted Research, UK
 
PDF
Better Data for a Better World
Rothamsted Research, UK
 
PPTX
AgriSchemas Progress Report
Rothamsted Research, UK
 
PPTX
AgriFood Data, Models, Standards, Tools, Use Cases
Rothamsted Research, UK
 
PDF
Notes about SWAT4LS 2018
Rothamsted Research, UK
 
PPTX
Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...
Rothamsted Research, UK
 
PPTX
Knetminer Backend Training, Nov 2018
Rothamsted Research, UK
 
PPTX
A Preliminary survey of RDF/Neo4j as backends for KnetMiner
Rothamsted Research, UK
 
PDF
Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...
Rothamsted Research, UK
 
PDF
Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...
Rothamsted Research, UK
 
ODP
graph2tab, a library to convert experimental workflow graphs into tabular for...
Rothamsted Research, UK
 
PDF
Interoperable Open Data: Which Recipes?
Rothamsted Research, UK
 
PDF
Linked Data with the EBI RDF Platform
Rothamsted Research, UK
 
PDF
BioSD Linked Data: Lessons Learned
Rothamsted Research, UK
 
PDF
BioSD Tutorial 2014 Editition
Rothamsted Research, UK
 
PDF
myEquivalents, aka a new cross-reference service
Rothamsted Research, UK
 
PDF
Dev 2014 LOD tutorial
Rothamsted Research, UK
 
FAIR Agronomy, where are we? The KnetMiner Use Case
Rothamsted Research, UK
 
Interoperable Data for KnetMiner and DFW Use Cases
Rothamsted Research, UK
 
AgriSchemas: Sharing Agrifood data with Bioschemas
Rothamsted Research, UK
 
Publishing and Consuming FAIR Data A Case in the Agri-Food Domain
Rothamsted Research, UK
 
Better Data for a Better World
Rothamsted Research, UK
 
AgriSchemas Progress Report
Rothamsted Research, UK
 
AgriFood Data, Models, Standards, Tools, Use Cases
Rothamsted Research, UK
 
Notes about SWAT4LS 2018
Rothamsted Research, UK
 
Getting the best of Linked Data and Property Graphs: rdf2neo and the KnetMine...
Rothamsted Research, UK
 
Knetminer Backend Training, Nov 2018
Rothamsted Research, UK
 
A Preliminary survey of RDF/Neo4j as backends for KnetMiner
Rothamsted Research, UK
 
Towards FAIRer Biological Knowledge Networks 
Using a Hybrid Linked Data 
and...
Rothamsted Research, UK
 
Behind the Scenes of KnetMiner: Towards Standardised and Interoperable Knowle...
Rothamsted Research, UK
 
graph2tab, a library to convert experimental workflow graphs into tabular for...
Rothamsted Research, UK
 
Interoperable Open Data: Which Recipes?
Rothamsted Research, UK
 
Linked Data with the EBI RDF Platform
Rothamsted Research, UK
 
BioSD Linked Data: Lessons Learned
Rothamsted Research, UK
 
BioSD Tutorial 2014 Editition
Rothamsted Research, UK
 
myEquivalents, aka a new cross-reference service
Rothamsted Research, UK
 
Dev 2014 LOD tutorial
Rothamsted Research, UK
 
Ad

Recently uploaded (20)

PDF
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
PDF
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
PDF
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
PPTX
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
PDF
introduction to computer hardware and sofeware
chauhanshraddha2007
 
PPTX
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
PPTX
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
PPTX
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
PDF
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
PDF
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
PDF
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
PDF
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
PPTX
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
PDF
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
PDF
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
PDF
Market Insight : ETH Dominance Returns
CIFDAQ
 
PPTX
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
PDF
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
PDF
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 
Economic Impact of Data Centres to the Malaysian Economy
flintglobalapac
 
Research-Fundamentals-and-Topic-Development.pdf
ayesha butalia
 
The Future of Mobile Is Context-Aware—Are You Ready?
iProgrammer Solutions Private Limited
 
Dev Dives: Automate, test, and deploy in one place—with Unified Developer Exp...
AndreeaTom
 
introduction to computer hardware and sofeware
chauhanshraddha2007
 
Applied-Statistics-Mastering-Data-Driven-Decisions.pptx
parmaryashparmaryash
 
IT Runs Better with ThousandEyes AI-driven Assurance
ThousandEyes
 
What-is-the-World-Wide-Web -- Introduction
tonifi9488
 
Data_Analytics_vs_Data_Science_vs_BI_by_CA_Suvidha_Chaplot.pdf
CA Suvidha Chaplot
 
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
bashnahara11
 
OFFOFFBOX™ – A New Era for African Film | Startup Presentation
ambaicciwalkerbrian
 
Make GenAI investments go further with the Dell AI Factory
Principled Technologies
 
Trying to figure out MCP by actually building an app from scratch with open s...
Julien SIMON
 
AI Code Generation Risks (Ramkumar Dilli, CIO, Myridius)
Priyanka Aash
 
Structs to JSON: How Go Powers REST APIs
Emily Achieng
 
Peak of Data & AI Encore - Real-Time Insights & Scalable Editing with ArcGIS
Safe Software
 
Market Insight : ETH Dominance Returns
CIFDAQ
 
AI and Robotics for Human Well-being.pptx
JAYMIN SUTHAR
 
How Open Source Changed My Career by abdelrahman ismail
a0m0rajab1
 
State-Dependent Conformal Perception Bounds for Neuro-Symbolic Verification
Ivan Ruchkin
 

Continuos Integration @Knetminer

  • 1. Marco Brandizi <[email protected]> 30/4/2021 Continuos Integration @Knetminer Find this presentation on SlidesShare Background source: https://tinyurl.com/ydq2e6xn
  • 2. What's Continuous Integration, by the way? Image source: https://pt.slideshare.net/thyagk/continuous-integration-system/3
  • 3. Typical CI build workflow 1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP 2. Get and set variables (eg, github and Nexus credentials) 3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user) 4. "mvn deploy", or "mvn install" 1. depending on conditions (eg, if we're in the master branch and not in a pull request) 5. Are we releasing? 1. Tag github with new version and git-commit 2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user) 6. Local git commits (eg, because of POM's new versions and tagging)? => git push
  • 4. Our (and not only) Issues 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push • Pretty much the same for all Java/Maven projects • Copy-pasting is hard to maintain • Can't we factorise?
  • 5. Our (and not only) Issues • CIs in my past five years: • Until 2016: Bamboo • 2017-2021: Jenkins • 2018-2020: Travis • 2020-2021: GitHub Actions • 2022 Yet another one?! • Every time: • New system to learn • New syntax to describe CI jobs to learn • Migrating previous jobs and test • Migrating settings (eg, credentials) • Can't we make it portable? • (At least a little more?)
  • 7. Just plug-in in your CI 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push Your CI job (see archetype-resources/.github/workflows/build.yml) mkdir -p ci-build <Download install.sh> ./ci-build/install.sh # was downloaded together with others (eg, maven-settings.xml) ./ci-build/build.sh
  • 9. Customisation 1. Pre-check if build is needed 2. Settings 3. Pre-build Release ops 4. Maven (includes deployment) 5. Post-build release ops 6. Git Push • Uhm... aren't you throwing your CI workflow at me? • I've had the problem myself • Solution: script hooks
  • 10. Customisation with script hooks 1. Is build needed (no changes in a scheduled job or "[ci skip]")? => STOP 2. Get and set variables (eg, github and Nexus credentials) build-begin.sh 3. Are we releasing? => change version in Maven POMs (eg, 2.0, parameter sent by the user) 4. build-before.sh ( "mvn deploy", or "mvn install" ) OR build-body.sh build-after.sh 5. Are we releasing? 1. Tag github with new version and git-commit 2. Change POMs with next snapshot version (eg, 2.0.1-SNAPSHOT, parameter sent by the user) 6. Local git commits (eg, because of POM's new versions and tagging)? => git push build-end.sh
  • 11. Customisation with script hooks Your CI job 1. Download 2. Run 1. Pre-check if build is needed 2. Settings build-begin.sh 3. Pre-build Release ops 4. build-before.sh Maven (includes deployment) OR build-body.sh build-after.sh 5. Post-build release ops 6. Git Push build-end.sh Just add your hooks as needed 1. to <your-repo>/ci-build/ 2. Only the ones you need 3. They see build variables (eg, IS_RELEASE, NEW_RELEASE_VER) 4. They can expose their own variables (eg, for the next hook) 1. Or change existing ones (be careful)
  • 12. Need an example? https://github.com/Rothamsted/knetminer/tree/master/ci-build • You'll see customisations for: • Settings custom variables (docker_tag) • Build on top of our own Docker-based environment, instead of GH Actions environment • Much more portable • post-build actions to push new Docker images (including release images) • Invocation of Jenkins API to trigger internal deployment jobs (which redeploy from the new Docker images)
  • 13. Final notes • build.sh isn't the bible, we can change/improve as we need, eg • more hooks • See if it can be adapted to other languages (eg, Python) or a new one is needed • DO NOT copy it locally just because it doesn't fit your needs, try to reuse stuff! • Please let me know about proposed/made changes • Are there alternatives? => https://github.com/rosineygp/mkdkr • + Entirely based on Docker + Make, more portable • - Not sure using Docker even for the simplest builds is worth • - I know Make very little, not sure I want to depend on it • ~ Requires some CI configuration anyway (eg, to set up credentials and alike, should be solved with a credential manager) • - Presumably, would require volume mapping to manage the cache (and cache configuration at CI level)