Ciinabox2 EC2 Agent Build Caching
Jenkins Agent Build Caching
With the latest ciinabox2 0.8.0
and the latest ciinabox Jenkins agent AMIs releases Jenkins agents can now mount a EFS volume to cache build data. This can provide a performance boost with builds pulling in large amount of dependencies or cloning large repositories.
To setup the cache volume on the EC2 agent follow these steps:
-
add the
initScript
key to your EC2 plugin configuration with the mount command using the new cache EFS access point to the/efs/cache
directoryjenkins: clouds: - amazonEC2: cloudName: "linux" templates: - ami: "${/ciinabox/ci2/agent/linux/ami}" initScript: | sudo mount -t efs -o tls,accesspoint=${/ciinabox/ci2/agent/cache-ap} ${/ciinabox/ci2/agent/efs} /efs/cache
-
setup your pipeline to utilise the cache directory
pipeline { agent { label 'linux' } stages { stage('build') { steps { dir('/efs/cache') { sh 'pwd' } } } } }
Ciinabox 0.8.0 Improvements
The 0.8.0 release has some additional bug fixes:
- Jenkins targetgroup health check values have been improved so Jenkins doesn’t fail it’s health check too quickly when launching
- Added IAM permission
iam:GetInstanceProfile
permission for packer baking - Added IAM permissions to allow ciinabox to create a service linked role for EFS
Latest Jenkins EC2 Agent Improvements
- Update docker compose version to 2.3.3
- Update OpenJDK version to 11
- Update docker buildx to 0.8.0