This is an automated email from the ASF dual-hosted git repository.

baunsgaard pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new 27f595a1fe [MINOR] Quick fix of Federated monitor registration
27f595a1fe is described below

commit 27f595a1fe04c1ab7a53716b37b5c6188e9ddfe9
Author: baunsgaard <[email protected]>
AuthorDate: Thu Oct 6 16:38:05 2022 +0200

    [MINOR] Quick fix of Federated monitor registration
    
    This commit fixes the registration with the federated monitor tool,
    to use localhost, because the backend always identify with localhost.
    In the future we need to change this, but for now it works.
---
 docs/site/federated-monitoring.md                 | 36 ++++++++++++-----------
 src/main/java/org/apache/sysds/api/DMLScript.java |  4 ++-
 2 files changed, 22 insertions(+), 18 deletions(-)

diff --git a/docs/site/federated-monitoring.md 
b/docs/site/federated-monitoring.md
index 753c492697..c1e0fdc110 100644
--- a/docs/site/federated-monitoring.md
+++ b/docs/site/federated-monitoring.md
@@ -27,7 +27,7 @@ limitations under the License.
 
 To monitor the federated infrastructure of SystemDS, a monitoring tool was 
developed for this purpose.
 A general overview of the architecture can be seen in [**Figure 1**](figure-1).
-The monitoring tool consists of two separate decoupled modules, the Java-based 
**monitoring backend** and 
+The monitoring tool consists of two separate decoupled modules, the Java-based 
**monitoring backend** and
 the **monitoring frontend** developed in [Angular](https://angular.io/).
 
 **NOTE:** To work with the monitoring tool both the back- and frontend 
services must be running!
@@ -36,7 +36,7 @@ the **monitoring frontend** developed in 
[Angular](https://angular.io/).
 
 ### Installation & Build
 
-#### 1. Monitoring Backend
+#### Install Backend
 
 To compile the project, run the following code, more information can be found 
[here](./install.md):
 
@@ -54,7 +54,7 @@ mvn package -P distribution
 ```
 
 The following example works if you open an terminal at the root of the 
downloaded release,
-or a cloned repository. (You can also change the `$(pwd)` with the full path 
to the folder.), 
+or a cloned repository. (You can also change the `$(pwd)` with the full path 
to the folder.),
 more information can be found [here](./run.md):
 
 ```bash
@@ -62,10 +62,10 @@ export SYSTEMDS_ROOT=$(pwd)
 export PATH=$SYSTEMDS_ROOT/bin:$PATH
 ```
 
-#### 2. Monitoring Frontend
+#### Install Frontend
 
-Since the frontend is in **Angular v13**, a **node version 12/14/16** or later 
minor version is required. 
-To install `nodejs` and `npm` go to 
[https://nodejs.org/en/](https://nodejs.org/en/) and install version either 
**12.x**, 
+Since the frontend is in **Angular v13**, a **node version 12/14/16** or later 
minor version is required.
+To install `nodejs` and `npm` go to 
[https://nodejs.org/en/](https://nodejs.org/en/) and install version either 
**12.x**,
 **14.x** or **16.x**:
 
 ```bash
@@ -80,7 +80,7 @@ npm --version
 # ---------------------------
 ```
 
-To install the npm packages required for the Angular app to run, open the 
directory with 
+To install the npm packages required for the Angular app to run, open the 
directory with
 the SystemDS code and run:
 
 ```bash
@@ -89,16 +89,17 @@ cd scripts/monitoring
 # 2. Install all npm packages 
 npm install
 ```
+
 After those steps all the packages needed for running the monitoring tool 
should be installed.
 
 ### Running
 
-Both back- and frontend applications are separate modules of the same tool, 
they can be independently started and stopped. 
-Since they are designed with loose decoupling in mind, the frontend can 
integrate with different backends, and 
-the backend can work with different frontends, provided that the format of the 
data and the communication protocol is 
+Both back- and frontend applications are separate modules of the same tool, 
they can be independently started and stopped.
+Since they are designed with loose decoupling in mind, the frontend can 
integrate with different backends, and
+the backend can work with different frontends, provided that the format of the 
data and the communication protocol is
 preserved.
 
-#### 1. Monitoring Backend
+#### Backend
 
 To run the backend, use the `-fedMonitoring` flag followed by a `port` and can 
be executed using the systemds binary like this:
 
@@ -111,14 +112,15 @@ systemds FEDMONITORING 8080
 #[ INFO] Starting Federated Monitoring Backend server at port: 8080
 #[ INFO] Started Federated Monitoring Backend at port: 8080
 ```
+
 This will start the backend server which will be listening for REST requests 
on `http://localhost:8080`.
 
-**NOTE:** The backend is polling all registered workers with a given 
frequency, it can be changed by including 
+**NOTE:** The backend is polling all registered workers with a given 
frequency, it can be changed by including
 the `<sysds.federated.monitorFreq>3</sysds.federated.monitorFreq>` in the 
`SystemDS-config.xml` file, accepting
-**doubles**, representing seconds (0.5 can be used for setting the frequency 
to be half a second). The example shown 
+**doubles**, representing seconds (0.5 can be used for setting the frequency 
to be half a second). The example shown
 here will start the backend with polling with frequency of **3 seconds**, 
which is also the default value.
 
-#### 2. Monitoring Frontend
+#### Frontend
 
 To run the Angular app:
 
@@ -128,14 +130,15 @@ cd scripts/monitoring
 # 2. Start the angular app 
 npm start
 ```
-After this step the Angular UI should be started on 
[http://localhost:4200](http://localhost:4200) and can be viewed by opening the 
+
+After this step the Angular UI should be started on 
[http://localhost:4200](http://localhost:4200) and can be viewed by opening the
 browser on the same address.
 
 **NOTE:** The address of the backend is hardcoded in the frontend application 
and can be changed by changing the `BASE_URI` in the 
`systemds/scripts/monitoring/app/constants.ts` file. **DO NOT** include a 
trailing slash `/`, at the end of the address.
 
 #### 3. Coordinator self-registration for monitoring
 
-In addition to the manual registration of coordinators for monitoring, the 
self-registration feature can be used by 
+In addition to the manual registration of coordinators for monitoring, the 
self-registration feature can be used by
 setting the `-fedMonitoringAddress` flag followed by the address of the 
backend:
 
 ```bash
@@ -144,4 +147,3 @@ systemds -f testFederated.dml -exec singlenode -explain 
-debug -stats 20 -fedMon
 ```
 
 **NOTE:** The backend service should already be running, otherwise the 
coordinator will not start.
-
diff --git a/src/main/java/org/apache/sysds/api/DMLScript.java 
b/src/main/java/org/apache/sysds/api/DMLScript.java
index e10335d8ba..0c3716dd35 100644
--- a/src/main/java/org/apache/sysds/api/DMLScript.java
+++ b/src/main/java/org/apache/sysds/api/DMLScript.java
@@ -616,7 +616,9 @@ public class DMLScript
 
                                var model = new CoordinatorModel();
                                model.name = 
InetAddress.getLocalHost().getHostName();
-                               model.host = 
InetAddress.getLocalHost().getHostName();
+                               // TODO fix and replace localhost identifyer 
with hostname in federated instructions SYSTEMDS-3440
+                               // 
https://issues.apache.org/jira/browse/SYSTEMDS-3440
+                               model.host = "localhost"; 
                                model.processId = 
Long.parseLong(IDHandler.obtainProcessID());
 
                                String requestBody = objectMapper

Reply via email to