Add blueprint Kotlin script support.
authorMuthuramalingam, Brinda Santh <bs2796@att.com>
Fri, 11 Jan 2019 16:30:40 +0000 (11:30 -0500)
committerMuthuramalingam, Brinda Santh <bs2796@att.com>
Mon, 14 Jan 2019 16:21:09 +0000 (11:21 -0500)
Change-Id: I92b8e9850ea07c7f671e7aada9770713854534c3
Issue-ID: CCSDK-941
Signed-off-by: Muthuramalingam, Brinda Santh <bs2796@att.com>
12 files changed:
components/core/pom.xml
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptConfiguration.kt [new file with mode: 0644]
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptService.kt [new file with mode: 0644]
components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BlueprintScriptingHost.kt [new file with mode: 0644]
components/core/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory [new file with mode: 0644]
components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptServiceTest.kt [new file with mode: 0644]
components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonReactorUtilsTest.kt [deleted file]
components/core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts [new file with mode: 0644]
components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-kotlin.json [new file with mode: 0644]
components/model-catalog/definition-type/starter-type/node_type/source-capability.json
components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Kotlin.json [new file with mode: 0644]
components/parent/pom.xml

index 84063fd..f33146b 100644 (file)
             <artifactId>mockk</artifactId>
             <scope>test</scope>
         </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlinx</groupId>
+            <artifactId>kotlinx-coroutines-test</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
 
 </project>
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptConfiguration.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptConfiguration.kt
new file mode 100644 (file)
index 0000000..f7bfb85
--- /dev/null
@@ -0,0 +1,86 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.script
+
+import org.jetbrains.kotlin.script.util.LocalFilesResolver
+import java.io.File
+import kotlin.script.dependencies.ScriptContents
+import kotlin.script.dependencies.ScriptDependenciesResolver
+import kotlin.script.experimental.annotations.KotlinScript
+import kotlin.script.experimental.api.*
+import kotlin.script.experimental.jvm.JvmDependency
+import kotlin.script.experimental.jvm.dependenciesFromCurrentContext
+import kotlin.script.experimental.jvm.jvm
+
+
+@KotlinScript(fileExtension = "kts",
+        compilationConfiguration = ComponentScriptConfiguration::class)
+abstract class ComponentScript {
+
+}
+
+object ComponentScriptConfiguration : ScriptCompilationConfiguration(
+        {
+           // defaultImports(DependsOn::class, Repository::class)
+            jvm {
+                dependenciesFromCurrentContext(
+                        wholeClasspath = true
+                )
+            }
+//            refineConfiguration {
+//                onAnnotations(DependsOn::class, Repository::class, handler = ::configureLocalFileDepsOnAnnotations)
+//            }
+        }
+)
+
+
+private val resolver = LocalFilesResolver()
+
+fun configureLocalFileDepsOnAnnotations(context: ScriptConfigurationRefinementContext):
+        ResultWithDiagnostics<ScriptCompilationConfiguration> {
+
+    val annotations = context.collectedData?.get(ScriptCollectedData.foundAnnotations)?.takeIf { it.isNotEmpty() }
+            ?: return context.compilationConfiguration.asSuccess()
+
+    val scriptContents = object : ScriptContents {
+        override val annotations: Iterable<Annotation> = annotations
+        override val file: File? = null
+        override val text: CharSequence? = null
+    }
+
+    val diagnostics = arrayListOf<ScriptDiagnostic>()
+
+    fun report(severity: ScriptDependenciesResolver.ReportSeverity, message: String, position: ScriptContents.Position?) {
+        //TODO
+    }
+
+    return try {
+        val newDepsFromResolver = resolver.resolve(scriptContents, emptyMap(), ::report, null).get()
+                ?: return context.compilationConfiguration.asSuccess(diagnostics)
+
+        val resolvedClasspath = newDepsFromResolver.classpath.toList().takeIf { it.isNotEmpty() }
+                ?: return context.compilationConfiguration.asSuccess(diagnostics)
+
+        ScriptCompilationConfiguration(context.compilationConfiguration) {
+            dependencies.append(JvmDependency(resolvedClasspath))
+
+        }.asSuccess(diagnostics)
+
+    } catch (e: Throwable) {
+        ResultWithDiagnostics.Failure(*diagnostics.toTypedArray(), e.asDiagnostics())
+    }
+}
\ No newline at end of file
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptService.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptService.kt
new file mode 100644 (file)
index 0000000..8ae0915
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.script
+
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import java.io.File
+import java.io.InputStream
+import java.io.Reader
+import javax.script.ScriptEngineManager
+import kotlin.script.experimental.api.ResultValue
+import kotlin.script.experimental.api.ResultWithDiagnostics
+import kotlin.script.experimental.api.resultOrNull
+import kotlin.script.experimental.host.toScriptSource
+import kotlin.script.experimental.jvmhost.createJvmCompilationConfigurationFromTemplate
+
+
+open class BluePrintScriptService(classLoader: ClassLoader? = Thread.currentThread().contextClassLoader) {
+
+    /**
+     * Get the Script Class instance
+     */
+    inline fun <reified T> scriptClassNewInstance(scriptFile: File, scriptClassName: String): T {
+
+        val compilationConfiguration = createJvmCompilationConfigurationFromTemplate<ComponentScript>()
+
+        val scriptEvaluator = BluePrintScriptEvaluator(scriptClassName)
+
+        val evalResponse = BlueprintScriptingHost(scriptEvaluator).eval(scriptFile.toScriptSource(), compilationConfiguration,
+                null)
+
+        when (evalResponse) {
+            is ResultWithDiagnostics.Success -> {
+                val returnValue = evalResponse.resultOrNull()?.returnValue as ResultValue.Value
+                return returnValue.value.castOrError()
+            }
+            is ResultWithDiagnostics.Failure -> {
+                throw BluePrintProcessorException(evalResponse.reports.joinToString("\n"))
+            }
+            else -> {
+                throw BluePrintProcessorException("Failed to process script ${scriptFile.absolutePath}")
+            }
+        }
+
+    }
+
+    val engine = ScriptEngineManager(classLoader).getEngineByExtension("kts")
+
+    inline fun <R> safeEval(evaluation: () -> R?) = try {
+        evaluation()
+    } catch (e: Exception) {
+        throw BluePrintProcessorException("Cannot load script", e)
+    }
+
+    inline fun <reified T> Any?.castOrError() = takeIf { it is T }?.let { it as T }
+            ?: throw IllegalArgumentException("Cannot cast $this to expected type ${T::class}")
+
+    inline fun <reified T> load(script: String): T = safeEval { engine.eval(script) }.castOrError()
+
+    inline fun <reified T> load(reader: Reader): T = safeEval { engine.eval(reader) }.castOrError()
+
+    inline fun <reified T> load(inputStream: InputStream): T = load(inputStream.reader())
+
+    inline fun <reified T> loadAll(vararg inputStream: InputStream): List<T> = inputStream.map(::load)
+}
diff --git a/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BlueprintScriptingHost.kt b/components/core/src/main/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BlueprintScriptingHost.kt
new file mode 100644 (file)
index 0000000..bda20a4
--- /dev/null
@@ -0,0 +1,93 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.script
+
+import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintProcessorException
+import org.slf4j.LoggerFactory
+import kotlin.script.experimental.api.*
+import kotlin.script.experimental.host.BasicScriptingHost
+import kotlin.script.experimental.jvm.defaultJvmScriptingHostConfiguration
+import kotlin.script.experimental.jvmhost.JvmScriptCompiler
+
+val defaultBlueprintScriptCompiler = JvmScriptCompiler(defaultJvmScriptingHostConfiguration)
+
+open class BlueprintScriptingHost(evaluator: ScriptEvaluator
+) : BasicScriptingHost(defaultBlueprintScriptCompiler, evaluator) {
+
+    override fun eval(
+            script: SourceCode,
+            scriptCompilationConfiguration: ScriptCompilationConfiguration,
+            configuration: ScriptEvaluationConfiguration?
+    ): ResultWithDiagnostics<EvaluationResult> =
+
+            runInCoroutineContext {
+
+                compiler(script, scriptCompilationConfiguration)
+                        .onSuccess {
+                            evaluator(it, configuration)
+                        }
+            }
+}
+
+
+open class BluePrintScriptEvaluator(private val scriptClassName: String) : ScriptEvaluator {
+
+    val log = LoggerFactory.getLogger(BluePrintScriptEvaluator::class.java)!!
+
+    override suspend operator fun invoke(
+            compiledScript: CompiledScript<*>,
+            scriptEvaluationConfiguration: ScriptEvaluationConfiguration?
+    ): ResultWithDiagnostics<EvaluationResult> =
+            try {
+                val res = compiledScript.getClass(scriptEvaluationConfiguration)
+                when (res) {
+                    is ResultWithDiagnostics.Failure -> res
+                    is ResultWithDiagnostics.Success -> {
+                        val scriptClass = res.value
+                        val args = ArrayList<Any?>()
+                        scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.providedProperties)?.forEach {
+                            args.add(it.value)
+                        }
+                        scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.implicitReceivers)?.let {
+                            args.addAll(it)
+                        }
+                        scriptEvaluationConfiguration?.get(ScriptEvaluationConfiguration.constructorArgs)?.let {
+                            args.addAll(it)
+                        }
+
+                        val completeScriptClass = "Script\$$scriptClassName"
+                        log.info("Searching for class type($completeScriptClass)")
+                        /**
+                         * Search for Class Name
+                         */
+                        val instanceClass = scriptClass.java.classes
+                                .single { it.name == completeScriptClass }
+                                //.single { it.name == "Script\$SampleBlueprintsFunctionNode" }
+
+
+                        val instance = instanceClass.newInstance()
+                                ?: throw BluePrintProcessorException("failed to create instance from the script")
+
+                        ResultWithDiagnostics.Success(EvaluationResult(ResultValue.Value(completeScriptClass,
+                                instance, instance.javaClass.typeName),
+                                scriptEvaluationConfiguration))
+                    }
+                }
+            } catch (e: Throwable) {
+                ResultWithDiagnostics.Failure(e.asDiagnostics("Error evaluating script"))
+            }
+}
\ No newline at end of file
diff --git a/components/core/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory b/components/core/src/main/resources/META-INF/services/javax.script.ScriptEngineFactory
new file mode 100644 (file)
index 0000000..89838f4
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Copyright © 2017-2018 AT&T Intellectual Property.
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+#     http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+org.jetbrains.kotlin.script.jsr223.KotlinJsr223JvmLocalScriptEngineFactory
\ No newline at end of file
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptServiceTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/script/BluePrintScriptServiceTest.kt
new file mode 100644 (file)
index 0000000..5c5ad3b
--- /dev/null
@@ -0,0 +1,49 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.onap.ccsdk.apps.controllerblueprints.core.script
+
+import org.junit.Ignore
+import org.junit.Test
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
+import java.io.File
+import kotlin.test.assertEquals
+import kotlin.test.assertNotNull
+
+class BluePrintScriptServiceTest {
+
+    @Test
+    fun `invoke script`() {
+        val scriptContent = "11 + 11"
+        val value = BluePrintScriptService()
+                .load<Int>(scriptContent)
+        assertEquals(22, value, "failed to execute command")
+    }
+
+    @Test
+    @Ignore
+    fun `invoke script component node`() {
+
+        //println(classpathFromClasspathProperty()?.joinToString("\n"))
+
+        val scriptFile = File("src/test/resources/scripts/SampleBlueprintFunctionNode.kts")
+
+        val functionNode = BluePrintScriptService()
+                .scriptClassNewInstance<BlueprintFunctionNode<String, String>>(scriptFile,
+                        "SampleBlueprintFunctionNode")
+        assertNotNull(functionNode, "failed to get instance from script")
+    }
+}
\ No newline at end of file
diff --git a/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonReactorUtilsTest.kt b/components/core/src/test/kotlin/org/onap/ccsdk/apps/controllerblueprints/core/utils/JacksonReactorUtilsTest.kt
deleted file mode 100644 (file)
index ad55c77..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*\r
- *  Copyright © 2017-2018 AT&T Intellectual Property.\r
- *\r
- *  Licensed under the Apache License, Version 2.0 (the "License");\r
- *  you may not use this file except in compliance with the License.\r
- *  You may obtain a copy of the License at\r
- *\r
- *      http://www.apache.org/licenses/LICENSE-2.0\r
- *\r
- *  Unless required by applicable law or agreed to in writing, software\r
- *  distributed under the License is distributed on an "AS IS" BASIS,\r
- *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
- *  See the License for the specific language governing permissions and\r
- *  limitations under the License.\r
- */\r
-\r
-package org.onap.ccsdk.apps.controllerblueprints.core.utils\r
-\r
-import com.att.eelf.configuration.EELFLogger\r
-import com.att.eelf.configuration.EELFManager\r
-import org.junit.Test\r
-import org.onap.ccsdk.apps.controllerblueprints.core.BluePrintException\r
-import org.onap.ccsdk.apps.controllerblueprints.core.data.ServiceTemplate\r
-import kotlin.test.assertEquals\r
-import kotlin.test.assertNotNull\r
-\r
-@Deprecated("Reactor will be replacecd by coroutines by default.")\r
-class JacksonReactorUtilsTest {\r
-    private val log: EELFLogger = EELFManager.getInstance().getLogger(this::class.toString())\r
-    @Test\r
-    fun testReadValues() {\r
-\r
-        val serviceTemplate = JacksonReactorUtils.readValueFromFile("./../model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json",\r
-                ServiceTemplate::class.java).block()\r
-\r
-        assertNotNull(serviceTemplate, "Failed to simple transform Service Template")\r
-        assertEquals(true, serviceTemplate is ServiceTemplate, "failed to get Service Template instance")\r
-\r
-        val jsonContent = JacksonReactorUtils.getJson(serviceTemplate, true).block()\r
-        assertNotNull(jsonContent, "Failed to get json content")\r
-\r
-        val jsonNode = JacksonReactorUtils.jsonNodeFromFile("./../model-catalog/blueprint-model/starter-blueprint/baseconfiguration/Definitions/activation-blueprint.json")\r
-                .block()\r
-        assertNotNull(jsonContent, "Failed to get json Node")\r
-    }\r
-\r
-    @Test(expected = BluePrintException::class)\r
-    fun testReadValuesFailure() {\r
-        JacksonReactorUtils.jsonNodeFromFile("load/blueprints/not-found.json")\r
-                .block()\r
-    }\r
-}
\ No newline at end of file
diff --git a/components/core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts b/components/core/src/test/resources/scripts/SampleBlueprintFunctionNode.kts
new file mode 100644 (file)
index 0000000..44cc957
--- /dev/null
@@ -0,0 +1,44 @@
+/*
+ * Copyright © 2017-2018 AT&T Intellectual Property.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.onap.ccsdk.apps.controllerblueprints.core.interfaces.BlueprintFunctionNode
+
+open class SampleBlueprintFunctionNode : BlueprintFunctionNode<String, String>{
+
+    override fun getName(): String {
+        return "Kotlin-Script-Function-Node"
+    }
+
+    override fun prepareRequest(executionRequest: String): String {
+        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    }
+
+    override fun process(executionRequest: String) {
+        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    }
+
+    override fun recover(runtimeException: RuntimeException, executionRequest: String) {
+        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    }
+
+    override fun prepareResponse(): String {
+        TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
+    }
+
+    override fun apply(t: String): String {
+        return "$t-status"
+    }
+}
\ No newline at end of file
diff --git a/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-kotlin.json b/components/model-catalog/definition-type/starter-type/artifact_type/artifact-script-kotlin.json
new file mode 100644 (file)
index 0000000..cf19ac6
--- /dev/null
@@ -0,0 +1,8 @@
+{
+  "description": "Kotlin Script file",
+  "version": "1.0.0",
+  "file_ext": [
+    "kts"
+  ],
+  "derived_from": "tosca.artifacts.Implementation"
+}
\ No newline at end of file
index 241b699..e4eb90e 100644 (file)
@@ -5,10 +5,11 @@
     "type": {
       "required": true,
       "type": "string",
-      "default": "JAVA-COMPONENT",
+      "default": "KOTLIN-COMPONENT",
       "constraints": [
         {
           "valid_values": [
+            "KOTLIN-COMPONENT",
             "JAVA-COMPONENT",
             "JYTHON-COMPONENT"
           ]
diff --git a/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Kotlin.json b/components/model-catalog/definition-type/starter-type/node_type/tosca.nodes.component.Kotlin.json
new file mode 100644 (file)
index 0000000..381ed59
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "description": "This is Kotlin Component",
+  "version": "1.0.0",
+  "derived_from": "tosca.nodes.Root"
+}
\ No newline at end of file
index c9da403..8ecb2c1 100644 (file)
     <properties>
         <spring.boot.version>2.1.1.RELEASE</spring.boot.version>
         <spring.version>5.1.3.RELEASE</spring.version>
-        <kotlin.version>1.3.10</kotlin.version>
-        <kotlin.maven.version>1.3.10</kotlin.maven.version>
-        <kotlin.couroutines.version>1.0.1</kotlin.couroutines.version>
-        <grpc.version>1.16.1</grpc.version>
+        <kotlin.version>1.3.11</kotlin.version>
+        <kotlin.maven.version>1.3.11</kotlin.maven.version>
+        <kotlin.couroutines.version>1.1.0</kotlin.couroutines.version>
+        <grpc.version>1.17.1</grpc.version>
         <protobuff.java.utils.version>3.6.1</protobuff.java.utils.version>
         <eelf.version>1.0.0</eelf.version>
-        <guava.version>26.0-jre</guava.version>
+        <guava.version>27.0.1-jre</guava.version>
         <springfox.swagger2.version>2.9.2</springfox.swagger2.version>
         <h2database.version>1.4.197</h2database.version>
         <onap.logger.slf4j>1.2.2</onap.logger.slf4j>
@@ -77,6 +77,7 @@
                 <version>${springfox.swagger2.version}</version>
             </dependency>
 
+            <!-- Common Utils Dependencies -->
             <dependency>
                 <groupId>org.apache.commons</groupId>
                 <artifactId>commons-lang3</artifactId>
                 <artifactId>kotlin-stdlib</artifactId>
                 <version>${kotlin.version}</version>
             </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-scripting-jvm-host</artifactId>
+                <version>${kotlin.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-compiler-embeddable</artifactId>
+                <version>${kotlin.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-script-util</artifactId>
+                <version>${kotlin.version}</version>
+            </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlin</groupId>
+                <artifactId>kotlin-script-runtime</artifactId>
+                <version>${kotlin.version}</version>
+            </dependency>
             <dependency>
                 <groupId>org.jetbrains.kotlinx</groupId>
                 <artifactId>kotlinx-coroutines-core</artifactId>
                 <version>${kotlin.version}</version>
                 <scope>test</scope>
             </dependency>
+            <dependency>
+                <groupId>org.jetbrains.kotlinx</groupId>
+                <artifactId>kotlinx-coroutines-test</artifactId>
+                <version>${kotlin.couroutines.version}</version>
+                <scope>test</scope>
+            </dependency>
             <dependency>
                 <groupId>io.grpc</groupId>
                 <artifactId>grpc-testing</artifactId>
             <groupId>org.jetbrains.kotlin</groupId>
             <artifactId>kotlin-stdlib</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-script-util</artifactId>
+        </dependency>
         <dependency>
             <groupId>org.jetbrains.kotlin</groupId>
             <artifactId>kotlin-stdlib-jdk8</artifactId>
             <groupId>com.fasterxml.jackson.module</groupId>
             <artifactId>jackson-module-kotlin</artifactId>
         </dependency>
+        <dependency>
+            <groupId>org.jetbrains.kotlin</groupId>
+            <artifactId>kotlin-scripting-jvm-host</artifactId>
+        </dependency>
         <!-- GRPC Dependencies -->
         <dependency>
             <groupId>io.grpc</groupId>