diff --git a/.flattened-pom.xml b/.flattened-pom.xml index f53a22e3..51614bb5 100644 --- a/.flattened-pom.xml +++ b/.flattened-pom.xml @@ -4,6 +4,6 @@ 4.0.0 it.smartcommunitylabdhub digitalhub-core - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT pom diff --git a/.gitignore b/.gitignore index 12be5a9f..361681aa 100644 --- a/.gitignore +++ b/.gitignore @@ -33,22 +33,16 @@ build/ .vscode/ .vscode/launch.json -### Env variable ### +### Nodejs ### .env - node_modules -### Checkstyle folder### -/src/checkstyle ### Sonar ### .scannerwork/ -/wrapper/*/sdk -/wrapper/*/wrapper.py -/wrapper/nefertem/nefertem - -/data/* - +### Data ## +/data/ +/application/data/ /application/src/main/resources/application-local.yml /reports diff --git a/Dockerfile b/Dockerfile index 65b778e8..126100b8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -11,7 +11,7 @@ RUN --mount=type=cache,target=/root/.m2,source=/cache/.m2,from=ghcr.io/scc-digit --mount=type=cache,target=/tmp/frontend/console/node_modules,source=/cache/frontend/console/node_modules,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ mvn install -pl frontend RUN --mount=type=cache,target=/root/.m2,source=/cache/.m2,from=ghcr.io/scc-digitalhub/digitalhub-core:cache \ - mvn package -DskipTests -pl '!frontend' + mvn package -pl '!frontend' FROM maven:3-eclipse-temurin-21-alpine as builder WORKDIR /tmp diff --git a/application/pom.xml b/application/pom.xml index 021ec16d..cd479841 100644 --- a/application/pom.xml +++ b/application/pom.xml @@ -18,10 +18,10 @@ it.smartcommunitylabdhub core core - 0.3.0 + 0.4.0-SNAPSHOT Digital Hub Core - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT 21 6.2.0 2023.0.0 diff --git a/application/src/test/java/it/smartcommunitylabdhub/core/CoreApplicationTests.java b/application/src/test/java/it/smartcommunitylabdhub/core/CoreApplicationTests.java deleted file mode 100644 index e8e765f9..00000000 --- a/application/src/test/java/it/smartcommunitylabdhub/core/CoreApplicationTests.java +++ /dev/null @@ -1,11 +0,0 @@ -package it.smartcommunitylabdhub.core; - -import org.junit.jupiter.api.Test; -import org.springframework.boot.test.context.SpringBootTest; - -@SpringBootTest -class CoreApplicationTests { - - @Test - void contextLoads() {} -} diff --git a/application/src/test/java/it/smartcommunitylabdhub/core/PersonSerializationTest.java b/application/src/test/java/it/smartcommunitylabdhub/core/PersonSerializationTest.java deleted file mode 100644 index bee85353..00000000 --- a/application/src/test/java/it/smartcommunitylabdhub/core/PersonSerializationTest.java +++ /dev/null @@ -1,96 +0,0 @@ -package it.smartcommunitylabdhub.core; - -import static org.junit.jupiter.api.Assertions.assertEquals; - -import com.fasterxml.jackson.annotation.JsonProperty; -import com.fasterxml.jackson.annotation.JsonValue; -import com.fasterxml.jackson.databind.ObjectMapper; -import com.fasterxml.jackson.databind.annotation.JsonSerialize; -import com.fasterxml.jackson.databind.module.SimpleModule; -import com.fasterxml.jackson.databind.ser.std.StdSerializer; -import java.io.IOException; -import org.junit.jupiter.api.Test; - -public class PersonSerializationTest { - - @Test - public void testPersonSerialization() throws IOException { - ObjectMapper objectMapper = new ObjectMapper(); - SimpleModule module = new SimpleModule(); - module.setMixInAnnotation(Person.class, PersonMixin.class); - objectMapper.registerModule(module); - - Person person = new Person(); - person.setName("John Doe"); - person.setAge(30); - - String json = objectMapper.writeValueAsString(person); - - // Verify the serialized JSON - assertEquals("{\"full_name\":\"John Doe\",\"age\":\"60\"}", json); - - // Deserialize and verify - Person deserializedPerson = objectMapper.readValue(json, Person.class); - assertEquals(person.getName(), deserializedPerson.getName()); - assertEquals(person.getAge(), deserializedPerson.getAge()); - } - - public static class Person { - - private String name; - private int age; - - // Getters and setters (or lombok annotations) omitted for brevity - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public int getAge() { - return age; - } - - public void setAge(int age) { - this.age = age; - } - } - - public abstract static class PersonMixin { - - @JsonValue - abstract String serializePerson(); - - @JsonProperty("full_name") - abstract String getName(); - - @JsonSerialize(using = CustomAgeSerializer.class) - abstract int getAge(); - } - - public static class CustomAgeSerializer extends StdSerializer { - - public CustomAgeSerializer() { - this(null); - } - - public CustomAgeSerializer(Class t) { - super(t); - } - - @Override - public void serialize( - Integer age, - com.fasterxml.jackson.core.JsonGenerator jsonGenerator, - com.fasterxml.jackson.databind.SerializerProvider serializerProvider - ) throws IOException { - // Perform custom calculation or transformation on the age before serialization - int modifiedAge = age * 2; - - // Serialize the modified age - jsonGenerator.writeString(String.valueOf(modifiedAge)); - } - } -} diff --git a/frontend/.flattened-pom.xml b/frontend/.flattened-pom.xml index dfdb114f..86e6ee5e 100644 --- a/frontend/.flattened-pom.xml +++ b/frontend/.flattened-pom.xml @@ -4,7 +4,7 @@ 4.0.0 it.smartcommunitylabdhub dh-console - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT org.projectlombok @@ -40,7 +40,7 @@ it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/commons/.flattened-pom.xml b/modules/commons/.flattened-pom.xml index 2cb01418..74d76a90 100644 --- a/modules/commons/.flattened-pom.xml +++ b/modules/commons/.flattened-pom.xml @@ -4,7 +4,7 @@ 4.0.0 it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT org.projectlombok diff --git a/modules/framework-k8s/.flattened-pom.xml b/modules/framework-k8s/.flattened-pom.xml index 5dbed684..fe82a506 100644 --- a/modules/framework-k8s/.flattened-pom.xml +++ b/modules/framework-k8s/.flattened-pom.xml @@ -4,18 +4,18 @@ 4.0.0 it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-fsm - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTests.java b/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTest.java similarity index 89% rename from modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTests.java rename to modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTest.java index 9c66aa8d..0d2196ed 100644 --- a/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTests.java +++ b/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/K8sSecretHelperTest.java @@ -3,6 +3,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import io.kubernetes.client.openapi.ApiException; +import it.smartcommunitylabdhub.framework.k8s.annotations.ConditionalOnKubernetes; import it.smartcommunitylabdhub.framework.k8s.kubernetes.K8sSecretHelper; import java.util.Collections; import java.util.HashMap; @@ -12,13 +13,14 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.boot.test.context.SpringBootTest; -@SpringBootTest -class K8sSecretHelperTests { +// @SpringBootTest +public class K8sSecretHelperTest { - @Autowired + @Autowired(required = false) private K8sSecretHelper helper; - @Test + // @Test + @ConditionalOnKubernetes void readNamespacedSecret() throws ApiException { try { helper.deleteSecret("test"); @@ -33,7 +35,8 @@ void readNamespacedSecret() throws ApiException { assertEquals(data, null); } - @Test + // @Test + @ConditionalOnKubernetes void createSecret() { try { helper.deleteSecret("test"); @@ -86,7 +89,8 @@ void createSecret() { assertEquals(null, readData.get("mykey2")); } - @AfterEach + // @AfterEach + @ConditionalOnKubernetes public void cleanUp() throws ApiException { try { helper.deleteSecret("test"); diff --git a/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/KanikoImageBuilderTest.java b/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/KanikoImageBuilderTest.java index 46c390bc..e4b524b9 100644 --- a/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/KanikoImageBuilderTest.java +++ b/modules/framework-k8s/src/test/java/it/smartcommunitylabdhub/framework/k8s/KanikoImageBuilderTest.java @@ -1,6 +1,7 @@ package it.smartcommunitylabdhub.framework.k8s; import io.kubernetes.client.openapi.ApiClient; +import it.smartcommunitylabdhub.framework.k8s.annotations.ConditionalOnKubernetes; import it.smartcommunitylabdhub.framework.k8s.kubernetes.kaniko.DockerBuildConfig; import it.smartcommunitylabdhub.framework.k8s.kubernetes.kaniko.JobBuildConfig; import it.smartcommunitylabdhub.framework.k8s.kubernetes.kaniko.KanikoImageBuilder; @@ -14,7 +15,7 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.boot.test.context.SpringBootTest; -@SpringBootTest +// @SpringBootTest public class KanikoImageBuilderTest { //////////////////////// TO USE THI BUILDER ////////////////////////////// @@ -31,7 +32,7 @@ public class KanikoImageBuilderTest { // ////////////////////////////////////// - @Autowired + @Autowired(required = false) ApiClient client; @Value("${kaniko.source.path}") @@ -40,7 +41,8 @@ public class KanikoImageBuilderTest { @Value("${kaniko.target.path}") private String kanikoTargetPath; - @Test + // @Test + @ConditionalOnKubernetes void testBuildDockerImage() throws IOException { String basePath = Paths.get(System.getProperty("user.dir")).getParent().toString(); diff --git a/modules/fsm/.flattened-pom.xml b/modules/fsm/.flattened-pom.xml index fef172b4..650b37b0 100644 --- a/modules/fsm/.flattened-pom.xml +++ b/modules/fsm/.flattened-pom.xml @@ -4,12 +4,12 @@ 4.0.0 it.smartcommunitylabdhub dh-fsm - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/fsm/src/test/java/it/smartcommunitylabdhub/fsm/StateMachineTest.java b/modules/fsm/src/test/java/it/smartcommunitylabdhub/fsm/StateMachineTest.java index 6a80130a..33f0f09f 100644 --- a/modules/fsm/src/test/java/it/smartcommunitylabdhub/fsm/StateMachineTest.java +++ b/modules/fsm/src/test/java/it/smartcommunitylabdhub/fsm/StateMachineTest.java @@ -11,7 +11,7 @@ public class StateMachineTest { // some method definition - @Test + // @Test public void fsm() { // Create the state machine diff --git a/modules/runtime-container/.flattened-pom.xml b/modules/runtime-container/.flattened-pom.xml index b869e7ab..714014eb 100644 --- a/modules/runtime-container/.flattened-pom.xml +++ b/modules/runtime-container/.flattened-pom.xml @@ -4,7 +4,7 @@ 4.0.0 it.smartcommunitylabdhub dh-runtime-container - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT org.springdoc @@ -15,13 +15,13 @@ it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/runtime-dbt/.flattened-pom.xml b/modules/runtime-dbt/.flattened-pom.xml index b7a6245a..3bce3838 100644 --- a/modules/runtime-dbt/.flattened-pom.xml +++ b/modules/runtime-dbt/.flattened-pom.xml @@ -4,18 +4,18 @@ 4.0.0 it.smartcommunitylabdhub dh-runtime-dbt - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/runtime-kfp/.flattened-pom.xml b/modules/runtime-kfp/.flattened-pom.xml index fe6bc015..17a06923 100644 --- a/modules/runtime-kfp/.flattened-pom.xml +++ b/modules/runtime-kfp/.flattened-pom.xml @@ -4,18 +4,18 @@ 4.0.0 it.smartcommunitylabdhub dh-runtime-kfp - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/runtime-mlrun/.flattened-pom.xml b/modules/runtime-mlrun/.flattened-pom.xml index 64583fd4..d933bbb3 100644 --- a/modules/runtime-mlrun/.flattened-pom.xml +++ b/modules/runtime-mlrun/.flattened-pom.xml @@ -4,18 +4,18 @@ 4.0.0 it.smartcommunitylabdhub dh-runtime-mlrun - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/modules/runtime-nefertem/.flattened-pom.xml b/modules/runtime-nefertem/.flattened-pom.xml index 96f3d78b..f66bef60 100644 --- a/modules/runtime-nefertem/.flattened-pom.xml +++ b/modules/runtime-nefertem/.flattened-pom.xml @@ -4,18 +4,18 @@ 4.0.0 it.smartcommunitylabdhub dh-runtime-nefertem - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT it.smartcommunitylabdhub dh-commons - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile it.smartcommunitylabdhub dh-framework-k8s - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT compile diff --git a/pom.xml b/pom.xml index 8c7000e4..b92be91d 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ pom - 0.3.0-SNAPSHOT + 0.4.0-SNAPSHOT 21 3.2.0 2.2.0