Bug 861199 - App changes couldn't take effect for scale nodejs-0.6 when using hot deployment
App changes couldn't take effect for scale nodejs-0.6 when using hot deployment
Status: CLOSED CURRENTRELEASE
Product: OpenShift Origin
Classification: Red Hat
Component: Containers (Show other bugs)
2.x
Unspecified Unspecified
low Severity low
: ---
: ---
Assigned To: Dan Mace
libra bugs
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-09-27 15:21 EDT by Dan Mace
Modified: 2015-05-14 19:00 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-12-19 14:27:32 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 Dan Mace 2012-09-27 15:21:45 EDT
Description of problem:

Hot-deployment support for the nodejs-0.6 has been intentionally removed due to a defective initial implementation.  Re-implement the feature.

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:
Comment 1 joycezhang 2012-10-07 23:53:44 EDT
Could you please help doulble confirm whether hot-deployment has been removed for nodejs-0.6? I have checked on devenv_2295 and found the actual results as below:

Steps:
1. Create a nodejs app
2. Add hot deploy marker and do some changes in local git repo
3. git push the changes
4. Do some changes again, then git push again.

Actual results:
To step 3: The app is restarted and changes take effect.
To step4: The app is not restarted, but changes don't take effect except restarting the app manually.
Comment 2 Dan Mace 2012-10-11 11:08:35 EDT
I can confirm that support for hot deployment in the nodejs-0.6 cart has been removed.

There is support for all carts to some degree via the abstract cartridge, which is why it seems to "sort of" work with the marker enabled: however, that's not enough for nodejs in this case. The specific support to handle node was broken, removed due to lack of time to re-implement.
Comment 3 joycezhang 2012-10-31 03:40:51 EDT
There's still problem for scalable nodejs hot deployment after testing on latest INT(devenv_2409). Here are the steps for your reference:

Steps:
1. Create a scale nodejs application
2. Create the hot deploy marker
$ touch .openshift/markers/hot_deploy
3.Change something in the local git repository
4.Deploy it
5.Change somthing in your local git repository
6.Deploy it again.
7. add 1 line to package.json
"scripts": { "start" : "supervisor <relative-from-repo-dir-path-to>/server.js" }, 
8.Make some change to the git repo and git push

Actual results:
step6: App is not restarted, but changes couldn't take effect.
step8: App is not restarted, but changes couldn't take effect.

Expected results:
App should not be started after step 6 and step8, changes should take effect.
Comment 4 Xiaoli Tian 2012-10-31 03:47:22 EDT
(In reply to comment #2)
> I can confirm that support for hot deployment in the nodejs-0.6 cart has
> been removed.
> 
> There is support for all carts to some degree via the abstract cartridge,
> which is why it seems to "sort of" work with the marker enabled: however,
> that's not enough for nodejs in this case. The specific support to handle
> node was broken, removed due to lack of time to re-implement.

According to commit f75bb21e9456927c4b64a04c65e4f41dc873e8f6 in origin sever, hot deployment for nodejs should be enabled.
Comment 5 Wei Sun 2012-11-05 01:13:26 EST
There's still problem for non-scale nodejs hot deployment after testing on Stage(devenv-stage_243). Changes changes couldn't take effect.
Comment 6 Wei Sun 2012-11-14 01:03:32 EST
Test this bug on devenv_2466
1.for non-scale nodejs and no jenkins-client,changes have taken effect
1)create a non-scale nodejs app
2)touch hot_deploy and git push
3) change server.js
self.routes['/test'] = function(req, res) {
            res.send('test');
        };
4)git push
5)check changes

Result:
[sunwei@dhcp-8-229 ~]$ curl http://nodejstest-wsundevbug1114.dev.rhcloud.com/test
test

2.for non-scale nodejs and have jenkins-client,changes have taken effect

1)create a non-scale nodejs app
2)add jenkins-client-1.4 to app
3)touch hot_deploy and git push
4)change server.js
self.routes['/test'] = function(req, res) {
            res.send('test1');
        };
5)git push
6)check changes

Result:
[sunwei@dhcp-8-229 ~]$ curl http://nodejstest-wsundevbug1114.dev.rhcloud.com/test
test1

3.for scale nodejs-0.6 app and have not jenkins-client,changes have not taken effect
1)create a scale nodejs app
2)touch hot_deploy and git push
3)change server.js
 // Routes for /health, /asciimo and /
        self.routes['/health'] = function(req, res) {
            res.send('test');
        };
4)git push
5)check changes

Result:
 [sunwei@dhcp-8-229 ~]$ curl  http://nodejsscaletest-wsundevbug1114.dev.rhcloud.com/health
1

4.for scale nodejs-0.6 and have jenkins-client,and changes have not taken effect.
1)create a scale nodejs app
2)add jenkins-client to app
3)touch hot_deploy and git push
4)change server.js
// Routes for /health, /asciimo and /
        self.routes['/health'] = function(req, res) {
            res.send('testagain');
        };
5)git push
6)check changes

Result:
[sunwei@dhcp-8-229 ~]$ curl  http://nodejsscaletest-wsundevbug1114.dev.rhcloud.com/health
1
Comment 7 Jianwei Hou 2012-11-19 04:25:23 EST
This bug seems already fixed.
Please change is status to ON_QA to verify, thanks!
Comment 8 Jianwei Hou 2012-11-26 20:46:52 EST
Verified on devenv_2520

Steps:
1. Create scalable nodejs application
rhc app create nodejs1s nodejs-0.6 -s
2. Add hot_deploy marker and git push, hot deployment will take effect from the second time of git push
3. After first git push, modify something in app's local repo, open another terminal, ssh into app's gear, check pid of app's process(supervisor process) remain unchanged before and after git push.
Access app's url after git push to make sure changes take effect.

Result:
App is not restarted during git push, changes were deployed after git push.

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