Bug 1033523

Summary: The hot_deploy marker/--hot-deploy option can not take effect when deploying app with binary deployment
Product: OpenShift Online Reporter: chunchen <chunchen>
Component: ImageAssignee: Ben Parees <bparees>
Status: CLOSED CURRENTRELEASE QA Contact: libra bugs <libra-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 2.xCC: agoldste, bparees, wsun
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 1061424 (view as bug list) Environment:
Last Closed: 2014-01-30 00:50:35 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:
Bug Depends On:    
Bug Blocks: 1061424    

Description chunchen 2013-11-22 10:14:48 UTC
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:

Comment 1 Andy Goldstein 2013-11-22 14:30:58 UTC
Not a release blocker

Comment 2 Ben Parees 2013-12-19 03:57:04 UTC
fix:
https://github.com/openshift/origin-server/pull/4375

Comment 3 openshift-github-bot 2013-12-19 15:43:35 UTC
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

Comment 4 chunchen 2013-12-20 02:05:08 UTC
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.