@Override
    public void validate(ChangeContext context) {
        if ( ! context.deployState().isHosted()) return;

        // Compare onnx models used by each cluster and set restart on deploy for cluster if estimated cost,
        // model hash or model options have changed
        for (var cluster : context.model().getContainerClusters().values()) {
            var clusterInCurrentModel = context.previousModel().getContainerClusters().get(cluster.getName());
            if (clusterInCurrentModel == null) continue;

            var currentModels = clusterInCurrentModel.onnxModelCostCalculator().models();
            var nextModels = cluster.onnxModelCostCalculator().models();

            if (enoughMemoryToAvoidRestart(clusterInCurrentModel, cluster, context.deployState().getDeployLogger()))
                continue;

            log.log(FINE, "Validating %s, current Onnx models:%s, next Onnx models:%s"
                    .formatted(cluster, currentModels, nextModels));
            validateModelChanges(cluster, currentModels, nextModels).forEach(context::require);
            validateSetOfModels(cluster, currentModels, nextModels).forEach(context::require);
        }
    }
If Onnx models change in a way that requires restart of containers in
a container cluster this validator will make sure that restartOnDeploy is set for
configs for this cluster.

@author hmusum
config-model/src/main/java/com/yahoo/vespa/model/application/validation/change/RestartOnDeployForOnnxModelChangesValidator.java