This commit is contained in:
lucio 2023-04-04 09:30:03 +02:00
parent 056f0a3b0d
commit ad0c2e2e67
3 changed files with 23 additions and 20 deletions

19
pom.xml
View File

@ -6,19 +6,16 @@
<artifactId>legacy-is-publisher-connector</artifactId> <artifactId>legacy-is-publisher-connector</artifactId>
<version>1.0.0-SNAPSHOT</version> <version>1.0.0-SNAPSHOT</version>
<name>Legacy is publisher</name> <name>Legacy is publisher</name>
<scm> <scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</connection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</connection>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</developerConnection> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</developerConnection>
<url>https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</url> <url>https://code-repo.d4science.org/gCubeSystem/legacy-is-publisher-connector</url>
</scm> </scm>
<parent> <parent>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<version>1.1.0</version> <version>1.1.0</version>
</parent> </parent>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
@ -30,7 +27,6 @@
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
@ -52,11 +48,9 @@
<groupId>org.gcube.resources.discovery</groupId> <groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId> <artifactId>ic-client</artifactId>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.resources</groupId> <groupId>org.gcube.resources</groupId>
<artifactId>common-gcore-resources</artifactId> <artifactId>common-gcore-resources</artifactId>
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
@ -64,7 +58,16 @@
<version>4.0.1</version> <version>4.0.1</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.3.3</version>
<type>pom</type>
</dependency>
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>rt</artifactId>
<version>2.3.3</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -39,9 +39,9 @@ public class ApplicationProfileBuilder {
endpoint.profile() endpoint.profile()
.description(configuration.description()) .description(configuration.description())
.serviceName(configuration.name()) .serviceName(configuration.name())
.serviceClass(configuration.serviceClass()) .serviceClass(configuration.group())
.version(configuration.version()) .version(configuration.version())
.serviceId(configuration.name() + configuration.serviceClass() + configuration.version()) .serviceId(configuration.name() + configuration.group() + configuration.version())
.ghnId(context.container().id()); .ghnId(context.container().id());
endpoint.profile().newDeploymentData() endpoint.profile().newDeploymentData()
@ -53,8 +53,8 @@ public class ApplicationProfileBuilder {
endpoint.profile().endpoints().clear(); endpoint.profile().endpoints().clear();
String baseAddress; String baseAddress;
if (configuration.proxyAddress()!=null){ if (configuration.proxable() && container.proxy()!=null){
ProxyAddress proxy = configuration.proxyAddress(); ProxyAddress proxy = container.proxy();
String protocol = proxy.getProtocol(); String protocol = proxy.getProtocol();
String port = proxy.getPort()!=null?":"+proxy.getPort():""; String port = proxy.getPort()!=null?":"+proxy.getPort():"";

View File

@ -21,8 +21,8 @@ import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.GHNT
import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Processor; import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Processor;
import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Variable; import org.gcube.common.resources.gcore.HostingNode.Profile.NodeDescription.Variable;
import org.gcube.common.resources.gcore.utils.Group; import org.gcube.common.resources.gcore.utils.Group;
import org.gcube.smartgears.configuration.SmartgearsConfiguration;
import org.gcube.smartgears.configuration.container.ContainerConfiguration; import org.gcube.smartgears.configuration.container.ContainerConfiguration;
import org.gcube.smartgears.configuration.library.SmartGearsConfiguration;
import org.gcube.smartgears.context.container.ContainerContext; import org.gcube.smartgears.context.container.ContainerContext;
import org.gcube.smartgears.provider.ProviderFactory; import org.gcube.smartgears.provider.ProviderFactory;
import org.slf4j.Logger; import org.slf4j.Logger;
@ -84,7 +84,7 @@ public class ContainerProfileBuilder {
processors.add().bogomips(new BigDecimal(map.get("bogomips"))) processors.add().bogomips(new BigDecimal(map.get("bogomips")))
.clockSpeedMhz(new BigDecimal(map.get("cpu_MHz"))).family(map.get("cpu_family")) .clockSpeedMhz(new BigDecimal(map.get("cpu_MHz"))).family(map.get("cpu_family"))
.modelName(map.get("model_name")).model(map.get("model")).vendor(map.get("vendor_id")) .modelName(map.get("model_name")).model(map.get("model")).vendor(map.get("vendor_id"))
.cacheL1(new Integer(map.get("cache_size"))).cacheL1D(0).cacheL1I(0).cacheL2(0); .cacheL1(Integer.parseInt(map.get("cache_size"))).cacheL1D(0).cacheL1I(0).cacheL2(0);
addVariablesTo(node); addVariablesTo(node);
@ -194,7 +194,7 @@ public class ContainerProfileBuilder {
private long getFreeSpace() { private long getFreeSpace() {
long free = 0; long free = 0;
try { try {
free = context.configuration().persistence().getFreeSpace()/1024; free = context.persistenceWriter().getFreeSpace()/1024;
} catch (Exception ioe) { } catch (Exception ioe) {
log.warn("unable to detect the free space on the disk", ioe); log.warn("unable to detect the free space on the disk", ioe);
} }
@ -275,8 +275,8 @@ public class ContainerProfileBuilder {
variables.add().keyAndValue("Java", System.getProperty("java.version")); variables.add().keyAndValue("Java", System.getProperty("java.version"));
SmartGearsConfiguration config = ProviderFactory.provider().smartgearsConfiguration(); SmartgearsConfiguration config = ProviderFactory.provider().smartgearsConfiguration();
variables.add().keyAndValue("SmartGears",config.version()); variables.add().keyAndValue("SmartGears",config.getVersion());
variables.add().keyAndValue("ghn-update-interval-in-secs", String.valueOf(cfg.publicationFrequency())); variables.add().keyAndValue("ghn-update-interval-in-secs", String.valueOf(cfg.publicationFrequency()));
@ -315,9 +315,9 @@ public class ContainerProfileBuilder {
Pattern p = Pattern.compile("^(.*?)\\s{1}(.*?)\\s{1}(.*?)\\s{1}(.*)$"); Pattern p = Pattern.compile("^(.*?)\\s{1}(.*?)\\s{1}(.*?)\\s{1}(.*)$");
Matcher matcher = p.matcher(content.toString()); Matcher matcher = p.matcher(content.toString());
if ((matcher.matches()) && (matcher.groupCount() > 3)) { if ((matcher.matches()) && (matcher.groupCount() > 3)) {
result.put("1min", new Double(matcher.group(1))); result.put("1min", Double.valueOf(matcher.group(1)));
result.put("5mins", new Double(matcher.group(2))); result.put("5mins", Double.valueOf(matcher.group(2)));
result.put("15mins", new Double(matcher.group(3).split("\\s")[0])); result.put("15mins", Double.valueOf(matcher.group(3).split("\\s")[0]));
} }
} }
} catch (Exception ioe) { } catch (Exception ioe) {