summaryrefslogtreecommitdiffstats
path: root/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
diff options
context:
space:
mode:
Diffstat (limited to 'standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala')
-rw-r--r--standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala11
1 files changed, 9 insertions, 2 deletions
diff --git a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
index 3f31dcd67ca..fc57353c194 100644
--- a/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
+++ b/standalone-container/src/main/scala/com/yahoo/container/standalone/StandaloneContainerApplication.scala
@@ -10,6 +10,7 @@ import java.io.{IOException, File}
import com.yahoo.config.model.test.MockRoot
import com.yahoo.config.model.application.provider._
import com.yahoo.vespa.defaults.Defaults
+import com.yahoo.vespa.model.VespaModel
import com.yahoo.vespa.model.container.xml.{ConfigServerContainerModelBuilder, ManhattanContainerModelBuilder, ContainerModelBuilder}
import org.w3c.dom.Element
import com.yahoo.config.model.builder.xml.XmlHelper
@@ -164,7 +165,7 @@ object StandaloneContainerApplication {
fileRegistry: FileRegistry,
preprocessedApplicationDir: File,
networkingOption: Networking,
- configModelRepo: ConfigModelRepo = new ConfigModelRepo): (MockRoot, Container) = {
+ configModelRepo: ConfigModelRepo = new ConfigModelRepo): (VespaModel, Container) = {
val logger = new BaseDeployLogger
val rawApplicationPackage = new FilesApplicationPackage.Builder(applicationPath.toFile).includeSourceFiles(true).preprocessedDir(preprocessedApplicationDir).build()
// TODO: Needed until we get rid of semantic rules
@@ -179,12 +180,13 @@ object StandaloneContainerApplication {
configDefinitionRepo(configDefinitionRepo).
build()
- val root = new MockRoot("", deployState)
+ val root = VespaModel.createIncomplete(deployState)
val vespaRoot = new ApplicationConfigProducerRoot(root,
"vespa",
deployState.getDocumentModel,
deployState.getProperties.vespaVersion(),
deployState.getProperties.applicationId())
+
val spec = containerRootElement(applicationPackage)
val containerModel = newContainerModelBuilder(networkingOption).build(deployState, configModelRepo, vespaRoot, spec)
@@ -192,11 +194,16 @@ object StandaloneContainerApplication {
containerModel.initialize(configModelRepo)
val container = first(containerModel.getCluster().getContainers)
+ // TODO: If we can do the mutations below on the builder, we can separate out model finalization from the
+ // VespaModel constructor, such that the above and below code to finalize the container can be
+ // replaced by root.finalize();
+
// Always disable rpc server for standalone container. This server will soon be removed anyway.
container.setRpcServerEnabled(false)
container.setHttpServerEnabled(networkingOption == Networking.enable)
initializeContainer(container, spec)
+
root.freezeModelTopology()
(root, container)
}