diff --git a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/broker_communication/SALCommunicator.java b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/broker_communication/SALCommunicator.java index 526525e..aae9829 100644 --- a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/broker_communication/SALCommunicator.java +++ b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/broker_communication/SALCommunicator.java @@ -148,7 +148,7 @@ public static String get_device_deregistration_json(Device device){ return root_json_object.toJSONString(); } - public static String get_device_registration_json(String internal_ip_address, String external_ip_address, int external_access_port, String os_family, String os_architecture, String jar_url, int os_version, int cpu_cores, long ram_gb, long disk_gb, int number_of_gpus, String device_name,Double price, String provider_id, String city_name, String country_name, String device_username, String device_password, String private_key, double device_longitude, double device_latitude) { + public static String get_device_registration_json(String internal_ip_address, String external_ip_address, int external_access_port, String os_family, String os_architecture, String jar_url, int os_version, int cpu_cores, long ram_gb, long disk_gb, int number_of_gpus, int number_of_fpgas, String device_name,Double price, String provider_id, String city_name, String country_name, String device_username, String device_password, String private_key, double device_longitude, double device_latitude) { JSONObject root_json_object = new JSONObject(); JSONObject loginCredential = new JSONObject(); @@ -187,6 +187,7 @@ public static String get_device_registration_json(String internal_ip_address, St nodeProperties.put("disk", disk_gb); nodeProperties.put("price", price); nodeProperties.put("gpu", number_of_gpus); + nodeProperties.put("fpga", number_of_fpgas); nodeProperties.put("operatingSystem", operatingSystem); nodeProperties.put("geoLocation", geoLocation); diff --git a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/registration/service/SALRegistrationService.java b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/registration/service/SALRegistrationService.java index 7d3faf0..68b58ad 100644 --- a/resource-discovery/src/main/java/eu/nebulous/resource/discovery/registration/service/SALRegistrationService.java +++ b/resource-discovery/src/main/java/eu/nebulous/resource/discovery/registration/service/SALRegistrationService.java @@ -76,6 +76,7 @@ public String register(Device device) { Double price = device.getPrice(); int number_of_gpus = 0; + int number_of_fpgas = 0; int cores = Integer.parseInt(device_info.get("CPU_PROCESSORS")); long ram_mb = Math.round(Integer.parseInt(device_info.get("RAM_TOTAL_KB"))*1.0/1000); long disk_mb = Math.round(Integer.parseInt(device_info.get("DISK_TOTAL_KB"))*1.0/1000); @@ -122,7 +123,7 @@ public String register(Device device) { //register_device_message.put("timestamp",(int)(clock.millis()/1000)); - String register_device_message_string = get_device_registration_json(internal_ip,external_ip_address,external_access_port,os_family,os_architecture,jar_url,os_version,cores,ram_mb,disk_mb,number_of_gpus,device_name,price,provider_id,city_name,country_name, device_username, device_password,private_key,device_longitude, device_latitude); + String register_device_message_string = get_device_registration_json(internal_ip,external_ip_address,external_access_port,os_family,os_architecture,jar_url,os_version,cores,ram_mb,disk_mb,number_of_gpus,number_of_fpgas,device_name,price,provider_id,city_name,country_name, device_username, device_password,private_key,device_longitude, device_latitude); log.info("topic is {}", get_registration_topic_name(application_name)); log.info("broker ip is {}", processorProperties.getNebulous_broker_ip_address()); log.info("broker port is {}", processorProperties.getNebulous_broker_port());