GitHub user uce opened a pull request:

    https://github.com/apache/flink/pull/1449

    [FLINK-2796] [runtime-web] Add configurable job manager address to HTTP 
requests

    These changes (re-)enable testing of changes to the web frontend:
    
    - Set the `allow-origin` header in order to allow requests from the test 
server (`localhost:3000` requests to `localhost:8081`). I don't know how this 
was working before? We never set that before.
    - Add job manager address to get requests and set default to empty String. 
This was completely removed in 3b8b4f0f8c0600dc851d676ce1bd7f5ab81cb64f, but it 
should have been only set to the empty string.
    
    All `$http.get` requests should refer to the `jobServer` variable.
    
    ```
    grep -r "\$http.get" flink-runtime-web/web-dashboard/app/
    flink-runtime-web/web-dashboard/app//scripts/common/services.coffee:    
$http.get flinkConfig.jobServer + "config"
    
flink-runtime-web/web-dashboard/app//scripts/modules/jobmanager/jobmanager.svc.coffee:
    $http.get(flinkConfig.jobServer + "jobmanager/config")
    
flink-runtime-web/web-dashboard/app//scripts/modules/jobmanager/jobmanager.svc.coffee:
    $http.get(flinkConfig.jobServer + "jobmanager/log")
    
flink-runtime-web/web-dashboard/app//scripts/modules/jobmanager/jobmanager.svc.coffee:
    $http.get(flinkConfig.jobServer + "jobmanager/stdout")
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
  $http.get flinkConfig.jobServer + "joboverview"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
  $http.get flinkConfig.jobServer + "jobs/" + jobid
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
    $http.get flinkConfig.jobServer + "jobs/" + jobid + "/config"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
    $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + 
vertexid + "/subtasktimes"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
    $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + 
vertexid
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
    $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" + 
vertexid + "/accumulators"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
      $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/vertices/" 
+ vertexid + "/subtasks/accumulators"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
    $http.get flinkConfig.jobServer + "jobs/" + currentJob.jid + "/exceptions"
    flink-runtime-web/web-dashboard/app//scripts/modules/jobs/jobs.svc.coffee:  
  $http.get flinkConfig.jobServer + "jobs/" + jobid + "/yarn-cancel"
    
flink-runtime-web/web-dashboard/app//scripts/modules/overview/overview.svc.coffee:
    $http.get(flinkConfig.jobServer + "/overview")
    
flink-runtime-web/web-dashboard/app//scripts/modules/taskmanager/taskmanager.svc.coffee:
    $http.get(flinkConfig.jobServer + "taskmanagers")
    
flink-runtime-web/web-dashboard/app//scripts/modules/taskmanager/taskmanager.svc.coffee:
    $http.get(flinkConfig.jobServer + "taskmanagers/" + taskmanagerid)
    ```
    
    ---
    
    **If you can find the time, make sure to test this by really running the 
frontend and not only by looking at the diffs. We don't have test coverage for 
these parts...**

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/uce/flink 2796-web_test

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/flink/pull/1449.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1449
    
----
commit 045da2cd619d51ede7bb7646fff4ba3620f619dd
Author: Ufuk Celebi <u...@apache.org>
Date:   2015-12-09T15:36:35Z

    [FLINK-2796] [runtime-web] Set allow-origin header
    
    Many browsers don't allow cross-origin HTTP requests if the respective
    HTTP header is not set by the server.
    
    Because of this it was not possible to test changes to the web frontend
    with the local proxy server and a running job manager.
    
    See here: 
https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS

commit 9ad26e9aeb6e2eb26f5155ad3c290e00d3421cc9
Author: Ufuk Celebi <u...@apache.org>
Date:   2015-12-09T15:41:07Z

    [FLINK-2796] [runtime-web] Add configurable job manager address to HTTP 
requests
    
    This was removed in 3b8b4f0f8c0600dc851d676ce1bd7f5ab81cb64f. The
    issue was fixed by this, but it disabled local testing as well.
    
    This change re-introduces the variable and sets it to the empty
    string by default. This way, we can still use the proxy server for
    local testing.

----


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastruct...@apache.org or file a JIRA ticket
with INFRA.
---

Reply via email to