- java-builder
- mininet
+- project:
+ name: throttle-ci-jobs
+ jobs:
+ - "{project-name}-ci-jobs"
+
+ throttle-enabled: true
+ throttle_categories:
+ - 'cat1'
+ - 'cat2'
+ throttle-max-per-node: 3
+ throttle-max-total: 2
+ throttle-option: 'category'
+
+ project-name: throttle-ciman
+
- project:
name: ci-jobs-view
views:
: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-workers: Number of threads to run **update** with. Set to 0 by default
+ which is equivalent to the number of available CPU cores. (default: 0)
: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)
(default: true)
:submodule-timeout: Timeout (in minutes) for checkout operation.
(default: 10)
+ :throttle_categories: List of categories to throttle by.
+ :throttle-enabled: Whether or not to enable throttling on the job.
+ (default: true)
+ :throttle-max-per-node: Max jobs to run on the same node. (default: 1)
+ :throttle-max-total: Max jobs to run across the entire project. - 0
+ means 'unlimited' (default: 0)
+ :throttle-option: Throttle by the project or by list of categories
+ defined in the throttle plugin configuration. (options: 'project',
+ 'category'; default: project)
:gerrit_verify_triggers: Override Gerrit Triggers.
:gerrit_trigger_file_paths: Override file paths which can be used to
--- /dev/null
+.. _lf-global-jjb-info-vote:
+
+#############
+INFO VOTE JOB
+#############
+
+Job counts the votes from the committers against a change
+to the INFO.yaml file
+
+If needed, will also check for a majority of tsc voters
+(not yet implemented)
+
+Auto-merges the change on a majority vote.
+
+
+info-vote
+---------
+
+:Comment Trigger: recheck|reverify|Vote
+
+:Required parameters:
+
+ :build-node: The node to run build on.
+ :jenkins-ssh-credential: Credential to use for SSH. (Generally set
+ in defaults.yaml)
Builders
========
+comment-to-gerrit
+-----------------
+
+This macro will post a comment to the gerrit patchset if the build
+creates a file named gerrit_comment.txt
+To use this macro add it to the list of builders.
+
+
lf-fetch-dependent-patches
--------------------------
ReadTheDocs verify script.
+check-info-votes
+----------------
+
+Calls shell script to validate votes on a change to an INFO.yaml
+
lf-sigul-sign-dir
-----------------
stream: master
submodule-recursive: true
submodule-timeout: 10
+ throttle_categories: []
+ throttle-enabled: false
+ throttle-max-per-node: 1
+ throttle-max-total: 0
+ throttle-option: 'project'
gerrit_trigger_file_paths:
- compare-type: REG_EXP
- lf-infra-properties:
project: '{project}'
build-days-to-keep: 7
+ - throttle:
+ categories: '{obj:throttle_categories}'
+ enabled: '{throttle-enabled}'
+ max-per-node: '{throttle-max-per-node}'
+ max-total: '{throttle-max-total}'
+ option: '{throttle-option}'
parameters:
- lf-infra-parameters:
# Default parameters #
######################
+ jjb-workers: 0
+
gerrit_merge_triggers:
- change-merged-event
- comment-added-contains-event:
builders:
- lf-infra-pre-build
- lf-infra-jjbini
+ - inject:
+ properties-content: JJB_WORKERS={jjb-workers}
- shell: !include-raw-escape:
- ../shell/jjb-install.sh
- ../shell/jjb-merge-job.sh
--- /dev/null
+---
+####################
+# COMMON FUNCTIONS #
+####################
+
+- lf_info_vote_common: &lf_info_vote_common
+ name: lf-info-vote-common
+
+ gerrit_trigger_file_paths:
+ - compare-type: REG_EXP
+ pattern: 'INFO.yaml'
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ project-type: freestyle
+ node: '{build-node}'
+
+ properties:
+ - lf-infra-properties:
+ build-days-to-keep: 7
+
+ parameters:
+ - lf-infra-parameters:
+ project: $GERRIT_PROJECT
+ branch: 'master'
+ refspec: 'refs/heads/{branch}'
+ stream: 'master'
+
+ wrappers:
+ - lf-infra-wrappers:
+ build-timeout: '{build-timeout}'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+ publishers:
+ - lf-infra-publish
+
+
+- lf_info_vote_verify: &lf_info_vote_verify
+ name: lf-info-vote-verify
+
+ branch: master
+ stream: master
+ build-days-to-keep: 7
+ build-timeout: 15
+ disable-job: false
+ git-url: '$GIT_URL/$PROJECT'
+ submodule-timeout: 10
+ submodule-recursive: true
+ gerrit-skip-vote: false
+
+ gerrit_verify_triggers:
+ - comment-added-contains-event:
+ comment-contains-value: '^Patch Set[ ]+[0-9]+:([ ]+|[\n]+)(vote)$'
+ - comment-added:
+ approval-category: 'CRVW'
+ approval-value: '+2'
+ - comment-added:
+ approval-category: 'Code-Review'
+ approval-value: '+2'
+
+ #####################
+ # Job Configuration #
+ #####################
+
+ disabled: '{disable-job}'
+
+ builders:
+ - check-info-votes:
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+
+- job-template:
+ name: 'info-vote'
+ id: info-vote-verify
+ <<: *lf_info_vote_common
+ # yamllint disable-line rule:key-duplicates
+ <<: *lf_info_vote_verify
+
+ scm:
+ - lf-infra-gerrit-scm:
+ branch: '$GERRIT_BRANCH'
+ jenkins-ssh-credential: '{jenkins-ssh-credential}'
+ git-url: '{git-url}'
+ refspec: '$GERRIT_REFSPEC'
+ submodule-recursive: '{submodule-recursive}'
+ submodule-timeout: '{submodule-timeout}'
+ choosing-strategy: gerrit
+
+ triggers:
+ - gerrit:
+ server-name: '{gerrit-server-name}'
+ trigger-on: '{obj:gerrit_verify_triggers}'
+ projects:
+ - project-compare-type: 'REG_EXP'
+ project-pattern: '**'
+ branches:
+ - branch-compare-type: 'ANT'
+ branch-pattern: '**/master'
+ file-paths: '{obj:gerrit_trigger_file_paths}'
+ skip-vote:
+ successful: '{gerrit-skip-vote}'
+ failed: '{gerrit-skip-vote}'
+ unstable: '{gerrit-skip-vote}'
+ notbuilt: '{gerrit-skip-vote}'
# BUILDERS #
############
+# To take advantage of this macro, have your build write
+# out the file 'gerrit_comment.txt' with information to post
+# back to gerrit and include this macro in the list of builders.
+- builder:
+ name: comment-to-gerrit
+ builders:
+ - shell: !include-raw ../shell/comment-to-gerrit.sh
+
- builder:
name: lf-fetch-dependent-patches
builders:
- shell: !include-raw-escape: ../shell/tox-install.sh
- shell: !include-raw-escape: ../shell/rtd-verify.sh
+- builder:
+ name: check-info-votes
+ builders:
+ - inject:
+ properties-content: JENKINS_SSH_CREDENTIAL={jenkins-ssh-credential}
+ - shell: !include-raw-escape: ../shell/check-info-votes.sh
+
- builder:
name: lf-sigul-sign-dir
# Requires that Jenkins be configured with SIGUL_BRIDGE_IP as a global
mvn-global-settings: global-settings
mvn-goals: clean deploy
mvn-opts: ''
- mvn-params: '-Dstream=$STREAM'
+ mvn-params: '-Dstream=$STREAM -Dmaven.source.skip=true'
mvn-version: mvn35
stream: master
submodule-recursive: true
--- /dev/null
+---
+fixes:
+ - |
+ Fix JAVA_HOME for openjdk11 on CentOS 7 to use the OpenJDK version installed
+ in /usr/lib/jvm/java-11-openjdk.
--- /dev/null
+---
+features:
+ - |
+ The **jjb-merge** job now has a new parameter ``jjb-workers`` to allow
+ configuration of the number of threads to run update with. Default is *0*
+ which is equivalent to the number of CPU cores available on the system.
--- /dev/null
+---
+features:
+ - |
+ New ``info-vote-verify`` macro
+ Will count votes against an INFO.yaml change and sumbit
+ automatically if a majority of committers and tsc mebers
+ vote +1 or +2 on the change.
--- /dev/null
+---
+other:
+ - |
+ The Maven Verify job will now call ``-Dmaven.source.skip`` to skip source
+ jar generation in the verify job. This saves us some time in the verify
+ build as the source artifacts are not useful in a verify job.
--- /dev/null
+---
+features:
+ - |
+ Support for the `Throttle Plugin`_ is added to JJB jobs so static
+ build servers can restrict the number of concurrent JJB jobs ran at
+ the same time.
+
+ This must be explicitly enabled by setting `throttle-enabled` on the
+ jobs.
+
+ .. _Throttle Plugin: https://plugins.jenkins.io/throttle-concurrents
--- /dev/null
+#!/bin/bash -l
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2019 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+echo "---> check-info-votes.sh"
+set -xe -o pipefail
+
+ref=$(echo "$GERRIT_REFSPEC" | awk -F"/" '{ print $4 }')
+pip="pip3"
+
+# For OPNFV
+if [[ $NODE_NAME =~ "lf-build" ]]; then
+ pip=pip
+fi
+
+if [ -d "/opt/pyenv" ]; then
+ echo "---> Setting up pyenv"
+ export PYENV_ROOT="/opt/pyenv"
+ export PATH="$PYENV_ROOT/bin:$PATH"
+ PYTHONPATH=$(pwd)
+ export PYTHONPATH
+ pyenv local 3.6.4
+ export PYENV_VERSION="3.6.4"
+fi
+
+$pip install --user niet
+$pip install --user lftools
+$pip install --user lftools[nexus]
+$pip install --user jsonschema
+
+change="$(echo "$GERRIT_CHANGE_URL" | awk -F"/" '{print $NF}')"
+echo "Checking votes:"
+lftools infofile check-votes INFO.yaml "$GERRIT_URL" "$ref" > gerrit_comment.txt
+exit_status="$?"
+
+if [[ "$exit_status" -ne 0 ]]; then
+ echo "Vote not yet complete"
+ cat gerrit_comment.txt
+ exit "$exit_status"
+else
+ echo "Vote completed submitting review"
+ ssh -p "$GERRIT_PORT" "$JENKINS_SSH_CREDENTIAL"@"$GERRIT_HOST" gerrit review "$change" --submit
+fi
--- /dev/null
+#!/bin/bash -l
+# SPDX-License-Identifier: EPL-1.0
+##############################################################################
+# Copyright (c) 2019 The Linux Foundation and others.
+#
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+##############################################################################
+
+set -xe -o pipefail
+
+if [[ -e gerrit_comment.txt ]] ; then
+ echo
+ echo "posting review comment to gerrit..."
+ echo
+ cat gerrit_comment.txt
+ echo
+ ssh -p 29418 "$GERRIT_HOST" \
+ "gerrit review -p $GERRIT_PROJECT \
+ -m '$(cat gerrit_comment.txt)' \
+ $GERRIT_PATCHSET_REVISION \
+ --notify NONE"
+fi
##############################################################################
echo "---> jjb-merge-job.sh"
+workers="${JJB_WORKERS:-0}"
+
# Ensure we fail the job if any steps fail.
set -eu -o pipefail
-jenkins-jobs update --recursive --delete-old --workers 4 jjb/
+jenkins-jobs update --recursive --delete-old --workers "$workers" jjb/
# git+https://github.com/lfit/releng-lftools.git#egg=lftools[openstack]
cat << EOF > "$REQUIREMENTS_FILE"
-lftools[openstack]~=0.21.0
+lftools[openstack]~=0.22.2
python-heatclient~=1.16.1
python-openstackclient~=3.16.0
dogpile.cache~=0.6.8 # Version 0.7.[01] seems to break openstackclient
update-java-redhat() {
if [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "11" ]]; then
- export JAVA_HOME="/opt/jdk-11"
- elif [[ "${SET_JDK_VERSION//[a-zA-Z]/}" = "10" ]]; then
- export JAVA_HOME="/opt/jdk-10.0.2"
+ export JAVA_HOME="/usr/lib/jvm/java-11-openjdk"
else
export JAVA_HOME="/usr/lib/jvm/java-1.${SET_JDK_VERSION//[a-zA-Z:-]/}.0-openjdk"
fi