Bug 1273929 - Jenkins image sorts deployments incorrectly.
Jenkins image sorts deployments incorrectly.
Status: CLOSED ERRATA
Product: OpenShift Container Platform
Classification: Red Hat
Component: Image (Show other bugs)
3.1.0
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Ben Parees
XiuJuan Wang
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-21 10:09 EDT by Ben Parees
Modified: 2015-11-13 04:35 EST (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2015-11-13 04:35:55 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Ben Parees 2015-10-21 10:09:48 EDT
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 06:57:13 EDT
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 09:45:56 EDT
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 05:50:36 EDT
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 06:24:09 EDT
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 08:50:53 EDT
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 04:35:55 EST
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.