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 0ec57e9ad5 [MINOR] Federated Demo update --- It still works
0ec57e9ad5 is described below
commit 0ec57e9ad5606adf4294264cc2064b80c8316643
Author: Sebastian Baunsgaard <[email protected]>
AuthorDate: Wed Oct 4 15:00:49 2023 +0200
[MINOR] Federated Demo update --- It still works
---
scripts/monitoring/README.md | 76 +++++++++++++++-------
scripts/tutorials/federated/install.sh | 2 +-
scripts/tutorials/federated/run.sh | 8 +--
.../python/systemds/operator/algorithm/__init__.py | 2 +
.../operator/algorithm/builtin/imputeByKNN.py | 39 +++++++++++
5 files changed, 97 insertions(+), 30 deletions(-)
diff --git a/scripts/monitoring/README.md b/scripts/monitoring/README.md
index 6a5fe74d66..98b4a8003d 100644
--- a/scripts/monitoring/README.md
+++ b/scripts/monitoring/README.md
@@ -1,14 +1,30 @@
+<!--
+{% comment %}
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements. See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to you under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License. You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
+{% end comment %}
+-->
# Frontend for monitoring tool of federated infrastrucuture
A frontend application, used to visualize and manipulate the backend
application functionality of the monitoring tool
-
## Backend requirements
A running instance of the backend application is required for the frontend to
function, default port of the backend is **8080**.
-
## Install & Run
To install and run the app do the following:
@@ -18,7 +34,9 @@ To install and run the app do the following:
npm install
npm run start
```
+
To view the app Navigate to `http://localhost:4200/`.
+
## Running Tests
To run tests, run the following command:
@@ -27,16 +45,15 @@ To run tests, run the following command:
npm run test
```
-
## API Reference
-#### Get all registered workers
+Get all registered workers
```http
GET /workers
```
-#### Get specific worker
+Get specific worker
```http
GET /workers/${id}
@@ -46,18 +63,20 @@ To run tests, run the following command:
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of the worker to fetch |
-#### Register worker for monitoring
+Register worker for monitoring
+
```http
POST /workers
```
-##### Request body in **JSON** format:
+
+Request body in **JSON** format:
| Body parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `name` | `string` | **Required**. Name of the worker to register |
| `address` | `string` | **Required**. Address of the worker to register |
-##### Example:
+Example:
```json
{
@@ -65,22 +84,25 @@ To run tests, run the following command:
"address": "localhost:8001"
}
```
-#### Edit registered worker
+
+Edit registered worker
+
```http
PUT /workers/${id}
```
+
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of the worker to edit |
-##### Request body in **JSON** format:
+Request body in **JSON** format:
| Body parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `name` | `string` | Changed name of the worker |
| `address` | `string` | Changed address of the worker |
-##### Example:
+Example:
```json
{
@@ -88,7 +110,8 @@ To run tests, run the following command:
"address": "localhost:8005"
}
```
-#### Deregister specific worker
+
+Deregister specific worker
```http
DELETE /workers/${id}
@@ -99,13 +122,14 @@ To run tests, run the following command:
| `id` | `int` | **Required**. Id of the worker to deregister |
---
-#### Get all registered coordinators
+
+Get all registered coordinators
```http
GET /coordinators
```
-#### Get specific coordinator
+Get specific coordinator
```http
GET /coordinators/${id}
@@ -115,18 +139,20 @@ To run tests, run the following command:
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of the coordinator to fetch |
-#### Register coordinator for monitoring
+Register coordinator for monitoring
+
```http
POST /coordinators
```
-##### Request body in **JSON** format:
+
+Request body in **JSON** format:
| Body parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `name` | `string` | **Required**. Name of the coordinator to register |
| `address` | `string` | **Required**. Address of the coordinator to register |
-##### Example:
+Example:
```json
{
@@ -134,22 +160,25 @@ To run tests, run the following command:
"address": "localhost:8441"
}
```
-#### Edit registered coordinator
+
+Edit registered coordinator
+
```http
PUT /coordinators/${id}
```
+
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of the coordinator to edit |
-##### Request body in **JSON** format:
+Request body in **JSON** format:
| Body parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `name` | `string` | Changed name of the coordinator |
| `address` | `string` | Changed address of the coordinator |
-##### Example:
+Example:
```json
{
@@ -157,7 +186,8 @@ To run tests, run the following command:
"address": "localhost:8445"
}
```
-#### Deregister specific coordinator
+
+Deregister specific coordinator
```http
DELETE /coordinators/${id}
@@ -166,7 +196,3 @@ To run tests, run the following command:
| Parameter | Type | Description |
| :-------- | :------- | :-------------------------------- |
| `id` | `int` | **Required**. Id of the coordinator to deregister |
-
-## License
-
-[Apache-2.0](http://www.apache.org/licenses/LICENSE-2.0)
diff --git a/scripts/tutorials/federated/install.sh
b/scripts/tutorials/federated/install.sh
index 7e112f6f38..d69a14dba3 100755
--- a/scripts/tutorials/federated/install.sh
+++ b/scripts/tutorials/federated/install.sh
@@ -48,7 +48,7 @@ for index in ${!address[*]}; do
cd systemds;
git reset --hard origin/master > /dev/null 2>&1;
git pull > /dev/null 2>&1;
- mvn clean package -P distribution | grep -E 'BUILD SUCCESS|BUILD FA';
+ mvn clean package -P distribution | grep -E 'BUILD';
echo 'Installed Systemds on' \$HOSTNAME;
cd \$HOME
mkdir -p ${remoteDir}
diff --git a/scripts/tutorials/federated/run.sh
b/scripts/tutorials/federated/run.sh
index b4f64dc051..ec4e48e3b0 100755
--- a/scripts/tutorials/federated/run.sh
+++ b/scripts/tutorials/federated/run.sh
@@ -55,10 +55,10 @@ source parameters.sh
# -args $x $y_hot $xt $yt_hot \
# -fedMonitoringAddress "http://localhost:8080"
-systemds code/exp/CNNLong.dml \
- -stats \
- -args $x $y_hot $xt $yt_hot \
- -fedMonitoringAddress "http://localhost:8080"
+# systemds code/exp/CNNLong.dml \
+# -stats \
+# -args $x $y_hot $xt $yt_hot \
+# -fedMonitoringAddress "http://localhost:8080"
# systemds code/exp/sumRepeat.dml \
# -config conf/$conf.xml \
diff --git a/src/main/python/systemds/operator/algorithm/__init__.py
b/src/main/python/systemds/operator/algorithm/__init__.py
index d0bc373f88..a5227c3461 100644
--- a/src/main/python/systemds/operator/algorithm/__init__.py
+++ b/src/main/python/systemds/operator/algorithm/__init__.py
@@ -90,6 +90,7 @@ from .builtin.img_translate import img_translate
from .builtin.impurityMeasures import impurityMeasures
from .builtin.imputeByFD import imputeByFD
from .builtin.imputeByFDApply import imputeByFDApply
+from .builtin.imputeByKNN import imputeByKNN
from .builtin.imputeByMean import imputeByMean
from .builtin.imputeByMeanApply import imputeByMeanApply
from .builtin.imputeByMedian import imputeByMedian
@@ -254,6 +255,7 @@ __all__ = ['WoE',
'impurityMeasures',
'imputeByFD',
'imputeByFDApply',
+ 'imputeByKNN',
'imputeByMean',
'imputeByMeanApply',
'imputeByMedian',
diff --git a/src/main/python/systemds/operator/algorithm/builtin/imputeByKNN.py
b/src/main/python/systemds/operator/algorithm/builtin/imputeByKNN.py
new file mode 100644
index 0000000000..fcc096180b
--- /dev/null
+++ b/src/main/python/systemds/operator/algorithm/builtin/imputeByKNN.py
@@ -0,0 +1,39 @@
+# -------------------------------------------------------------
+#
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+#
+# -------------------------------------------------------------
+
+# Autogenerated By : src/main/python/generator/generator.py
+# Autogenerated From : scripts/builtin/imputeByKNN.dml
+
+from typing import Dict, Iterable
+
+from systemds.operator import OperationNode, Matrix, Frame, List, MultiReturn,
Scalar
+from systemds.script_building.dag import OutputType
+from systemds.utils.consts import VALID_INPUT_TYPES
+
+
+def imputeByKNN(X: Matrix,
+ **kwargs: Dict[str, VALID_INPUT_TYPES]):
+
+ params_dict = {'X': X}
+ params_dict.update(kwargs)
+ return Matrix(X.sds_context,
+ 'imputeByKNN',
+ named_input_nodes=params_dict)