Bug 1091071

Summary: rhc shows haproxy cartridge in every framework gear
Product: OpenShift Online Reporter: Luke Meyer <lmeyer>
Component: ocAssignee: Fabiano Franz <ffranz>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 2.xCC: bmeng, bperkins, ffranz, jokerman, lnader, mmccomas, wjiang
Target Milestone: ---Keywords: UpcomingRelease
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-10-10 00:47:22 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1109382    
Attachments:
Description Flags
response from /application/id/gear_groups?include=endpoints none

Description Luke Meyer 2014-04-24 19:16:43 UTC
Description of problem:
When requesting per-gear status from a scaled app, the haproxy cartridge is shown as present in all framework gears, though it is not. Given we can set an app HA and have a >1 subset of the gears have this cartridge, it would be nice if rhc didn't misrepresent this.

Steps to Reproduce:
1. rhc app create foos php-5.4 mysql-5.5 -s
2. rhc cartridge scale -a foos php-5.4 --min 5
3. rhc app show -a foos --gears

Actual results:
ID                       State   Cartridges          Size  SSH URL
------------------------ ------- ------------------- ----- ------------------------------------------------------------------
535914dc6892dfc495000007 started haproxy-1.4 php-5.4 small 535914dc6892dfc495000007.com
5359152c6892dfc495000027 started haproxy-1.4 php-5.4 small 5359152c6892dfc495000027.com
5359152c6892dfc495000028 started haproxy-1.4 php-5.4 small 5359152c6892dfc495000028.com
5359152c6892dfc495000029 started haproxy-1.4 php-5.4 small 5359152c6892dfc495000029.com
5359152c6892dfc49500002a started haproxy-1.4 php-5.4 small 5359152c6892dfc49500002a.com
53591af76892dfc49500005b started mysql-5.5           small 53591af76892dfc49500005b.com


Expected results:
ID                       State   Cartridges          Size  SSH URL
------------------------ ------- ------------------- ----- ------------------------------------------------------------------
535914dc6892dfc495000007 started haproxy-1.4 php-5.4 small 535914dc6892dfc495000007.com
5359152c6892dfc495000027 started php-5.4             small 5359152c6892dfc495000027.com
5359152c6892dfc495000028 started php-5.4             small 5359152c6892dfc495000028.com
5359152c6892dfc495000029 started php-5.4             small 5359152c6892dfc495000029.com
5359152c6892dfc49500002a started php-5.4             small 5359152c6892dfc49500002a.com
53591af76892dfc49500005b started mysql-5.5           small 53591af76892dfc49500005b.com


Additional info:
In this case rhc is basically passing on what it gets from the API, which lists haproxy and php in a single gear group, and all the gears in that gear group in an array, without differentiating which of the gears actually has both cartridges. Perhaps for a sparse cartridge there should be some indicator in the API of which gears actually have it?

Comment 1 Fabiano Franz 2014-05-02 19:26:13 UTC
Reassigning to check if we can fix this in the broker. The REST API call involved is:

/broker/rest/application/<id>/gear-groups

Comment 2 Lili Nader 2014-05-05 18:30:29 UTC
So this API returns gear groups and not gears.  Using the above steps to reproduce 2 gear groups are returned:

First groups contains one gear and one cartridge.

Second groups contains 5 gears and two cartridges (php and haproxy)


So the API returns correct information but it is lacking the granularity that the client tools need which is per gear info.

Comment 3 Luke Meyer 2014-07-03 18:39:51 UTC
I believe the necessary granularity is actually present if the "include=endpoints" option is added at the gear-groups endpoint. This indicates per-gear which cartridge is present.

Comment 4 Lili Nader 2014-07-08 17:59:41 UTC
Created attachment 916514 [details]
response from /application/id/gear_groups?include=endpoints

Comment 5 Lili Nader 2014-07-08 18:01:53 UTC
Verified that include=endpoints will return the additional information required to show which gears have the haproxy cartridge and which gears have only the php cartridge (see attachment). Assigning back to client tools team to make the changes on rhc.

Comment 6 Fabiano Franz 2014-07-24 17:48:58 UTC
Fixed in https://github.com/openshift/rhc/pull/632

Comment 7 openshift-github-bot 2014-07-24 23:09:47 UTC
Commit pushed to master at https://github.com/openshift/rhc

https://github.com/openshift/rhc/commit/d858baefbad9d0d85ee46fa05a8642d169cad039
Bug 1091071 - properly displays haproxy on app gears

Comment 8 weiwei jiang 2014-07-28 03:10:14 UTC
Checked on devenv_5011 with rhc-1.28.3, and the result is as expected result now, so verify this issue.