Remove precise/trusty label mapping in Zuul config

Now that there are no jobs declaring both .*-precise and .*-trusty
nodes at the same time, it is safe to remove the associated mapping
in Zuul and let it trust that any worker registering the job name
is capable of running it sanely.

This should not be approved until manual jenkins-jobs updates have
been completed and confirmed successful on all Jenkins masters.

Change-Id: I3b40021ffbf89842ed3a53412dfffa119f311797
This commit is contained in:
Jeremy Stanley 2015-12-21 20:58:43 +00:00
parent 0af9b2c178
commit d9f139f2d5
3 changed files with 2 additions and 204 deletions

View File

@ -12,8 +12,6 @@
# License for the specific language governing permissions and limitations
# under the License.
import re
def set_log_url(item, job, params):
if hasattr(item.change, 'refspec'):
@ -29,100 +27,3 @@ def set_log_url(item, job, params):
params['BASE_LOG_PATH'] = path
params['LOG_PATH'] = path + '%s/%s/' % (job.name,
params['ZUUL_UUID'][:7])
def reusable_node(item, job, params):
if 'OFFLINE_NODE_WHEN_COMPLETE' in params:
del params['OFFLINE_NODE_WHEN_COMPLETE']
def devstack_params(item, job, params):
change = item.change
# Note we can't fallback on the default labels because
# jenkins uses 'devstack-precise || devstack-trusty'.
# This is necessary to get the gearman plugin to register
# gearman jobs with both node labels.
# Remove this when we are done doing prelimindary dib testing.
if 'dibtest' in job.name:
params['ZUUL_NODE'] = 'devstack-trusty-dib'
elif ((hasattr(change, 'branch') and
change.branch == 'stable/icehouse') or
('icehouse' in job.name or
'precise' in job.name)):
params['ZUUL_NODE'] = 'devstack-precise'
elif 'centos7' in job.name:
params['ZUUL_NODE'] = 'devstack-centos7'
elif 'multinode' in job.name:
params['ZUUL_NODE'] = 'devstack-trusty-2-node'
else:
params['ZUUL_NODE'] = 'devstack-trusty'
def default_params_precise(item, job, params):
if 'trusty' in job.name:
params['ZUUL_NODE'] = 'bare-trusty'
else:
params['ZUUL_NODE'] = 'bare-precise'
def default_params_trusty(item, job, params):
change = item.change
# Note we can't fallback on the default labels because
# jenkins uses 'bare-precise || bare-trusty'.
# This is necessary to get the gearman plugin to register
# gearman jobs with both node labels.
if ((hasattr(change, 'branch') and
change.branch == 'stable/icehouse') or
('icehouse' in job.name or
'precise' in job.name)):
params['ZUUL_NODE'] = 'bare-precise'
else:
params['ZUUL_NODE'] = 'bare-trusty'
def set_node_options(item, job, params, default):
# Set up log url paramter for all jobs
set_log_url(item, job, params)
# Default to single use node. Potentially overriden below.
# Select node to run job on.
params['OFFLINE_NODE_WHEN_COMPLETE'] = '1'
proposal_re = r'^.*(merge-release-tags|(propose|upstream)-(.*?)-updates?)$' # noqa
release_re = r'^.*-(jenkinsci|mavencentral|pypi-(both|wheel))-upload$'
f20_re = r'^.*-f20.*$'
f21_re = r'^.*-f21.*$'
tripleo_re = r'^.*-tripleo.*$'
devstack_re = r'^.*-dsvm.*$'
puppetunit_re = r'^gate-puppet-.*-puppet-(lint|syntax|unit).*$'
# jobs run on the proposal worker
if re.match(proposal_re, job.name) or re.match(release_re, job.name):
reusable_node(item, job, params)
# Jobs needing fedora 20
elif re.match(f20_re, job.name):
# Pass because job specified label is always correct.
pass
# Jobs needing fedora 21
elif re.match(f21_re, job.name):
# Pass because job specified label is always correct.
pass
# Jobs needing tripleo slaves
elif re.match(tripleo_re, job.name):
# Pass because job specified label is always correct.
pass
# Puppet-OpenStack jobs
elif re.match(puppetunit_re, job.name):
pass
# Jobs needing devstack slaves
elif re.match(devstack_re, job.name):
devstack_params(item, job, params)
elif default == 'trusty':
default_params_trusty(item, job, params)
else:
default_params_precise(item, job, params)
def set_node_options_default_precise(item, job, params):
set_node_options(item, job, params, 'precise')
def set_node_options_default_trusty(item, job, params):
set_node_options(item, job, params, 'trusty')

View File

@ -686,28 +686,16 @@ project-templates:
jobs:
- name: ^.*$
parameter-function: set_node_options_default_trusty
parameter-function: set_node_options
swift:
- name: logs
# The infra puppet configs predominantly run on precise nodes.
# Test puppet for infra by default on precise nodes until that changes.
- name: ^gate-system-config-puppet.*$
parameter-function: set_node_options_default_precise
# Berkshelf 3.x requires GeCode 3.x on precise.
- name: ^gate-.*-chef-(lint|style|unit|repo)$
parameter-function: set_node_options_default_precise
branch: ^stable/(icehouse|juno)$
- name: ^gate-.*-chef-rake-integration$
branch: ^(?!stable/(icehouse|juno)).*$
voting: false
- name: ^gate-.*-chef-rake.*$
branch: ^(?!stable/(icehouse|juno)).*$
# openstackid doesn't work with php5-mcrypt on trusty
- name: ^.*openstackid-(unittests|release).*$
parameter-function: set_node_options_default_precise
# groups works with php5.3 on precise
- name: ^.*groups-(unittests|release).*$
parameter-function: set_node_options_default_precise
# -nv jobs are never voting.
- name: ^.*-nv$
voting: false
@ -1395,7 +1383,6 @@ jobs:
branch: ^(?!stable/(kilo|liberty)).*$
- name: ^gate-.*-js-draft
parameter-function: set_node_options_default_trusty
success-pattern: http://docs-draft.openstack.org/{build.parameters[LOG_PATH]}/dist/
- name: infra-publications-publish

View File

@ -36,54 +36,6 @@ def reusable_node(item, job, params):
del params['OFFLINE_NODE_WHEN_COMPLETE']
def devstack_params(item, job, params):
change = item.change
# Note we can't fallback on the default labels because
# jenkins uses 'devstack-precise || devstack-trusty'.
# This is necessary to get the gearman plugin to register
# gearman jobs with both node labels.
# Remove this when we are done doing prelimindary dib testing.
if 'multinode' in job.name and 'dibtest' in job.name:
params['ZUUL_NODE'] = 'ubuntu-trusty-2-node'
elif 'dibtest' in job.name:
params['ZUUL_NODE'] = 'ubuntu-trusty'
elif ((hasattr(change, 'branch') and
change.branch == 'stable/icehouse') or
('icehouse' in job.name or
'precise' in job.name)):
params['ZUUL_NODE'] = 'devstack-precise'
elif 'centos7' in job.name:
params['ZUUL_NODE'] = 'devstack-centos7'
elif 'multinode' in job.name:
params['ZUUL_NODE'] = 'devstack-trusty-2-node'
else:
params['ZUUL_NODE'] = 'devstack-trusty'
def default_params_precise(item, job, params):
if 'trusty' in job.name:
params['ZUUL_NODE'] = 'bare-trusty'
else:
params['ZUUL_NODE'] = 'bare-precise'
def default_params_trusty(item, job, params):
change = item.change
# Note we can't fallback on the default labels because
# jenkins uses 'bare-precise || bare-trusty'.
# This is necessary to get the gearman plugin to register
# gearman jobs with both node labels.
if ((hasattr(change, 'branch') and
change.branch == 'stable/icehouse') or
('icehouse' in job.name or
'precise' in job.name)):
params['ZUUL_NODE'] = 'bare-precise'
elif job.name == 'bindep-nova-python27':
params['ZUUL_NODE'] = 'ubuntu-trusty'
else:
params['ZUUL_NODE'] = 'bare-trusty'
def set_node_options(item, job, params, default):
# Set up log url parameter for all jobs
set_log_url(item, job, params)
@ -93,49 +45,7 @@ def set_node_options(item, job, params, default):
proposal_re = r'^.*(merge-release-tags|(propose|upstream)-(.*?)-(constraints-.*|updates?|update-liberty))$' # noqa
release_re = r'^.*-(forge|jenkinsci|mavencentral|pypi-(both|wheel)|npm)-upload$'
hook_re = r'^hook-(.*?)-(rtfd)$'
fedora_re = r'^.*-f(edora-)?2(1|2|3).*$'
tripleo_re = r'^.*-tripleo-ci.*$'
kolla_image_re = r'^.*-kolla-dsvm-(build|deploy)-.*$'
openstack_ansible_re = r'^.*-openstack-ansible-.*$'
devstack_re = r'^.*-dsvm.*$'
puppetunit_re = (
r'^gate-(puppet-.*|system-config)-puppet-(lint|syntax|unit).*$')
# jobs run on the proposal worker
# jobs run on the persistent proposal and release workers
if (re.match(proposal_re, job.name) or re.match(release_re, job.name) or
re.match(hook_re, job.name)):
reusable_node(item, job, params)
# Kolla build image jobs always have the correct node label.
# Put before distro specific overrides as they list distros in
# the jobs names unrelated to where job should run.
elif re.match(kolla_image_re, job.name):
pass
# Jobs needing fedora 2[1|2|3]
elif re.match(fedora_re, job.name):
# Pass because job specified label is always correct.
pass
# Jobs needing tripleo slaves
elif re.match(tripleo_re, job.name):
# Pass because job specified label is always correct.
pass
# openstack-ansible jobs
elif re.match(openstack_ansible_re, job.name):
# Pass because job specified label is always correct.
pass
# Puppet-OpenStack jobs
elif re.match(puppetunit_re, job.name):
pass
# Jobs needing devstack slaves
elif re.match(devstack_re, job.name):
devstack_params(item, job, params)
elif default == 'trusty':
default_params_trusty(item, job, params)
else:
default_params_precise(item, job, params)
def set_node_options_default_precise(item, job, params):
set_node_options(item, job, params, 'precise')
def set_node_options_default_trusty(item, job, params):
set_node_options(item, job, params, 'trusty')