@Override
    protected Application buildModelVersion(ModelFactory modelFactory,
                                            ApplicationPackage applicationPackage,
                                            ApplicationId applicationId,
                                            Optional<DockerImage> wantedDockerImageRepository,
                                            Version wantedNodeVespaVersion) {
        log.log(Level.FINE, () -> String.format("Loading model version %s for session %s application %s",
                                                modelFactory.version(), applicationGeneration, applicationId));
        ModelContext.Properties modelContextProperties = createModelContextProperties(applicationId, modelFactory.version(), applicationPackage);
        Provisioned provisioned = new Provisioned();
        ModelContext modelContext = new ModelContextImpl(
                applicationPackage,
                modelOf(modelFactory.version()),
                new SilentDeployLogger(),
                configDefinitionRepo,
                getForVersionOrLatest(applicationPackage.getFileRegistries(), modelFactory.version()).orElse(new MockFileRegistry()),
                executor,
                new ApplicationCuratorDatabase(tenant, curator).readReindexingStatus(applicationId),
                createStaticProvisioner(applicationPackage, modelContextProperties.applicationId(), provisioned),
                provisioned,
                modelContextProperties,
                Optional.empty(),
                onnxModelCost,
                wantedDockerImageRepository,
                modelFactory.version(),
                wantedNodeVespaVersion);
        MetricUpdater applicationMetricUpdater = metrics.getOrCreateMetricUpdater(Metrics.createDimensions(applicationId));
        ServerCache serverCache = new ServerCache(configDefinitionRepo, zkClient.getUserConfigDefinitions());
        return new Application(modelFactory.createModel(modelContext),
                               serverCache,
                               applicationGeneration,
                               modelFactory.version(),
                               applicationMetricUpdater,
                               applicationId);
    }
Builds activated versions of the right model versions

@author bratseth
configserver/src/main/java/com/yahoo/vespa/config/server/modelfactory/ActivatedModelsBuilder.java