Bug 1273929 - Jenkins image sorts deployments incorrectly.
Summary: Jenkins image sorts deployments incorrectly.
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: OpenShift Container Platform
Classification: Red Hat
Component: ImageStreams
Version: 3.1.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: Ben Parees
QA Contact: XiuJuan Wang
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-10-21 14:09 UTC by Ben Parees
Modified: 2015-11-13 09:35 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-11-13 09:35:55 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2015:2027 0 normal SHIPPED_LIVE Red Hat OpenShift Enterprise Jenkins image bug fix update 2015-11-13 14:35:45 UTC

Description Ben Parees 2015-10-21 14:09:48 UTC
Description of problem:
The jenkins sample job logic attempts to retrieve the list of deployments and sort them numerically in order to find the most recent one.

It does this sort incorrectly and therefore does not always find the most recent deployment.  


How reproducible:
always

Steps to Reproduce:
1. trigger more than 9 deployments at which point deployment-10 will be sorted incorrectly.

Actual results:
deployment-10 is not treated as the most recent deployment

Expected results:
deployment-10 is treated as the most recent deployment

Comment 4 XiuJuan Wang 2015-10-26 10:57:13 UTC
Hi Ben,
Could you tell me which source repo you are using?

When I use https://github.com/mfojtik/jenkins-ci to build jenkins slave image, always failed with below error:


# oc  get  builds 
NAME                    TYPE      FROM      STATUS     STARTED             DURATION
jenkins-master-1        Docker    Git       Complete   2 hours ago         5m22s
ruby-20-rhel7-slave-1   Docker    Git       Failed     About an hour ago   8m45s
ruby-20-rhel7-slave-2   Docker    Git       Failed     About an hour ago   1m41s
# oc  build-logs ruby-20-rhel7-slave-2 
I1026 05:27:27.031611       1 source.go:145] Cloning source from https://github.com/mfojtik/jenkins-ci.git
Step 0 : FROM registry.access.redhat.com/openshift3/ruby-20-rhel7
 ---> 81e8bd4043e7
Step 1 : USER root
 ---> Using cache
 ---> ebdc0227ea00
Step 2 : RUN yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus epel-release &&     rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 &&     yum install -y --setopt=tsflags=nodocs install java-1.8.0-openjdk-headless nss_wrapper &&     yum clean all &&     mkdir -p /opt/app-root/jenkins &&     chown -R 1001:0 /opt/app-root/jenkins &&     chmod -R g+w /opt/app-root/jenkins
 ---> Running in 71c8d2dc5627
Loaded plugins: product-id, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.


Error getting repository data for centosplus, repository not found
F1026 05:28:49.731248       1 builder.go:55] Build error: The command '/bin/sh -c yum install -y --setopt=tsflags=nodocs --enablerepo=centosplus epel-release &&     rpmkeys --import file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL-7 &&     yum install -y --setopt=tsflags=nodocs install java-1.8.0-openjdk-headless nss_wrapper &&     yum clean all &&     mkdir -p /opt/app-root/jenkins &&     chown -R 1001:0 /opt/app-root/jenkins &&     chmod -R g+w /opt/app-root/jenkins' returned a non-zero code: 1

Comment 5 Ben Parees 2015-10-26 13:45:56 UTC
I'm using the scenario described in the readme here:
https://github.com/openshift/origin/tree/master/examples/jenkins

note that when you instantiate the jenkins template, you'll need to change the image parameter (https://github.com/openshift/origin/blob/master/examples/jenkins/jenkins-ephemeral-template.json#L138) to use the ci.dev.openshift.redhat.com:5000/openshift/jenkins-1-rhel7 image.

Comment 6 XiuJuan Wang 2015-10-27 09:50:36 UTC
Test with jenkins-1-rhel7(4b63344b31b8).
The list of deployments sorts correct in jenkins console-out page when trigger deployment more than 9 times.So could find most recent deployment.

Comment 8 XiuJuan Wang 2015-10-27 10:24:09 UTC
Sorry,Ben.
My mistake, seem the list of deployments still sorts by numeric  in jenkins console-out page,but the test_rc_id get the most recent deployment.
See the console log,http://fpaste.org/284035/59409131/. I will treat that as acceptable.

Comment 9 Ben Parees 2015-10-27 12:50:53 UTC
yes that output looks fine, the order they are shown in the log doesn't matter, as long as the highest value is actually used in the end, per:

Scaling up new deployment frontend-14

Thanks for verifying!

Comment 12 errata-xmlrpc 2015-11-13 09:35:55 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2027.html


Note You need to log in before you can comment on or make changes to this bug.