From 6cc9dc4bf43d4675704ab3bfe8feb0bcc8dd6472 Mon Sep 17 00:00:00 2001 From: Trevor Bramwell Date: Mon, 5 Nov 2018 16:30:38 -0800 Subject: [PATCH] Allow JJB Cache directory to be configured When JJB is ran concurrently on the same system with caching enabled, a timeout can occur when one job fails after waiting 1 minute to aquire the lock on the JJB cache directory. Even if caching is disabled/ignored this timeout can still occur as JJB always tries to lock the cache directory. Having the ability to configure the cache directory will allow projects to override it dynamically (with Jenkins env-vars) and run concurrent jobs on the same node. Change-Id: I1187847f658e754621369005e627a0f33a0253bc Signed-off-by: Trevor Bramwell --- docs/jjb/lf-ci-jobs.rst | 5 +++++ jjb/lf-ci-jobs.yaml | 7 +++++++ releasenotes/notes/jjb-cache-3a564a6943a5385e.yaml | 5 +++++ 3 files changed, 17 insertions(+) create mode 100644 releasenotes/notes/jjb-cache-3a564a6943a5385e.yaml diff --git a/docs/jjb/lf-ci-jobs.rst b/docs/jjb/lf-ci-jobs.rst index a394741d..25f9d114 100644 --- a/docs/jjb/lf-ci-jobs.rst +++ b/docs/jjb/lf-ci-jobs.rst @@ -21,6 +21,8 @@ lf-infra-jjb-parameters :Required Parameters: + :jjb-cache: Location of Jenkins Job Builder (JJB) cache used for jjb + jobs. :jjb-version: Version of Jenkins Job Builder (JJB) to install and use in the jjb jobs. @@ -365,6 +367,7 @@ Runs `jenkins-jobs update` to update production job configuration :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 10) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs) :jjb-version: JJB version to install. (default: see job-template) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) @@ -403,6 +406,7 @@ Runs `jenkins-jobs test` to validate JJB syntax :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 10) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs) :jjb-version: JJB version to install. (default: see job-template) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) @@ -443,6 +447,7 @@ project level jobs. :build-days-to-keep: Days to keep build logs in Jenkins. (default: 7) :build-timeout: Timeout in minutes before aborting build. (default: 10) :git-url: URL clone project from. (default: $GIT_URL/$PROJECT) + :jjb-cache: JJB cache location. (default: $HOME/.cache/jenkins_jobs) :jjb-version: JJB version to install. (default: see job-template) :stream: Keyword that can be used to represent a release code-name. Often the same as the branch. (default: master) diff --git a/jjb/lf-ci-jobs.yaml b/jjb/lf-ci-jobs.yaml index 638716e9..0319e119 100644 --- a/jjb/lf-ci-jobs.yaml +++ b/jjb/lf-ci-jobs.yaml @@ -77,6 +77,10 @@ name: JJB_VERSION default: '{jjb-version}' description: Jenkins Job Builder version to download and install. + - string: + name: XDG_CACHE_HOME + default: '{jjb-cache}' + description: Jenkins Job Builder cache location. - parameter: name: lf-packer-parameters @@ -97,6 +101,7 @@ build-timeout: 10 disable-job: false github-url: 'https://github.com' + jjb-cache: '$HOME/.cache/jenkins_jobs' jjb-version: 2.2.1 stream: master submodule-recursive: true @@ -136,6 +141,7 @@ branch: '{branch}' lftools-version: '{lftools-version}' - lf-infra-jjb-parameters: + jjb-cache: '{jjb-cache}' jjb-version: '{jjb-version}' wrappers: @@ -403,6 +409,7 @@ parameters: - lf-infra-jjb-parameters: + jjb-cache: '{jjb-cache}' jjb-version: '{jjb-version}' triggers: diff --git a/releasenotes/notes/jjb-cache-3a564a6943a5385e.yaml b/releasenotes/notes/jjb-cache-3a564a6943a5385e.yaml new file mode 100644 index 00000000..c8b5b895 --- /dev/null +++ b/releasenotes/notes/jjb-cache-3a564a6943a5385e.yaml @@ -0,0 +1,5 @@ +--- +features: + - | + Add the ability to configure the location of JJB's cache directory + for CI jobs. -- 2.16.6