Here is what I am trying to do as part of my pipeline.
- Do a maven build which will also run the acceptance test cases
- Docker build,
- Push the image to repository
The challenge i face is with the variation in time it takes across the steps.
The maven build for the same code base takes, 5min for a best case scenario. This number shoots upto 20min. The docker build performance varies moderately, between 5-8 min.
The "Build setup" phase shows the most variance, with best performance figures of 39s to worst case of 10min.
I am caching node modules and maven as part of the pipeline setup.
-- yaml file for reference
options:
docker: true
image:
name: $server/$product/services:latest
username: $DTR_USERNAME
password: $DTR_PASSWORD
email: $DTR_EMAIL
pipelines:
branches:
'**':
- step:
caches:
- maven
- nodemodules
script:
- export MAVEN_OPTS=-Xmx1G && export M2_HOME=/opt/apache-maven-3.3.9 && export PATH=$PATH:/opt/apache-maven-3.3.9/bin
- mvn -B -T 1C -q verify -DskipITs=true -Dmaven.repo.local=/root/.m2/repository -Djsse.enableSNIExtension=false
- export GITNUMBER=`git rev-parse HEAD`
- docker login $server --username $DTR_PUSH_USERNAME --password $DTR_PUSH_PASSWORD
- docker build --build-arg GIT_VERSION_NUMBER=${GITNUMBER} --force-rm=true .
- docker push <docker image>
definitions:
caches:
nodemodules: application/node_modules
Could the pipeline performance fluctuate so sharply due to resource constraints, and many developers committing alongside ? Is there a way to obtain metrics on this front ?
Thanks