Skip to content

Instantly share code, notes, and snippets.

@OndraZizka
Last active February 24, 2018 00:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save OndraZizka/9cabfe1ea3357352089e40598a24a3d3 to your computer and use it in GitHub Desktop.
Save OndraZizka/9cabfe1ea3357352089e40598a24a3d3 to your computer and use it in GitHub Desktop.
CITC CICD for sequencediagram.org
title Collab CI pipeline
space
== Commit verification job - project integration tests == #gold
entryspacing 0.4
#actor Space for widening the source box...............................
actor Commiter
participant "Stash\n" as Stash #DodgerBlue
participant "Jenkins\n" as Jenkins #orange
lifelinecolor Jenkins #maroon
participant "Maven\n" as Maven #lightgreen
participant Tests #gold
lifelinecolor Tests #goldenrod
participant "Kubernetes\nenvironment" as Kube #DeepSkyBlue
participant "Kubernetes\nRepo" as KubeRepo #Violet
lifelinecolor KubeRepo #Violet
participant "Version\nMatrix" as Matrix #PapayaWhip
#create Matrix
note over Stash,Matrix: Note: This diagram uses arrow orientation as data flow direction rather than caller/callee.
parallel
Commiter-#steelblue>>Stash:creates a PR\nto the service
Stash-#darkorange>>Jenkins: webhook
activate Jenkins #orange
parallel off
Stash-#steelblue>>Jenkins: Check out source
#create Maven
Jenkins->>Maven: starts build
activate Maven #lightgreen
abox over Maven: Builds service's .jar
Maven<<#Violet-KubeRepo: Downloads the base image
parallel
note over Stash #YellowGreen:--There are few image versions sets\n which cover complete environment,\nsuch as versions-develop, \nversions-production, versions-qa, ...\nCould be branches of one project.
abox over Maven #DeepSkyBlue:Builds Docker image\nwith tag ...:<branch-name>
parallel off
deactivateafter Maven
space
destroy Maven
note over Stash #YellowGreen:--The project has a permanent "versions-project.xml".\nIt also points to some default - one of versions-*.
note over Commiter#YellowGreen: PR has "versions-pr.xml"\nadded only for this PR.
Stash-#steelblue>>Jenkins:Check out versions-*
abox over Jenkins#YellowGreen:Merges versions-default,\nversions-project and versions-PR\nto get the complete set of versions.\n--Might do a transitive resolving.--
entryspacing 0.1
Jenkins<<#Violet-KubeRepo: Obtains images as per merged versions
Jenkins--#darkorange>>Stash: waits or fails if not available.
entryspacing 0.4
parallel
note over Kube #lightyellow:See here for\nenv creation process
abox over Jenkins #deepskyblue: Generates kubernetes\nconfigs
parallel off
Jenkins-#DodgerBlue>>*Kube: starts the env
activate Kube #deepskyblue
Jenkins-#goldenrod>>Tests:starts the tests
activate Maven #lightgreen
activate Tests #gold
entryspacing 0.1
Tests-#gray>>Kube: requests...
Tests-#gray>>Kube:
entryspacing 0.4
linear
Tests-#goldenrod>>Jenkins:test results\n
deactivate Tests
space
deactivate Maven
#destroy Maven
Jenkins-#darkorange>>Stash:build results
Jenkins--#DodgerBlue>>Kube:destroys the env
deactivate Kube
destroy Kube
Jenkins-#Violet>>KubeRepo: Stores the tested image
Jenkins-#Tan>>Matrix:Stores the verified version to the version matrix,\nalong with other used versions, generated Kube\nconfiguration test config and other metadata.
deactivateafter Jenkins
linear
Commiter-#steelblue>>Stash:merges the PR
Stash-#steelblue>>Stash:excludes versions-pr.xml
linear off
space 2
#########################################################
== Compatible versions identification == #gold
activate Jenkins #orange
Jenkins->Jenkins: Finishes integration tests
Jenkins-#Tan>>Matrix:Stores the verified version... see above
#Jenkins--#Tan>Matrix: Triggers computing of the most complete set of compatible versions,\nas determined by the sets used for the successful integration tests.
Jenkins<<#Tan-Matrix: Queries the most complete set of compatible versions,\nas determined by the sets used for the successful integration tests.
Jenkins-#steelblue>>Stash: Creates a PR suggesting a new\ncompatible version set\nfor each version-* branch\nwhere it would be an upgrade.
deactivate Jenkins
#########################################################
== Whole collab verification - end-to-end == #gold
parallel
box over Stash #DodgerBlue: Stash
box over Jenkins #orange:Jenkins
box over Maven #lightgreen: Maven
box over Tests #gold: Tests
#box over Kube #DeepSkyBlue: Kube
box over KubeRepo #Violet: KubeRepo
box over Matrix #PapayaWhip: Versions\nMatrix
parallel off
Commiter-#steelblue>>Stash:merges a PR\nto any of versions-* -\ne.g. versions-prod
Stash-#darkorange>>Jenkins: webhook
activate Jenkins #orange
Stash-#steelblue>>Jenkins:Check out version-*
Jenkins<<#Tan-Matrix:Queries if all given versions passed the project integration tests.
Jenkins--#darkorange>>Stash: fails if not.
Jenkins<<#Tan-Matrix:Queries which of the given versions passed the integration tests along with the others.
opt
Jenkins--#darkorange>>Stash: fails if not.
end
space
entryspacing 0.1
Jenkins<<#Violet-KubeRepo:Obtains images as per versions-*
Jenkins--#darkorange>>Stash: fails if not available.
entryspacing 1
parallel
abox over Jenkins #deepskyblue: Generates kubernetes\nconfigs
note over Maven,Kube: --The configs will be versioned,\nprobably with the project,\nsince they are the "new topology".--
parallel off
entryspacing 0.4
Jenkins-#DodgerBlue>>*Kube: starts the env
activate Kube #deepskyblue
Jenkins-#goldenrod>>Tests:starts the tests
activate Maven #lightgreen
activate Tests #gold
entryspacing 0.1
Tests-#gray>>Kube: requests...
Tests-#gray>>Kube:
entryspacing 0.4
linear
Tests-#goldenrod>>Jenkins: test results\n
deactivate Tests
deactivate Maven
Jenkins-#darkorange>>Stash:build results
Jenkins--#DodgerBlue>>Kube:destroys the env
deactivate Kube
destroy Kube
space
Jenkins-#Tan>>Matrix:Store the verified version set to the version matrix,\nalong with the generated Kubernetes configuration,\nused test config, and other metadata.
deactivateafter Jenkins
title Collab CI pipeline
space
==Commit verification job - project integration tests \n\nAlternative 2 - version metadata resolved by leveraging Maven.== #gold
entryspacing 0.4
#actor Space for widening the source box...............................
actor Commiter
participant "Stash\n" as Stash #DodgerBlue
participant "Jenkins\n" as Jenkins #orange
lifelinecolor Jenkins #maroon
participant "Maven\n" as Maven #lightgreen
participant Tests #gold
lifelinecolor Tests #goldenrod
participant "Kubernetes\nenvironment" as Kube #DeepSkyBlue
participant "Kubernetes\nRepo" as KubeRepo #Violet
lifelinecolor KubeRepo #Violet
participant "Version\nMatrix" as Matrix #PapayaWhip
#create Matrix
note over Stash,Matrix: Note: This diagram uses arrow orientation as data flow direction rather than caller/callee.
parallel
Commiter-#steelblue>>Stash:creates a PR\nto the service
Stash-#darkorange>>Jenkins: webhook
activate Jenkins #orange
parallel off
Stash-#steelblue>>Jenkins: Check out source
#create Maven
Jenkins->>Maven: starts build
activate Maven #lightgreen
abox over Maven: Builds service's .jar
parallel
note over Stash #YellowGreen:--The project has a permanent\ncontroller.yml and service.yml.
abox over Maven: Builds k8s configs artifact
parallel off
Maven<<#Violet-KubeRepo: downloads the base image
abox over Maven #DeepSkyBlue: Builds Docker image\nwith tag ...:<branch-name>
abox over Maven #DeepSkyBlue: Downloads Kubernetes\nconfigs for the services\nthis project depends on
deactivateafter Maven
space
destroy Maven
abox over Jenkins #YellowGreen: K8s configs are now in target/ .
entryspacing 0.1
Jenkins<<#Violet-KubeRepo: obtains images as per the configs.
parallel
Jenkins--#darkorange>>Stash: waits or fails if not available.
#note over Kube #lightyellow: See here for\nenv creation process
parallel off
Jenkins-#DodgerBlue>>*Kube: starts the K8s env
activate Kube #deepskyblue
Jenkins-#goldenrod>>Tests:starts the tests
activate Maven #lightgreen
activate Tests #gold
entryspacing 0.1
Tests-#gray>>Kube: requests...
Tests-#gray>>Kube:
entryspacing 0.4
linear
Tests-#goldenrod>>Jenkins:test results\n
deactivate Tests
space
deactivate Maven
#destroy Maven
Jenkins-#darkorange>>Stash:build results
Jenkins--#DodgerBlue>>Kube:destroys the env
deactivate Kube
destroy Kube
entryspacing 0.4
Jenkins-#Violet>>KubeRepo: Stores the tested image
Jenkins-#Tan>>Matrix:Stores the verified version to the version matrix,\nalong with other used versions, generated Kube\nconfiguration test config and other metadata.
deactivateafter Jenkins
linear
Commiter-#steelblue>>Stash:merges the PR
Stash-#steelblue>>Stash:excludes versions-pr.xml
linear off
space 2
#########################################################
== Compatible versions identification == #gold
activate Jenkins #orange
Jenkins->>Jenkins: Finishes integration tests
Jenkins-#Tan>>Matrix:Stores the verified version... see above
#Jenkins--#Tan>Matrix: Triggers computing of the most complete set of compatible versions,\nas determined by the sets used for the successful integration tests.
Jenkins<<#Tan-Matrix: Queries the most complete set of compatible versions,\nas determined by the sets used for the successful integration tests.
Jenkins-#steelblue>>Stash: Creates a PR suggesting a new\ncompatible version set\nfor each version-* branch\nwhere it would be an upgrade.
deactivate Jenkins
#########################################################
== Whole collab verification - end-to-end == #gold
parallel
box over Stash #DodgerBlue: Stash
box over Jenkins #orange:Jenkins
box over Maven #lightgreen: Maven
box over Tests #gold: Tests
#box over Kube #DeepSkyBlue: Kube
box over KubeRepo #Violet: KubeRepo
box over Matrix #PapayaWhip: Versions\nMatrix
parallel off
Commiter-#steelblue>>Stash:merges a PR\nto any of versions-* -\ne.g. versions-prod
Stash-#darkorange>>Jenkins: webhook
activate Jenkins #orange
Stash-#steelblue>>Jenkins:Check out version-*
#parallel
Jenkins<<#Tan-Matrix:Queries if all given versions passed the project integration tests.
Jenkins--#darkorange>>Stash: fails if not.
#parallel off
#parallel
Jenkins<<#Tan-Matrix:Queries which of the given versions passed the integration tests along with the others.
opt
Jenkins--#darkorange>>Stash: fails if not.
end
#parallel off
space
Jenkins-#darkorange>>Maven:
activate Maven #lightgreen
abox over Maven #DeepSkyBlue: Downloads Kubernetes\nconfigs for the services
deactivateafter Maven
space
entryspacing 0.1
#parallel # Bug?
Jenkins<<#Violet-KubeRepo: obtains images as per versions-*
Jenkins--#darkorange>>Stash: fails if not available.
#parallel off
entryspacing 1
parallel
#abox over Jenkins #deepskyblue: Generates kubernetes\nconfigs
#note over Maven,Kube: --The configs will be versioned,\nprobably with the project,\nsince they are the "new topology".--
parallel off
entryspacing 0.4
Jenkins-#DodgerBlue>>*Kube: starts the env
activate Kube #deepskyblue
Jenkins-#goldenrod>>Tests:starts the tests
activate Maven #lightgreen
activate Tests #gold
entryspacing 0.1
Tests-#gray>>Kube: requests...
Tests-#gray>>Kube:
entryspacing 0.4
linear
Tests-#goldenrod>>Jenkins: test results\n
deactivate Tests
deactivate Maven
Jenkins-#darkorange>>Stash:build results
Jenkins--#DodgerBlue>>Kube:destroys the env
deactivate Kube
destroy Kube
space
Jenkins-#Tan>>Matrix:Store the verified version set to the version matrix,\nalong with the generated Kubernetes configuration,\nused test config, and other metadata.
deactivateafter Jenkins
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment