From 617408ea103a22f6a1a2b3b70c822fda1547277a Mon Sep 17 00:00:00 2001 From: ankicabarisic Date: Fri, 9 Aug 2024 15:52:50 +0200 Subject: [PATCH 1/3] nebulous-afCk4N8e --- .../org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java b/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java index 1664349..ec04fc4 100644 --- a/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java +++ b/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java @@ -141,6 +141,9 @@ private static boolean satisfyAttributeRequirement(AttributeRequirement attribut return attributeRequirement.getRequirementOperator() .compare(nodeCandidate.getHardware().getFpga(), Integer.valueOf(attributeRequirement.getValue())); + case "name": + return attributeRequirement.getRequirementOperator().compare(nodeCandidate.getHardware().getName(), + attributeRequirement.getValue()); } } if (attributeRequirement.getRequirementClass().equals("location")) { From af4aa7d8868ff53ca4431d2b1db1ee881aac0d61 Mon Sep 17 00:00:00 2001 From: ankicabarisic Date: Fri, 9 Aug 2024 16:01:01 +0200 Subject: [PATCH 2/3] node candidate hardware/name added --- documentation/7-node-endpoints.md | 66 ++++++++++++++++++++++++------- 1 file changed, 51 insertions(+), 15 deletions(-) diff --git a/documentation/7-node-endpoints.md b/documentation/7-node-endpoints.md index 57666dc..c1ef5af 100644 --- a/documentation/7-node-endpoints.md +++ b/documentation/7-node-endpoints.md @@ -4,14 +4,14 @@ * For the `NodeTypeRequirement` we verify that the node candidate is the type desired. These types are: `IAAS`, `PAAS`, `FAAS`, `BYON`, `EDGE`, `SIMULATION` * For the `AttributeRequirement` they are catagorized in the following classes: - * `hardware`: In this class we can filter based on the `ram`, `cores`, `disk`, `fpga`. + * `hardware`: In this class we can filter based on the `ram`, `cores`, `disk`, `fpga`, `name` * `location`: In this class we can filter based on the `geoLocation.country` * `image`: In this class we can filter based on the `name`, `operatingSystem.family` , `operatingSystem.version` * `cloud`: In this class we can filter based on the `type`. A cloud type can be `PRIVATE`, `PUBLIC`, `BYON`, `EDGE` * `environment`: In this class we can filter based on the `runtime`. The possible runtimes are `nodejs`, `python`, `java`, `dotnet`, `go` * `name`: In this class we can filter based on the `placementName`. This is used for BYON and EDGE nodes where we can select a specific node to handle a certain component. -For more details about these filters you can check the SAL code [NodeCandidateUtils class](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java) To check the Node types: [NodeTypeRequirement class](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/NodeTypeRequirement.java) and [NodeType enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/NodeType.java) To check the Cloud types: [CloudType enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/CloudType.java) to check the requirment operators: [RequirementOperator enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/RequirementOperator.java) +For more details about these filters you can check the SAL code [NodeCandidateUtils class](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-service/src/main/java/org/ow2/proactive/sal/service/nc/NodeCandidateUtils.java) To check the Node types: [NodeTypeRequirement class](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/NodeTypeRequirement.java) and [NodeType enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/NodeType.java) To check the Cloud types: [CloudType enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/CloudType.java) to check the requirement operators: [RequirementOperator enum](https://github.com/ow2-proactive/scheduling-abstraction-layer/blob/master/sal-common/src/main/java/org/ow2/proactive/sal/model/RequirementOperator.java) **Path**: @@ -25,24 +25,60 @@ For more details about these filters you can check the SAL code [NodeCandidateUt ```json [ + //asking for IASS node type { - "type": "NodeTypeRequirement", - "nodeTypes": ["IAAS"] + "type": "NodeTypeRequirement", + "nodeTypes": ["IAAS"] }, + //asking for nodes from specific cloud { - "type": "AttributeRequirement", - "requirementClass": "hardware", - "requirementAttribute": "cores", - "requirementOperator": "EQ", - "value": "2" + "type": "AttributeRequirement", + "requirementClass": "cloud", + "requirementAttribute": "id", + "requirementOperator": "EQ", + "value": "{{cloud_name}}" }, - { - "type": "AttributeRequirement", - "requirementClass": "hardware", - "requirementAttribute": "ram", - "requirementOperator": "EQ", - "value": "4096" \\ in mb + //asking for UBUNTU operating system + { + "type": "AttributeRequirement", + "requirementClass": "image", + "requirementAttribute": "operatingSystem.family", + "requirementOperator": "IN", + "value": "UBUNTU" + }, + //asking for 22 version of OS + { + "type": "AttributeRequirement", + "requirementClass": "image", + "requirementAttribute": "name", + "requirementOperator": "INC", + "value": "22" + }, + //asking for specific region + { + "type": "AttributeRequirement", + "requirementClass": "location", + "requirementAttribute": "name", + "requirementOperator": "EQ", + "value": "bgo" + }, + //asking for 8GB RAM + { + "type": "AttributeRequirement", + "requirementClass": "hardware", + "requirementAttribute": "ram", + "requirementOperator": "EQ", + "value": "8192" + }, + //asking for 4 cores + { + "type": "AttributeRequirement", + "requirementClass": "hardware", + "requirementAttribute": "cores", + "requirementOperator": "EQ", + "value": "4" } + ] ``` From 05d0cfbacbae18909bbdf778d828df4e3120a6ba Mon Sep 17 00:00:00 2001 From: ankicabarisic Date: Fri, 9 Aug 2024 16:14:11 +0200 Subject: [PATCH 3/3] node candidate hardware/name documented --- documentation/7-node-endpoints.md | 117 ++++++++++++++++-------------- 1 file changed, 62 insertions(+), 55 deletions(-) diff --git a/documentation/7-node-endpoints.md b/documentation/7-node-endpoints.md index c1ef5af..85d137e 100644 --- a/documentation/7-node-endpoints.md +++ b/documentation/7-node-endpoints.md @@ -25,63 +25,70 @@ For more details about these filters you can check the SAL code [NodeCandidateUt ```json [ - //asking for IASS node type - { - "type": "NodeTypeRequirement", - "nodeTypes": ["IAAS"] - }, - //asking for nodes from specific cloud - { - "type": "AttributeRequirement", - "requirementClass": "cloud", - "requirementAttribute": "id", - "requirementOperator": "EQ", - "value": "{{cloud_name}}" - }, - //asking for UBUNTU operating system - { - "type": "AttributeRequirement", - "requirementClass": "image", - "requirementAttribute": "operatingSystem.family", - "requirementOperator": "IN", - "value": "UBUNTU" - }, - //asking for 22 version of OS - { - "type": "AttributeRequirement", - "requirementClass": "image", - "requirementAttribute": "name", - "requirementOperator": "INC", - "value": "22" - }, - //asking for specific region - { - "type": "AttributeRequirement", - "requirementClass": "location", - "requirementAttribute": "name", - "requirementOperator": "EQ", - "value": "bgo" - }, - //asking for 8GB RAM - { - "type": "AttributeRequirement", - "requirementClass": "hardware", - "requirementAttribute": "ram", - "requirementOperator": "EQ", - "value": "8192" - }, - //asking for 4 cores - { - "type": "AttributeRequirement", - "requirementClass": "hardware", - "requirementAttribute": "cores", - "requirementOperator": "EQ", - "value": "4" - } - + // asking for IASS node type + { + "type": "NodeTypeRequirement", + "nodeTypes": ["IAAS"] + }, + // asking for nodes from specific cloud + { + "type": "AttributeRequirement", + "requirementClass": "cloud", + "requirementAttribute": "id", + "requirementOperator": "EQ", + "value": "{{cloud_name}}" + }, + // asking for UBUNTU operating system + { + "type": "AttributeRequirement", + "requirementClass": "image", + "requirementAttribute": "operatingSystem.family", + "requirementOperator": "IN", + "value": "UBUNTU" + }, + // asking for 22 version of OS + { + "type": "AttributeRequirement", + "requirementClass": "image", + "requirementAttribute": "name", + "requirementOperator": "INC", + "value": "22" + }, + // asking for specific region + { + "type": "AttributeRequirement", + "requirementClass": "location", + "requirementAttribute": "name", + "requirementOperator": "EQ", + "value": "bgo" + }, + // asking for 8GB RAM + { + "type": "AttributeRequirement", + "requirementClass": "hardware", + "requirementAttribute": "ram", + "requirementOperator": "EQ", + "value": "8192" + }, + // asking for 4 cores + { + "type": "AttributeRequirement", + "requirementClass": "hardware", + "requirementAttribute": "cores", + "requirementOperator": "EQ", + "value": "4" + }, + // asking specific hardware name + { + "type": "AttributeRequirement", + "requirementClass": "hardware", + "requirementAttribute": "name", + "requirementOperator": "EQ", + "value": "c5.xlarge" + } ] ``` - +"Note: This JSON requirement is provided as an example. Please construct your own set of requirements tailored to your specific use case." **Returns**: A JSON list of Node Candidates. #### 7.2- getLengthOfNodeCandidates endpoint: