From 88c1a3e9bd0fddebf2a76566e97165a428af5b88 Mon Sep 17 00:00:00 2001 From: jasonsoti1 Date: Fri, 15 Jul 2022 18:32:02 +0300 Subject: [PATCH] post model changes --- nbactions-JaqpotLocal.xml | 15 +++++++++++++++ .../jaqpot/core/properties/PropertyManager.java | 12 ++++++------ .../core/service/resource/ModelResource.java | 17 ++++++++++++++--- 3 files changed, 35 insertions(+), 9 deletions(-) diff --git a/nbactions-JaqpotLocal.xml b/nbactions-JaqpotLocal.xml index b71da9c0..3eb30d77 100644 --- a/nbactions-JaqpotLocal.xml +++ b/nbactions-JaqpotLocal.xml @@ -10,5 +10,20 @@ package + + "-Xms2048m -Xmx2048m -XX:MetaspaceSize=2048M -XX:MaxMetaspaceSize=2048m -Djava.net.preferIPv4Stack=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true" + + + + debug + + war + + + -Xdebug -Xrunjdwp:transport=dt_socket,server=n,address=${jpda.address} + true + true + "-Xms2048m -Xmx2048m -XX:MetaspaceSize=2048M -XX:MaxMetaspaceSize=2048m -Djava.net.preferIPv4Stack=true -agentlib:jdwp=transport=dt_socket,address=8787,server=y,suspend=n -Djboss.modules.system.pkgs=$JBOSS_MODULES_SYSTEM_PKGS -Djava.awt.headless=true" + diff --git a/src/main/java/org/jaqpot/core/properties/PropertyManager.java b/src/main/java/org/jaqpot/core/properties/PropertyManager.java index c72e850f..1cfd61b8 100644 --- a/src/main/java/org/jaqpot/core/properties/PropertyManager.java +++ b/src/main/java/org/jaqpot/core/properties/PropertyManager.java @@ -90,13 +90,13 @@ public enum PropertyType { OCPU_LM_BASE("ocpulm.base", "config", "http://test.jaqpot.org:8004/"), HTTK_BASE("httk.base", "config", "http://jaqpot.org:8011/"), - // OIDC_ISSUER("oidc.issuer", "config", "https://login.jaqpot.org/auth/realms/jaqpot/"), - // OIDC_CLIENT_ID("oidc.client.id", "config", "jaqpot-api"), - // OIDC_CLIENT_PASS("oidc.client.pass", "config", "9dccac19-23c6-49be-83be-8f07859d263f"), - - OIDC_ISSUER("oidc.issuer", "config", "https://login.eosc.jaqpot.org/auth/realms/master/"), + OIDC_ISSUER("oidc.issuer", "config", "https://login.jaqpot.org/auth/realms/jaqpot/"), OIDC_CLIENT_ID("oidc.client.id", "config", "jaqpot-api"), - OIDC_CLIENT_PASS("oidc.client.pass", "config", "b478b3f8-42d7-43bf-afa1-5370516bb97f"), + OIDC_CLIENT_PASS("oidc.client.pass", "config", "9dccac19-23c6-49be-83be-8f07859d263f"), + +// OIDC_ISSUER("oidc.issuer", "config", "https://login.eosc.jaqpot.org/auth/realms/master/"), +// OIDC_CLIENT_ID("oidc.client.id", "config", "jaqpot-api"), +// OIDC_CLIENT_PASS("oidc.client.pass", "config", "b478b3f8-42d7-43bf-afa1-5370516bb97f"), OIDC_PROVIDER_CONF("oidc.provider.conf", "config", ".well-known/openid-configuration"), ELASTIC_HOST("elastic.host", "config", "192.168.10.100"), diff --git a/src/main/java/org/jaqpot/core/service/resource/ModelResource.java b/src/main/java/org/jaqpot/core/service/resource/ModelResource.java index b9192bf6..b54d74b4 100644 --- a/src/main/java/org/jaqpot/core/service/resource/ModelResource.java +++ b/src/main/java/org/jaqpot/core/service/resource/ModelResource.java @@ -159,10 +159,9 @@ public class ModelResource { @EJB PredictionService predictionService; - @EJB JsonPredictionService jsonPredictionService; - + @EJB FeatureHandler featureHandler; @@ -846,7 +845,7 @@ public Response portModelPart( modelHandler.updateField(parts.getModelId(), "actualModel", actualModel); } catch (BsonMaximumSizeExceededException | JaqpotDocumentSizeExceededException | EJBTransactionRolledbackException e) { - + LOG.log(Level.INFO, "Model will be stored as parts"); // byte[] bytes = s.toString().getBytes(StandardCharsets.UTF_8); @@ -920,6 +919,18 @@ public Response storePretrained( model.setAlgorithm(algo); } + if (pretrainedModelRequest.getJaqpotpyDockerVersion() != null) { + String constantPart = "jaqpot-docker-"; + String algoId = constantPart + pretrainedModelRequest.getJaqpotpyDockerVersion() + "-pretrained"; + Algorithm algo = algoHandler.find(algoId); + model.setAlgorithm(algo); + } else { + String constantPart = "jaqpot-docker-"; + String algoId = constantPart + "default-pretrained"; + Algorithm algo = algoHandler.find(algoId); + model.setAlgorithm(algo); + } + MetaInfo mf = new MetaInfo(); Set titles = new HashSet(); Set descriptions = new HashSet();