wukong-m2m / wukong-darjeeling

Darjeeling for WuKong
Other
20 stars 17 forks source link

The progress is not displayed in the second deployment. #4

Open wycc opened 11 years ago

wycc commented 11 years ago

When we deploy the application for the second time, the messgae is not changed at all.

pencilcheck commented 11 years ago

I guess that could be fixed by caching the mapping results and discovery results properly and make sure deploy is using those results to deploy.

wycc commented 11 years ago

You need to test it by yourself. The issue is in the UI. When we do the second deployment. All messages are shown immediately even the actions is not executed yet. This must be something wrong in the message display system.

2013/8/31 Penn Su notifications@github.com

I guess that could be fixed by caching the mapping results and discovery results properly and make sure deploy is using those results to deploy.

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-23587332 .

pencilcheck commented 11 years ago

I'm leaving some records here so later people can come back and understand how and what we were doing.

Ok, if that's the issue, then probably because I didn't reset the deploy messages so when it is deployed it just shows all previous deploy log.

wycc commented 11 years ago

I believe that this is the case. I remember that you implement a new status report system. Can you prepare a document to explain that? How does the new system avoid the state machine issue in the old system.

2013/8/31 Penn Su notifications@github.com

I'm leaving some records here so later people can come back and understand how and what we were doing.

Ok, if that's the issue, then probably because I didn't reset the deploy messages so when it is deployed it just shows all previous deploy log.

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-23601426 .

pencilcheck commented 11 years ago

I will just write it here. Basically I have instance variables such as deploy_status and mapping_status and deploy_ops in WuApplication to contain deploy and mapping log. deploy_ops is for giving control to the DOM element, such as closing the dialog.

The javascript will constantly poll for the log and display on the page. That's it.

wycc commented 11 years ago

So, in every polling, we will return the whole log instead of the latest item. Is it?

2013/8/31 Penn Su notifications@github.com

I will just write it here. Basically I have instance variables such as deploy_status and mapping_status and deploy_ops in WuApplication to contain deploy and mapping log. deploy_ops is for giving control to the DOM element, such as closing the dialog.

The javascript will constantly poll for the log and display on the page. That's it.

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-23604561 .

pencilcheck commented 11 years ago

It just pulls all logs at once yes.

wycc commented 10 years ago

I don't think that this is solved already. I have not really understand the reason yet. However, it must be in the polling API. In the second deployment, the polling is stopped easier.

I can use the following patch to solve this issue. It looks like a timing issue. Please figure out the reason and fix it.

diff --git a/wukong/master/static/js/deployment.js b/wukong/master/static/js/deployment.js
index 8676fb2..533f343 100644
--- a/wukong/master/static/js/deployment.js
+++ b/wukong/master/static/js/deployment.js
@@ -65,6 +65,7 @@ $(function() {
     $('a#deploy-btn').click(function(e) {
         e.preventDefault();
         $(this).tab('show');
+               $('#deploy-progress').html('Start Deploy....');
         $.post('/applications/' + current_application + '/deploy', function(data) {
             // Already an object
             console.log('deploy signal set');
@@ -73,7 +74,9 @@ $(function() {
             } else {
                 // Print deploy status to #deploy-progress
                 // Starts a new polling to deploy-progress
-                application_polling(current_application, '#deploy-progress', 'deploy_status');
+                               setTimeout(function() {
+                       application_polling(current_application, '#deploy-progress', 'deploy_status');
+                               },3000);
                 //$('#deploy_results').dialog({modal: true, autoOpen: true, width: 600, height: 300}).dialog('open').bind('dialogclose', function(event, ui) {
                     //$('#deploy_results').dialog("close");
nielsreijers commented 10 years ago

Not sure if it's related, but I had a similar problem when generating the VM. First time I see the whole compilation process, but if I try a second time, it just shows "build start" or something similar. It works again after refreshing the page in my browser.

On Fri, Nov 8, 2013 at 10:47 AM, Yu-Chung Wang notifications@github.comwrote:

I don't think that this is solved already. I have not really understand the reason yet. However, it must be in the polling API. In the second deployment, the polling is stopped easier.

I can use the following patch to solve this issue. It looks like a timing issue. Please figure out the reason and fix it.

diff --git a/wukong/master/static/js/deployment.js b/wukong/master/static/js/deployment.js index 8676fb2..533f343 100644 --- a/wukong/master/static/js/deployment.js +++ b/wukong/master/static/js/deployment.js @@ -65,6 +65,7 @@ $(function() { $('a#deploy-btn').click(function(e) { e.preventDefault(); $(this).tab('show');

  • $('#deploy-progress').html('Start Deploy....'); $.post('/applications/' + current_application + '/deploy', function(data) { // Already an object console.log('deploy signal set'); @@ -73,7 +74,9 @@ $(function() { } else { // Print deploy status to #deploy-progress // Starts a new polling to deploy-progress
  • application_polling(current_application, '#deploy-progress', 'deploy_status');
  • setTimeout(function() {
  • application_polling(current_application, '#deploy-progress', 'deploy_status');
  • },3000); //$('#deploy_results').dialog({modal: true, autoOpen: true, width: 600, height: 300}).dialog('open').bind('dialogclose', function(event, ui) { //$('#deploy_results').dialog("close");

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-28029218 .

_

wycc commented 10 years ago

It should be different issue. This issue is due to the data.ops is still equal to 'c' for unknown reason. After I add the setTimeout to delay the polling function, it works well. I believe that it should be some issue related to the tasklet in the Master.

The Generate VM do not use the data.ops to stop the polling. We should use it in the Generate VM as well to indictae the state of the building process in the future.

In addition, we should parse the ant result and put better data.ops to indicate the building/compiling/deployment progress. For now, we only use 'c' to indicate the end of the process. We should move the state machine from the UI to the Master which has knowkledge to do better job. The UI only display UI according to the latest data in the poll function and display the log one by one.

2013/11/8 Niels Reijers notifications@github.com

Not sure if it's related, but I had a similar problem when generating the VM. First time I see the whole compilation process, but if I try a second time, it just shows "build start" or something similar. It works again after refreshing the page in my browser.

On Fri, Nov 8, 2013 at 10:47 AM, Yu-Chung Wang notifications@github.comwrote:

I don't think that this is solved already. I have not really understand the reason yet. However, it must be in the polling API. In the second deployment, the polling is stopped easier.

I can use the following patch to solve this issue. It looks like a timing issue. Please figure out the reason and fix it.

diff --git a/wukong/master/static/js/deployment.js b/wukong/master/static/js/deployment.js index 8676fb2..533f343 100644 --- a/wukong/master/static/js/deployment.js +++ b/wukong/master/static/js/deployment.js @@ -65,6 +65,7 @@ $(function() { $('a#deploy-btn').click(function(e) { e.preventDefault(); $(this).tab('show');

  • $('#deploy-progress').html('Start Deploy....'); $.post('/applications/' + current_application + '/deploy', function(data) { // Already an object console.log('deploy signal set'); @@ -73,7 +74,9 @@ $(function() { } else { // Print deploy status to #deploy-progress // Starts a new polling to deploy-progress
  • application_polling(current_application, '#deploy-progress', 'deploy_status');
  • setTimeout(function() {
  • application_polling(current_application, '#deploy-progress', 'deploy_status');
  • },3000); //$('#deploy_results').dialog({modal: true, autoOpen: true, width: 600, height: 300}).dialog('open').bind('dialogclose', function(event, ui) { //$('#deploy_results').dialog("close");

— Reply to this email directly or view it on GitHub< https://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-28029218>

.

_

— Reply to this email directly or view it on GitHubhttps://github.com/wukong-m2m/wukong-darjeeling/issues/4#issuecomment-28035323 .