private static boolean isEqual(ComputeResourceDescription comRes_1, ComputeResourceDescription comRes_2) { return comRes_1.getComputeResourceId().equals(comRes_2.getComputeResourceId()) && comRes_1.getHostName().equals(comRes_2.getHostName()); }
/** * Construct and return the path for a given MonitorID , eg: /stat/{username}/{resourceName}/job * @param monitorID - Job monitorId * @return */ public static String getJobCountUpdatePath(MonitorID monitorID){ return new StringBuilder("/").append(Constants.STAT).append("/").append(monitorID.getUserName()) .append("/").append(monitorID.getComputeResourceDescription().getHostName()).append("/").append(Constants.JOB).toString(); }
public static String getChannelID(MonitorID monitorID) { return monitorID.getUserName() + "-" + monitorID.getComputeResourceDescription().getHostName(); }
@Override public String addComputeResource(ComputeResourceDescription description) throws AppCatalogException { try { if (description.getComputeResourceId().equals("") || description.getComputeResourceId().equals(compute_resource_modelConstants.DEFAULT_ID)){ description.setComputeResourceId(AppCatalogUtils.getID(description.getHostName())); } return saveComputeResourceDescriptorData(description); } catch (Exception e) { logger.error("Error while saving compute resource...", e); throw new AppCatalogException(e); } }
@Override public String addComputeResource(ComputeResourceDescription description) throws AppCatalogException { try { if (description.getComputeResourceId().equals("") || description.getComputeResourceId().equals(computeResourceModelConstants.DEFAULT_ID)){ description.setComputeResourceId(AppCatalogUtils.getID(description.getHostName())); } return saveComputeResourceDescriptorData(description); } catch (Exception e) { logger.error("Error while saving compute resource...", e); throw new AppCatalogException(e); } }
public ResourceConnection(HostMonitorData hostMonitorData,AuthenticationInfo authInfo) throws SSHApiException { MonitorID monitorID = hostMonitorData.getMonitorIDs().get(0); try { SecurityContext securityContext = monitorID.getJobExecutionContext().getSecurityContext(monitorID.getComputeResourceDescription().getHostName()); if(securityContext != null) { if (securityContext instanceof GSISecurityContext) { GSISecurityContext gsiSecurityContext = (GSISecurityContext) securityContext; cluster = (PBSCluster) gsiSecurityContext.getPbsCluster(); } else if (securityContext instanceof SSHSecurityContext) { SSHSecurityContext sshSecurityContext = (SSHSecurityContext) securityContext; cluster = (PBSCluster) sshSecurityContext.getPbsCluster(); } } // we just use cluster configuration from the incoming request and construct a new cluster because for monitoring // we are using our own credentials and not using one users account to do everything. authenticationInfo = authInfo; } catch (GFacException e) { log.error("Error reading data from job ExecutionContext"); } }
public ResourceConnection(HostMonitorData hostMonitorData) throws SSHApiException { MonitorID monitorID = hostMonitorData.getMonitorIDs().get(0); try { GSISecurityContext securityContext = (GSISecurityContext) monitorID.getJobExecutionContext().getSecurityContext(monitorID.getComputeResourceDescription().getHostName()); cluster = (PBSCluster) securityContext.getPbsCluster(); // we just use cluster configuration from the incoming request and construct a new cluster because for monitoring // we are using our own credentials and not using one users account to do everything. cluster = new PBSCluster(cluster.getServerInfo(), authenticationInfo, cluster.getJobManagerConfiguration()); } catch (GFacException e) { log.error("Error reading data from job ExecutionContext"); } }
String error = "Error submitting the job to host " + computeResourceDescription.getHostName() + " message: " + e.getMessage(); log.error(error); jobDetails.setJobID("none");
" , ComputeResourceDescription " + computeResourceDescription.getHostName() + " doesn't has an " + "IpAddress with it");
public static ComputeResourceResource getComputeHostResource (ComputeResourceDescription description){ ComputeResourceResource resource = new ComputeResourceResource(); resource.setHostName(description.getHostName()); resource.setResourceDescription(description.getResourceDescription()); resource.setResourceId(description.getComputeResourceId()); resource.setMaxMemoryPerNode(description.getMaxMemoryPerNode()); resource.setEnabled(description.isEnabled()); return resource; }
HostMonitorData iHostMonitorData = hostIterator.next(); if (iHostMonitorData.getJobSubmissionProtocol() == JobSubmissionProtocol.SSH) { String hostName = iHostMonitorData.getComputeResourceDescription().getHostName(); ResourceConnection connection = null; if (connections.containsKey(hostName)) { getComputeResourceDescription().getHostName()); if (iHostMonitorID.getMonitorIDs().size() == 0) { iterator1.remove(); logger.debug("Removed host {} from monitoring queue", iHostMonitorID.getComputeResourceDescription().getHostName());
if (flags != null && processContext.getComputeResourceDescription().getHostName().equals("stampede.tacc.xsede.org")) { flags = "ALL";
public static ComputeResourceResource getComputeHostResource (ComputeResourceDescription description){ ComputeResourceResource resource = new ComputeResourceResource(); resource.setHostName(description.getHostName()); resource.setResourceDescription(description.getResourceDescription()); resource.setResourceId(description.getComputeResourceId()); resource.setMaxMemoryPerNode(description.getMaxMemoryPerNode()); resource.setEnabled(description.isEnabled()); resource.setGatewayUsageReporting(description.isGatewayUsageReporting()); resource.setGatewayUsageExec(description.getGatewayUsageExecutable()); resource.setGatewayUsageModLoadCMD(description.getGatewayUsageModuleLoadCommand()); return resource; }
if (flags != null && jobExecutionContext.getApplicationContext().getComputeResourceDescription().getHostName().equals("stampede.tacc.xsede.org")) { flags = "ALL";
return getHostName();