Skip to content

Commit

Permalink
Merge branch 'master' into azure-integration
Browse files Browse the repository at this point in the history
  • Loading branch information
mbenguig committed Dec 2, 2024
2 parents ac5bc3e + ea3a007 commit fc88745
Show file tree
Hide file tree
Showing 14 changed files with 494 additions and 1,205 deletions.
36 changes: 22 additions & 14 deletions endpoints/4-edge-endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ This endpoint is used to register new Edge nodes, which are passed as an [EdgeDe
}
],
"nodeProperties": {
"providerId": "1",
"numberOfCores": "{{cores}}",
"memory": "{{memory}}",
"price": "{{price}}",
"providerId": "{{providerID}}",
"cores": "{{cores}}",
"cpuFrequency": "{{cpuFrequency}}",
"ram": "{{ram}}",
"disk": "{{disk}}",
"fpga": "{{fpga}}",
"gpu": "{{gpu}}",
"operatingSystem": {
"operatingSystemFamily": "{{OS_name}}",
"operatingSystemArchitecture": "{{OS_architecture}}",
Expand All @@ -64,21 +68,25 @@ This endpoint is used to register new Edge nodes, which are passed as an [EdgeDe
- Information registered in node candidate for hardware, location, and image that represent the device.

The fields are defined as:
- `name`: The name of the edge node. This is used for identification and management within the cluster.
- `name`(String): The name of the edge node, used for identification and management within the cluster.
- `loginCredential`: Contains authentication details for accessing the edge node. The username and password are required for SSH access, with an option for a privateKey instead of a password.
- `ipAddresses`: A list of IP addresses associated with the node, including both PUBLIC_IP and PRIVATE_IP with IP Version specified as V4.
- `nodeProperties`:
- `providerId`: The ID of the provider. Default is `"1"`.
- `numberOfCores`: A string representing number of hardware cores (e.g., `"1"`).
- `memory`: The hardware memory in GB (e.g., `"1"`)
- `disk`: The hardware storage space in GB (e.g., `"1.0"`).
- `nodeProperties`: Represents the properties being transmitted to a node candidate, reflecting the attributes of the registered edge device.
- `price`(Double): The price of the edge node source.
- `providerId` (String): The unique identifier of the provider.
- `cores`(Integer): The number of CPU cores the node possesses.
- `cpuFrequency`(Double): The CPU frequency in GHz.
- `ram`(Long): The hardware's RAM memory in MB.
- `disk`(Double): The hardware's storage space in GB.
- `fpga`(Integer): The number of FPGAs (Field-Programmable Gate Arrays) available on the node.
- `gpu`(Integer): The number of GPUs (Graphics Processing Units) available on the node.
- `operatingSystem`: Information about the OS, including Family, Architecture, and Version.
- `geoLocation`: The physical location details, such as city, country, latitude, and longitude of the edge node.
- `port`: The port on which the edge node is accessible.
- `jobId`: ProActive Job ID associated with the edge node. Set to `"0"` or `"any"` if no job is linked.
- `systemArch`: The system architecture, which must be one of `"AMD"`, `"ARMv8"`, or `"ARMv7"`.
- `scriptURL`: A URL pointing to any script required during the node setup.
- `jarURL`: The URL for the node's executable `.jar` file, which corresponds to the `systemArch`.
- `port` (String): The port number on which the edge node is accessible.
- `jobId`(String): The ProActive Job ID associated with the edge node. Set to `"0"` or `"any"`, or `null`, if no job is linked. Note that value `"any"` will be assigned to the jobId in this case indicating that there is no deployment on given device. When the deployment is sent to the edge device, the value will be replaced with name of ProActive deployment job.
- `systemArch`(String): The system architecture, which must be one of `"AMD"`, `"ARMv8"`, or `"ARMv7"`.
- `scriptURL`(String): A URL pointing to a script required for setting up the node.
- `jarURL`(String): The URL for the node's executable `.jar` file, which corresponds to the `systemArch`.

Each system architecture requires a specific `jarURL` for node execution, available from your ProActive installation. To obtain these `.jar` files, access the ProActive Resource Manager portal and go to _Portal -> Launch a Node_. Here are examples for various architectures:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,41 +10,76 @@
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.*;
import lombok.experimental.Accessors;


/**
* Attributes defining a BYON node
* Attributes defining an EDGE node
*/
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode
@Getter
@Setter
@ToString(callSuper = true)
public class EdgeDefinition {
@JsonProperty("name")

public static final String DEFAULT_PORT = "22";

public static final String ANY_JOB_ID = "any";

public static final String JSON_NAME = "name";

public static final String JSON_LOGIN_CREDENTIAL = "loginCredential";

public static final String JSON_IP_ADDRESSES = "ipAddresses";

public static final String JSON_NODE_PROPERTIES = "nodeProperties";

public static final String JSON_PORT = "port";

public static final String JSON_REASON = "reason";

public static final String JSON_DIAGNOSTIC = "diagnostic";

public static final String JSON_USER_ID = "userId";

public static final String JSON_ALLOCATED = "allocated";

// edge jobID corresponds to the ProActive job name
public static final String JSON_JOB_ID = "jobId";

public static final String JSON_SYSTEM_ARCH = "systemArch";

public static final String JSON_SCRIPT_URL = "scriptURL";

public static final String JSON_JAR_URL = "jarURL";

@JsonProperty(JSON_NAME)
private String name = null;

@JsonProperty("jobId")
@JsonProperty(JSON_JOB_ID)
private String jobId = null;

@JsonProperty("systemArch")
@JsonProperty(JSON_SYSTEM_ARCH)
private String systemArch = null;

@JsonProperty("scriptURL")
@JsonProperty(JSON_SCRIPT_URL)
private String scriptURL = null;

@JsonProperty("jarURL")
@JsonProperty(JSON_JAR_URL)
private String jarURL = null;

@JsonProperty("loginCredential")
@JsonProperty(JSON_LOGIN_CREDENTIAL)
private LoginCredential loginCredential = null;

@JsonProperty("ipAddresses")
@JsonProperty(JSON_IP_ADDRESSES)
private List<IpAddress> ipAddresses = null;

@JsonProperty("port")
private String port = "22";
@JsonProperty(JSON_PORT)
private String port = DEFAULT_PORT;

@JsonProperty("nodeProperties")
@JsonProperty(JSON_NODE_PROPERTIES)
private NodeProperties nodeProperties = null;
}
118 changes: 15 additions & 103 deletions sal-common/src/main/java/org/ow2/proactive/sal/model/EdgeNode.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.fasterxml.jackson.annotation.JsonProperty;

import lombok.AllArgsConstructor;
import lombok.EqualsAndHashCode;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
Expand All @@ -25,154 +26,65 @@
@AllArgsConstructor
@NoArgsConstructor
@Entity
@Table(name = "EDGE_NODE")
@Getter
@Setter
@Table(name = "EDGE_NODE")
@EqualsAndHashCode
public class EdgeNode extends AbstractNode {

@Column(name = "NAME")
@JsonProperty("name")
@JsonProperty(EdgeDefinition.JSON_NAME)
private String name = null;

@Embedded
@JsonProperty("loginCredential")
@JsonProperty(EdgeDefinition.JSON_LOGIN_CREDENTIAL)
private LoginCredential loginCredential = null;

@ElementCollection(targetClass = IpAddress.class)
private List<IpAddress> ipAddresses = null;

@Embedded
@JsonProperty("nodeProperties")
@JsonProperty(EdgeDefinition.JSON_NODE_PROPERTIES)
private NodeProperties nodeProperties = null;

@Column(name = "PORT")
@JsonProperty("port")
@JsonProperty(EdgeDefinition.JSON_PORT)
private String port = null;

@Column(name = "REASON")
@JsonProperty("reason")
@JsonProperty(EdgeDefinition.JSON_REASON)
private String reason = null;

@Column(name = "DIAGNOSTIC")
@JsonProperty("diagnostic")
@JsonProperty(EdgeDefinition.JSON_DIAGNOSTIC)
private String diagnostic = null;

@Column(name = "USER_ID")
@JsonProperty("userId")
@JsonProperty(EdgeDefinition.JSON_USER_ID)
private String userId = null;

@Column(name = "ALLOCATED")
@JsonProperty("allocated")
@JsonProperty(EdgeDefinition.JSON_ALLOCATED)
private Boolean allocated = null;

@Column(name = "JOB_ID")
@JsonProperty("jobId")
@JsonProperty(EdgeDefinition.JSON_JOB_ID)
private String jobId;

@Column(name = "SYSTEM_ARCH")
@JsonProperty("systemArch")
@JsonProperty(EdgeDefinition.JSON_SYSTEM_ARCH)
private String systemArch = null;

@JsonProperty("scriptURL")
@JsonProperty(EdgeDefinition.JSON_SCRIPT_URL)
private String scriptURL = null;

@JsonProperty("jarURL")
@JsonProperty(EdgeDefinition.JSON_JAR_URL)
private String jarURL = null;

public EdgeNode name(String name) {
this.setName(name);
return this;
}

public EdgeNode loginCredential(LoginCredential loginCredential) {
this.setLoginCredential(loginCredential);
return this;
}

public EdgeNode ipAddresses(List<IpAddress> ipAddresses) {
this.setIpAddresses(ipAddresses);
return this;
}

public EdgeNode addIpAddressesItem(IpAddress ipAddressesItem) {
this.addIpAddressesItem(ipAddressesItem);
return this;
}

public EdgeNode nodeProperties(NodeProperties nodeProperties) {
this.setNodeProperties(nodeProperties);
return this;
}

public EdgeNode reason(String reason) {
this.setReason(reason);
return this;
}

public EdgeNode diagnostic(String diagnostic) {
this.setDiagnostic(diagnostic);
return this;
}

public EdgeNode id(String id) {
this.setId(id);
return this;
}

public EdgeNode userId(String userId) {
this.setUserId(userId);
return this;
}

public EdgeNode allocated(Boolean allocated) {
this.setAllocated(allocated);
return this;
}

public String composeNodeSourceName() {
return "EDGE_NS_" + this.systemArch + "_" + this.id;
}

public boolean equals(Object o) {
if (this == o) {
return true;
}
if (o == null || getClass() != o.getClass()) {
return false;
}
EdgeNode edgeNode = (EdgeNode) o;
return Objects.equals(this.name, edgeNode.getName()) &&
Objects.equals(this.loginCredential, edgeNode.getLoginCredential()) &&
Objects.equals(this.ipAddresses, edgeNode.getIpAddresses()) &&
Objects.equals(this.nodeProperties, edgeNode.getNodeProperties()) &&
Objects.equals(this.reason, edgeNode.getReason()) &&
Objects.equals(this.diagnostic, edgeNode.getDiagnostic()) &&
Objects.equals(this.nodeCandidate, edgeNode.getNodeCandidate()) &&
Objects.equals(this.id, edgeNode.getId()) && Objects.equals(this.userId, edgeNode.getUserId()) &&
Objects.equals(this.allocated, edgeNode.getAllocated()) &&
Objects.equals(this.jobId, edgeNode.getJobId()) &&
Objects.equals(this.systemArch, edgeNode.getSystemArch()) &&
Objects.equals(this.scriptURL, edgeNode.getScriptURL()) && Objects.equals(jarURL, edgeNode.getJarURL());
}

@Override
public int hashCode() {
return Objects.hash(this.name,
this.id,
this.loginCredential,
this.ipAddresses,
this.nodeProperties,
this.reason,
this.diagnostic,
this.nodeProperties,
this.userId,
this.allocated,
this.jobId,
this.systemArch,
this.scriptURL,
this.jarURL);
}

@Override
public String toString() {
StringBuilder sb = new StringBuilder();
Expand Down
Loading

0 comments on commit fc88745

Please sign in to comment.