1
0
Fork 0

Compare commits

..

2 Commits

Author SHA1 Message Date
Dustin a67ed39366 ci: Schedule to run monthly
dustin/pythonctnr/pipeline/head Something is wrong with the build of this commit Details
2022-10-31 12:10:08 -05:00
Dustin 4f4fd0d6bf ci: Enable ccache for buildroot
I wanted to use a persistent volume for the workspace volume of this
Jenkins pipeline in order to speed up subsequent builds.  Unfortunately,
this feature does not really work well in Jenkins.  Since the agent is
removed when the build completes, and therefore the volume is not
mounted anywhere, Jenkins cannot delete workspaces for deleted jobs.
This means that when feature branches/pull requests are merged, their
workspaces remain on disk forever.

Using the *dynamicPVC* option deletes the entire volume when the job
finishes.  This avoids wasting space, but does not allow subsequent
builds to reuse the workspace.  As a compromise, we can use a persistent
volume for the compiler cache and share it between builds.  Using the
compiler cache is not as effective as keeping the whole build directory,
but it still saves some time.  Also, it works across branches, too.
2022-10-31 12:03:52 -05:00
4 changed files with 14 additions and 14 deletions

15
ci/Jenkinsfile vendored
View File

@ -5,9 +5,7 @@ pipeline {
kubernetes { kubernetes {
yamlFile 'ci/podTemplate.yaml' yamlFile 'ci/podTemplate.yaml'
defaultContainer 'buildroot' defaultContainer 'buildroot'
workspaceVolume persistentVolumeClaimWorkspaceVolume( workspaceVolume dynamicPVC()
claimName: 'jenkins-ws-pythonctnr'
)
} }
} }
@ -16,20 +14,13 @@ pipeline {
disableConcurrentBuilds() disableConcurrentBuilds()
} }
parameters { triggers {
booleanParam \ cron 'TZ=America/Chicago\nH H H * *'
name: 'Clean',
description: 'Clean the workspace and perform a full rebuild'
} }
stages { stages {
stage('Prepare') { stage('Prepare') {
steps { steps {
script {
if (params.Clean) {
sh 'rm -rf _build'
}
}
checkout poll: false, scm: [ checkout poll: false, scm: [
$class: 'GitSCM', $class: 'GitSCM',
branches: [[name: '2022.05.x']], branches: [[name: '2022.05.x']],

View File

@ -7,9 +7,14 @@ spec:
command: command:
- sleep - sleep
- infinity - infinity
env:
- name: HOME
value: /home/jenkins
volumeMounts: volumeMounts:
- name: tmp - name: tmp
mountPath: /tmp mountPath: /tmp
- name: br2-ccache
mountPath: /home/jenkins/.buildroot-ccache
securityContext: securityContext:
readOnlyRootFilesystem: true readOnlyRootFilesystem: true
runAsUser: 1000 runAsUser: 1000
@ -25,3 +30,6 @@ spec:
emptyDir: emptyDir:
medium: Memory medium: Memory
sizeLimit: 100Mi sizeLimit: 100Mi
- name: br2-ccache
persistentVolumeClaim:
claimName: jenkins-br2-ccache

View File

@ -5,10 +5,10 @@
apiVersion: v1 apiVersion: v1
kind: PersistentVolumeClaim kind: PersistentVolumeClaim
metadata: metadata:
name: jenkins-ws-pythonctnr name: jenkins-br2-ccache
spec: spec:
accessModes: accessModes:
- ReadWriteOnce - ReadWriteOnce
resources: resources:
requests: requests:
storage: 10Gi storage: 20Gi

View File

@ -1,4 +1,5 @@
BR2_x86_64=y BR2_x86_64=y
BR2_CCACHE=y
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
BR2_TARGET_GENERIC_HOSTNAME="pythonctnr" BR2_TARGET_GENERIC_HOSTNAME="pythonctnr"
BR2_TARGET_GENERIC_ISSUE="" BR2_TARGET_GENERIC_ISSUE=""