Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1061424

Summary: The hot_deploy marker/--hot-deploy option can not take effect when deploying app with binary deployment
Product: OpenShift Container Platform Reporter: Brenton Leanhardt <bleanhar>
Component: ImageStreamsAssignee: Brenton Leanhardt <bleanhar>
Status: CLOSED ERRATA QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.0.0CC: adellape, agoldste, anli, bparees, chunchen, jolamb, pruan, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-openshift-origin-node-1.17.5.9-1.el6op openshift-origin-node-util-1.17.5-1.el6op Doc Type: Bug Fix
Doc Text:
The --hot-deploy option was ignored when deploying an application using the binary deployment method. This bug fix adds the missing handling for the --hot-deploy option to the binary deployment logic and the option is now recognized. The MCollective service must be restarted after applying this fix.
Story Points: ---
Clone Of: 1033523 Environment:
Last Closed: 2014-02-25 15:48:00 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: 1033523    
Bug Blocks:    

Description Brenton Leanhardt 2014-02-04 20:06:39 UTC
+++ This bug was initially created as a clone of Bug #1033523 +++

Description of problem:
The hot_deploy marker/--hot-deploy option can not take effect when deploying app with binary deployment

Version-Release number of selected component (if applicable):
devenv_4060

How reproducible:
always

Steps to Reproduce:
1. Create an app
rhc app create cphp04 php-5.3 --no-git
2. Configure the deployment type to binary
rhc configure-app cphp04 --deployment-type binary
3. Deploy this app via RESTAPI with indicating hot_deploy to true
curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-107-22-106-82.compute-1.amazonaws.com/broker/rest/application/528ecca41b21b85c770001f2/deployments -X POST -d artifact_url=https://cphp-ccyd.rhcloud.com/cphp2.tar.gz -d hot_deploy=true
4. Deploy this app from local binary file with --hot-deploy option
rhc deploy-app --ref cphp04.tar.gz -a cphp04 --hot-deploy
5. Check if this app is restarted at step 3 & 4 or not

Actual results:
at step 3:
<...>
  <status>created</status>
  <type>deployment</type>
  <data>
    <deployment>
      <created-at>2013-11-22T03:24:51Z</created-at>
      <hot-deploy>false</hot-deploy>                            <<<<<<<<<<<<<<<<<<<
      <force-clean-build>false</force-clean-build>
      <ref>master</ref>
      <sha1 nil="true"></sha1>
      <id>377ad282</id>
      <activations>
        <activation>2013-11-22T03:24:56Z</activation>
      </activations>
    </deployment>
  </data>
<...>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added 377ad282 to application cphp04</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
at step 5: the app is restarted.

Expected results:
The hot_deploy/--hot-deploy marker should take effect when deploying app with binary deployment

Additional info:

--- Additional comment from Andy Goldstein on 2013-11-22 09:30:58 EST ---

Not a release blocker

--- Additional comment from Ben Parees on 2013-12-18 22:57:04 EST ---

fix:
https://github.com/openshift/origin-server/pull/4375

--- Additional comment from openshift-github-bot on 2013-12-19 10:43:35 EST ---

Commit pushed to master at https://github.com/openshift/origin-server

https://github.com/openshift/origin-server/commit/836bb408aa7fff6a7605fedf55fc0294a771e9b6
Bug 1033523 - The hot_deploy marker/--hot-deploy option can not take
effect when deploying app with binary deployment

--- Additional comment from chunchen on 2013-12-19 21:05:08 EST ---

It's fixed, verified on devenv_4159, please refer to the following results:

1. Create an app
rhc app create cphp04 php-5.3 --no-git
2. Configure the deployment type to binary
rhc configure-app cphp04 --deployment-type binary
3. Deploy this app via RESTAPI with indicating hot_deploy and force_clean_build to true
4. Deploy this app from local binary file with --hot-deploy option
rhc deploy-app --ref cphp04.tar.gz -a cphp04 --hot-deploy
5. Check if this app is restarted at step 3 & 4 or not

At step 3:
]$ curl -k -H "Accept: application/xml" --user "chunchen:redhat7" https://ec2-50-16-113-124.compute-1.amazonaws.com/broker/rest/application/52b3a34b58c3da496f000421/deployments -X POST -d artifact_url=http://cphp-ccyd.rhcloud.com/cphp2.tar.gz -d hot_deploy=true -d force_clean_build=true

<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <type>deployment</type>
  <data>
    <deployment>
      <created-at>2013-12-20T01:58:05Z</created-at>
      <hot-deploy>true</hot-deploy>
      <force-clean-build>true</force-clean-build>
      <ref>master</ref>
      <sha1 nil="true"></sha1>
      <id>d1ad48c7</id>
      <activations>
        <activation>2013-12-20T01:58:10Z</activation>
      </activations>
    </deployment>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added d1ad48c7 to application cphp04</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>

At step 4:
]$ rhc deploy-app --ref cphp04.tar.gz -a cphp04 --hot-deploy
Deployment of file '/home/chunchen/test/cphp04.tar.gz' in progress for application cphp04 ...
Starting deploy for binary artifact
Stopping gear
Not stopping cartridge php because hot deploy is enabled
Creating new deployment directory
Preparing deployment
Preparing build for deployment
Deployment id is b2e26b48
Distributing deployment
Distribution status: success
Activating deployment
Not stopping cartridge php because hot deploy is enabled
Not starting cartridge php because hot deploy is enabled
Activation status: success
Deployment status: success
Success

At step 5:
The application does not restart at step 3 and step 4.

Comment 5 Anping Li 2014-02-07 08:41:44 UTC
Verified on puddle-2-0-3-2014-02-06
On node : tailf platform.log
1. deploy using curl
[ose215@dhcp-9-237 ~]$ curl -k -H "Accept: application/xml" --user "hanli1:redhat" https://br215.oseanli.cn/broker/rest/application/52f481254945dc14ab0002ef/deployments -X POST -d artifact_url=http://sperl510-hanli1dom.oseanli.cn/jbosseap.tar.gz -d hot_deploy=true
<?xml version="1.0" encoding="UTF-8"?>
<response>
  <status>created</status>
  <type>deployment</type>
  <data>
    <deployment>
      <created-at>2014-02-07T08:31:42Z</created-at>
      <hot-deploy>true</hot-deploy>
      <force-clean-build>false</force-clean-build>
      <ref>master</ref>
      <sha1 nil="true"></sha1>
      <id>7daa8ce7</id>
      <activations>
        <activation>2014-02-07T08:31:45Z</activation>
      </activations>
    </deployment>
  </data>
  <messages>
    <message>
      <severity>info</severity>
      <text>Added 7daa8ce7 to application jbosseap</text>
      <exit-code>0</exit-code>
      <field nil="true"></field>
      <index nil="true"></index>
    </message>
  </messages>
  <version>1.6</version>
  <api-version>1.6</api-version>
  <supported-api-versions>
    <supported-api-version>1.0</supported-api-version>
    <supported-api-version>1.1</supported-api-version>
    <supported-api-version>1.2</supported-api-version>
    <supported-api-version>1.3</supported-api-version>
    <supported-api-version>1.4</supported-api-version>
    <supported-api-version>1.5</supported-api-version>
    <supported-api-version>1.6</supported-api-version>
  </supported-api-versions>
</response>


2.deploy using rhc deploy-app
[ose215@dhcp-9-237 jbosseap]$ rhc deploy-app --ref jbosseap.tar.gz -a jbosseap --hot-deploy
Deployment of file '/home/ose215/jbosseap/jbosseap.tar.gz' in progress for
application jbosseap ...
Starting deploy for binary artifact
Stopping gear
Not stopping cartridge jbosseap because hot deploy is enabled
Creating new deployment directory
Preparing deployment
Preparing build for deployment
Deployment id is 0fa5b90d
Distributing deployment
Distribution status: success
Activating deployment
Not starting cartridge haproxy because hot deploy is enabled
Deploying jbosseap cartridge
Not starting cartridge jbosseap because hot deploy is enabled
Activation status: success
Deployment status: success
Success

3. Check the platform log, and there isn't cartridge restarted.

Comment 7 errata-xmlrpc 2014-02-25 15:48:00 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.

http://rhn.redhat.com/errata/RHBA-2014-0209.html