Modelio-R-D / CamelDesigner

Modelio Extension for Camel Modeling. Camel Designer Module is conceived to help in designing Cloud Application Modelling and Execution Language (CAMEL) ( camel-dsl.org )
https://www.modelio.org/
GNU General Public License v3.0
4 stars 0 forks source link

Importing constraints not working #136

Closed Amina-Moussaoui closed 1 year ago

Amina-Moussaoui commented 1 year ago

`camel model ApplicationCHUVBrainTwoCompUtily12_d { application ApplicationCHUVBrainTwoCompUtily12_d { version '0.4'

//camel model ApplicationCHUVBrainTwoCompMetricTest3 { // application ApplicationCHUVBrainTwoCompMetricTest3 { // version '0.4' }

// Deployment model
deployment type model SchedulerAndWorkersDeployment{

     //
    //Here are the definition of components involved in the CHUV application
    // TODO: At some point, we need a docker registry where to store and retrieve docker images involved in the installation of the components      // TODO: CHUV WF could also be also flaged as a compoent depending uppon PA scheduler.
    software Component_Scheduler {
        //[MetaDataModel.MELODICMetadataSchema.UtilityNotions.UtilityRelatedProperties.Unmoveable]
        requirements SchedulerRequirementSet
        required host WM_SchedulerHostReq
        script configuration BrainProcConfiguration {
            download 'sudo apt-get update && curl -fsSL https://get.docker.com -o get-docker.sh && sudo sh get-docker.sh'
            install 'sudo pip3 install stomp.py &&
                     sudo pip3 install criticalpath &&
                     sudo pip3 install numpy &&
                     sudo docker pull myspm12/testimage:firstpush &&
                     export KEY_ID="" &&
                     export SECRET_KEY="" &&
                     printf "%s\n%s\neu-west-3\njson" "$KEY_ID" "$SECRET_KEY" | sudo aws configure &&
                     PA_ROOT="/opt/proactive/activeeon_enterprise-pca_server-linux-x64-12.0.6/config/authentication/" &&
                     sudo aws s3 cp $PA_ROOT/rm.cred s3://pa-node-test/rm.cred &&
                     sudo curl -s https://checkip.amazonaws.com > /home/ubuntu/scheduler_ip_address.txt &&
                     sudo aws s3 cp /home/ubuntu/scheduler_ip_address.txt s3://pa-node-test/scheduler_ip_address.txt &&
                     sudo aws s3 cp s3://pa-node-test/stompy-test.py /home/ubuntu/stompy-test.py && sudo chmod +x /home/ubuntu/stompy-test.py &&
                     sudo aws s3 cp s3://pa-node-test/get_metrics_api.py /home/ubuntu/get_metrics_api.py && sudo chmod +x /home/ubuntu/get_metrics_api.py &&                         
                     SCH_IP=$(sudo curl -s https://checkip.amazonaws.com) &&
                     SCH_SECUR_GROUP=$(sudo aws ec2 describe-instances --filter Name=ip-address,Values=$SCH_IP --query "Reservations[].Instances[].SecurityGroups[].GroupId[]" --output text) &&
                     sudo aws ec2 authorize-security-group-ingress --group-id $SCH_SECUR_GROUP --ip-permissions IpProtocol=all,FromPort=-1,ToPort=-1,IpRanges=[{CidrIp=0.0.0.0/0}] '

            configure 'sudo usermod -aG docker ubuntu &&
                       sudo usermod -aG docker proactive
                       sudo chmod 666 /var/run/docker.sock'
            //                         sudo pip install py4j &&
        }

        provided communication ComponentSchedulerUI port 80
        provided communication ComponentSchedulerNode port 64738
        //longLived
    }

    software Component_WorkerSmall{
        requirements WorkerSmallRequirementSet
        required host WM_WorkerSmallHostReq
        script configuration ComponentWorkerSmallConfiguration{

            download 'cd /home/ubuntu && touch download.txt'
            install 'sudo pip3 install stomp.py &&
                     sudo pip3 install criticalpath &&
                     sudo pip3 install numpy &&
                     sudo docker pull myspm12/testimage:firstpush &&                        
                     export KEY_ID="" &&
                     export SECRET_KEY="" &&
                     printf "%s\n%s\neu-west-3\njson" "$KEY_ID" "$SECRET_KEY" | sudo aws configure &&
                     mkdir -p /tmp/node1 &&
                     sudo aws s3 cp s3://pa-node-test/rm.cred /tmp/node1/rm.cred &&
                     WORKER_IP=$(sudo curl -s https://checkip.amazonaws.com) &&
                     SECUR_GROUP=$(sudo aws ec2 describe-instances --filter Name=ip-address,Values=$WORKER_IP --query "Reservations[].Instances[].SecurityGroups[].GroupId[]" --output text) &&
                     sudo aws ec2 authorize-security-group-ingress --group-id $SECUR_GROUP --ip-permissions IpProtocol=all,FromPort=-1,ToPort=-1,IpRanges=[{CidrIp=0.0.0.0/0}] &&
                     sudo aws s3 cp s3://pa-node-test/APP-proactive-node.sh /home/ubuntu/APP-proactive-node.sh && sudo chmod +x /home/ubuntu/APP-proactive-node.sh &&                        
                     sudo aws s3 cp s3://pa-node-test/scheduler_ip_address.txt /home/ubuntu/scheduler_ip_address.txt && sudo chmod 666 /home/ubuntu/scheduler_ip_address.txt &&
                     sudo aws s3 cp s3://pa-node-test/get_metrics_api.py /home/ubuntu/get_metrics_api.py && sudo chmod +x /home/ubuntu/get_metrics_api.py &&                         
                     SCHEDULER_IP=$(sudo cat "/home/ubuntu/scheduler_ip_address.txt")  &&
                     cd /tmp/node1 && curl -sL http://$SCHEDULER_IP/rest/node.jar > node.jar'

            configure 'cd /home/ubuntu && touch configure.txt &&                          
                       sudo usermod -aG docker ubuntu &&
                       sudo usermod -aG docker proactive &&
                       sudo chmod 666 /var/run/docker.sock'
            start 'SCHEDULER_IP=$(sudo cat "/home/ubuntu/scheduler_ip_address.txt") && 
                   echo SCHEDULER_IP $SCHEDULER_IP &&
                   cd /tmp/node1 && 
                   sudo /home/ubuntu/APP-proactive-node.sh start $SCHEDULER_IP'
        }

        required communication ComponentWorkerSmallPort port 64738 mandatory
        //provided communication ComponentWorkerSmallPort2 port 64738

        provided communication ComponentNode port 80
        //provided communication ComponentNode port [0,65535]
    }

    communication  SchedulerToWorkerSmall from  Component_WorkerSmall.ComponentWorkerSmallPort to Component_Scheduler.ComponentSchedulerNode

            // We create our requirement bound the therequirement models

   requirements SchedulerRequirementSet{
        resource SAW_Requirement.SchedulerReqs
        horizontal scale SAW_Requirement.HorizontalScaleScheduler
        provider SAW_Requirement.PublicRequirement
        image SAW_Requirement.Ubuntu18
    }

     requirements WorkerSmallRequirementSet{
        resource SAW_Requirement.WorkerSmallReqs
        horizontal scale SAW_Requirement.HorizontalScaleWorkerSmall
        provider SAW_Requirement.PublicRequirement
        image SAW_Requirement.Ubuntu18
    }

    // TODO: Introduce, if possible, toward Python & Mathlab env, if needed.

}

requirement model SAW_Requirement{

    resource requirement SchedulerReqs{
        feature coresScheduler{
        [ MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU]
            attribute minCoresScheduler [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU.hasMinNumberofCores]: int 2
            attribute maxCoresScheduler [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU.hasMaxNumberofCores]: int 4
        }
        feature ramScheduler{
        [ MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM]
            attribute minRamScheduler [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM.TotalMemory.totalMemoryHasMin]: int 8100
            attribute maxRamScheduler [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM.TotalMemory.totalMemoryHasMax]: int 10072
        }
    }

    resource requirement WorkerSmallReqs{
        feature coresWorkerSmall{
        [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU]
            attribute minCoresWorkerSmall [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU.hasMinNumberofCores]: int 2
            attribute maxCoresWorkerSmall [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU.hasMaxNumberofCores]: int 4
        }
        feature ramWorkerSmall{
        [ MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM]
            attribute minRamWorkerSmall [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM.TotalMemory.totalMemoryHasMin ]: int 8100
            attribute maxRamWorkerSmall [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.RAM.TotalMemory.totalMemoryHasMax]: int 10072
        }
    }

    horizontal scale requirement HorizontalScaleWorkerSmall [1,10]
    horizontal scale requirement HorizontalScaleScheduler [1,1]

    //ami-0dc8d444ee2a42d8a  
    //image requirement Ubuntu18 ['ubuntu/images/hvm-ssd/ubuntu-bionic-18.04-amd64-server-20201026', 'ubuntu-1804']
    //image requirement Ubuntu18 ['ubuntu-bionic-18.04-amd64-server-20180522-dotnetcore-2018.07.11']
    image requirement Ubuntu18 ['chuv-pa-scheduler-upd12']

    slo ReconfigurationRule1 constraint SAWConstraintModel.ReconfigureIfPendingTasks
    slo ReconfigurationRule2 constraint SAWConstraintModel.ReconfigureIfAvgRunTaskDurLong

// slo ReconfigurationRule2 constraint SAWConstraintModel.ReconfigureIfCoresNeeded // slo ReconfigurationRule constraint SAWConstraintModel.Reconfigallconstrains

     optimisation requirement CHUV_maxUtility{
        variable SAWMetricModel.CHUV_Utility
    }

    provider requirement PublicRequirement{
        cloud type public
    }

    //location requirement EuRequirement [Locations.IE]
    //location requirement EuRequirement [Locations.Europe]
}
metric type model SAWMetricModel{
     //DEADLINES: reference workflow duration and (time to) deadline adapted to current time
     measurable attribute Ref_workflow_duration sensors [SAWMetricModel.Ref_workflow_duration_Sensor]
     measurable attribute Deadline sensors [SAWMetricModel.Deadline_Sensor]
     measurable attribute BufferTime        
    //RUNNING TASK
    //measurable attribute RUNtaskEstFinishTime  sensors [SAWMetricModel.RUNtaskEstFinishTime_Sensor]
    measurable attribute avgRUNtaskEstFinishTime sensors [SAWMetricModel.avgRUNtaskEstFinishTime_Sensor]
    measurable attribute testPENDtaskEstDuration
    measurable attribute newCardinality

    //PENDING TASK
    //measurable attribute PENDtaskEstDuration  sensors [SAWMetricModel.PENDtaskEstDuration_Sensor]
    measurable attribute PENDtaskNumber  sensors [SAWMetricModel.PENDtaskNumber_Sensor]
    measurable attribute sumPENDtaskEstDuration sensors [SAWMetricModel.sumPENDtaskEstDuration_Sensor]
    measurable attribute avgPENDtaskEstDuration sensors [SAWMetricModel.avgPENDtaskEstDuration_Sensor]
    measurable attribute DeltaTime_actual
    measurable attribute newcores

    //NODES
    measurable attribute cores  [MetaDataModel.MELODICMetadataSchema.ApplicationPlacementModel.IaaS.Processing.CPU]

    measurable attribute numberOfSimulations sensors [SAWMetricModel.NumberOfSimulations_Sensor]
    measurable attribute cardinality [MetaDataModel.MELODICMetadataSchema.UtilityNotions.UtilityRelatedProperties.Cardinality]
    measurable attribute sumOfNumberOfSimulations

    measurable attribute price [MetaDataModel.MELODICMetadataSchema.UtilityNotions.UtilityRelatedProperties.Cost]

    sensor Ref_workflow_duration_Sensor {
        config ''
    }

    sensor Deadline_Sensor {
        config ''
    }

    sensor avgRUNtaskEstFinishTime_Sensor {
        config ''
    }

    sensor sumPENDtaskEstDuration_Sensor {
        config ''
    }

    sensor avgPENDtaskEstDuration_Sensor {
        config ''
    }

    sensor PENDtaskNumber_Sensor {
        config ''
    }

    sensor NumberOfSimulations_Sensor {
        config ''
    }

    template Ref_workflow_durationTemplate{
        attribute Ref_workflow_duration
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template DeadlineTemplate{
        attribute Deadline
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template avgRUNtaskEstFinishTimeTemplate{
        attribute avgRUNtaskEstFinishTime
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template avgPENDtaskEstDurationTemplate{
        attribute avgPENDtaskEstDuration
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template sumPENDtaskEstDurationTemplate{
        attribute sumPENDtaskEstDuration
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template PENDtaskNumberTemplate{
        attribute PENDtaskNumber
        unit UnitTemplateCamelModel.UnitTemplateModel.Simulations
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    template NumberOfSimulationsTemplate{
        attribute numberOfSimulations
        unit UnitTemplateCamelModel.UnitTemplateModel.Simulations
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    raw metric Ref_workflow_durationRawMetric{
        template Ref_workflow_durationTemplate
    }

    raw metric DeadlineRawMetric{
        template DeadlineTemplate
    }

    raw metric avgRUNtaskEstFinishTimeRawMetric{
        template avgRUNtaskEstFinishTimeTemplate
    }

    raw metric avgPENDtaskEstDurationRawMetric{
        template avgPENDtaskEstDurationTemplate
    }

    raw metric sumPENDtaskEstDurationRawMetric{
        template sumPENDtaskEstDurationTemplate
    }

    raw metric PENDtaskNumberRawMetric{
        template PENDtaskNumberTemplate
    }

    raw metric NumberOfSimulationsRawMetric{
        template NumberOfSimulationsTemplate
    }

    schedule SAWTimeSchedule {
        interval 120
        time unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
    }

    window SAWWindow {
        //type fixed
        type fixed
        size type time-only
        time size 120
        time unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
    }

    object context SchedulerMetricContext{
        component SchedulerAndWorkersDeployment.Component_Scheduler
    }

    object context WorkerMetricContext{
        component SchedulerAndWorkersDeployment.Component_WorkerSmall   
    }

    raw metric context Ref_workflow_durationContext{
        metric Ref_workflow_durationRawMetric
        sensor SAWMetricModel.Ref_workflow_duration_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context DeadlineContext{
        metric DeadlineRawMetric
        sensor SAWMetricModel.Deadline_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context avgRUNtaskEstFinishTimeContext{
        metric avgRUNtaskEstFinishTimeRawMetric
        sensor SAWMetricModel.avgRUNtaskEstFinishTime_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context sumPENDtaskEstDurationContext{
        metric sumPENDtaskEstDurationRawMetric
        sensor SAWMetricModel.sumPENDtaskEstDuration_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context avgPENDtaskEstDurationContext{
        metric avgPENDtaskEstDurationRawMetric
        sensor SAWMetricModel.avgPENDtaskEstDuration_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context PENDtaskNumberContext{
        metric PENDtaskNumberRawMetric
        sensor SAWMetricModel.PENDtaskNumber_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    raw metric context NumberOfSimulationsContext{
        metric NumberOfSimulationsRawMetric
        sensor SAWMetricModel.NumberOfSimulations_Sensor
        schedule SAWTimeSchedule
        object context WorkerMetricContext
    }

    //CORES
    template CoresTemplate{
        attribute cores
        unit UnitTemplateCamelModel.UnitTemplateModel.Cores
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    variable WorkerCores{
        template CoresTemplate
        component SchedulerAndWorkersDeployment.Component_WorkerSmall
    }

    variable ActWorkerCores{
        template CoresTemplate
        component SchedulerAndWorkersDeployment.Component_WorkerSmall
        current-config
    }

// CARDINALITY
template CardinalityTemplate{ attribute cardinality unit UnitTemplateCamelModel.UnitTemplateModel.Instances value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger }

    variable WorkerSmallCardinality{
        template CardinalityTemplate
        component SchedulerAndWorkersDeployment.Component_WorkerSmall
    }

    variable WorkerSmallActualCardinality{
        template CardinalityTemplate
        component SchedulerAndWorkersDeployment.Component_WorkerSmall
        current-config
    }
    //CORES ADDED

// template CoresAddedTemplate{ // attribute coresadded // unit UnitTemplateCamelModel.UnitTemplateModel.Instances // value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger // } //
// variable CoresAddedMetric{ // template CoresAddedTemplate //
// //formula:('PENDtaskNumberRawMetric-(WorkerCoresWorkerSmallCardinality-ActWorkerCoresWorkerSmallActualCardinality)') // formula:('PENDtaskNumberRawMetric-WorkerSmallCardinality+WorkerSmallActualCardinality') // }

      // BUffer time (time between reference_duration time and deadline)
    template BufferTimeTemplate{
        attribute BufferTime
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    composite metric BufferTimeMetric{
        template BufferTimeTemplate
        formula:('(DeadlineRawMetric - Ref_workflow_durationRawMetric)*0.5')
    }

    composite metric context  BufferTimeContext{
        metric BufferTimeMetric
        grouping global
        window SAWWindow
        schedule SAWTimeSchedule
        composing contexts [DeadlineContext,Ref_workflow_durationContext]
    }

// // Minimum cores to add // composite metric MinimumCoresNeeded{ // template MinimumCoresTemplate // //formula: ('ceil(PENDtaskNumberRawMetric/ceil((BufferTimeMetric+0.001)/avgPENDtaskEstDurationRawMetric))+ActWorkerCoresWorkerSmallActualCardinality') // formula: ('if(floor(BufferTimeMetric/avgPENDtaskEstDurationRawMetric)=0;PENDtaskNumberRawMetric+ActWorkerCoresWorkerSmallActualCardinality,ceil(PENDtaskNumberRawMetric/floor(BufferTimeMetric/avgPENDtaskEstDurationRawMetric)))') // }

// composite metric context MinimumCoresNeededContext{ // metric MinimumCoresNeeded // grouping global // window SAWWindow // schedule SAWTimeSchedule // composing contexts [PENDtaskNumberContext,BufferTimeContext,avgPENDtaskEstDurationContext] // }

     composite metric StepFunc{
        template MinimumCoresTemplate
        formula: ('if(floor(BufferTimeMetric/avgPENDtaskEstDurationRawMetric)=0;1)')
    }

    composite metric context StepFuncContext{
        metric StepFunc
        grouping global
        window SAWWindow
        schedule SAWTimeSchedule
        composing contexts [BufferTimeContext,avgPENDtaskEstDurationContext]
    }
    // DELTA_TIME_ACTUAL
    template DeltaTimeActTemplate{
        attribute DeltaTime_actual
        unit UnitTemplateCamelModel.UnitTemplateModel.Seconds
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

    composite metric DeltaTimeActMetric{
        template DeltaTimeActTemplate
        formula:('avgPENDtaskEstDurationRawMetric*ceil(PENDtaskNumberRawMetric/(ActWorkerCores*WorkerSmallActualCardinality))')
    }

    composite metric context DeltaTimeActContext{
        metric DeltaTimeActMetric
        grouping global
        window SAWWindow
        schedule SAWTimeSchedule
        composing contexts [avgPENDtaskEstDurationContext,PENDtaskNumberContext]
    }
    //

// composite metric NotEnoughCores { // template MinimumCoresTemplate // formula: ('MinimumCoresNeeded-WorkerSmallActualCardinality*ActWorkerCores') // } //
// composite metric context NotEnoughCoresContext{ // metric NotEnoughCores // grouping global // window SAWWindow // schedule SAWTimeSchedule // composing contexts [MinimumCoresNeededContext] // } //
// DELTA_TIME_RECONF

    template MinimumCoresTemplate{
        attribute newcores
        unit UnitTemplateCamelModel.UnitTemplateModel.Cores
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityInteger
    }

// variable CoresAdded{ // template MinimumCoresTemplate // formula: ('PENDtaskNumberRawMetric-(WorkerSmallCardinalityWorkerCores-WorkerSmallActualCardinalityActWorkerCores)') // } //
// variable DeltaTime_reconf{ // template MinimumCoresTemplate // //formula: ('(sumPENDtaskEstDurationMetric - avgPENDtaskEstDurationMetricWorkerSmallCardinalityWorkerCores)ceil((PENDtaskNumberRawMetric-CoresAdded)/(WorkerSmallCardinalityWorkerCores))') // //formula: ('((sumPENDtaskEstDurationRawMetric - avgPENDtaskEstDurationRawMetricWorkerSmallCardinalityActWorkerCores)/(1+PENDtaskNumberRawMetric))') // //formula: ('(WorkerSmallActualCardinality-WorkerSmallCardinality)') // //formula: ('avgPENDtaskEstDurationMetricceil((PENDtaskNumberRawMetric-CoresAdded)/(WorkerSmallCardinalityWorkerCores))')

// }

// variable New_cores_constraint{ // template MinimumCoresTemplate // formula: ('WorkerSmallCardinality*WorkerCores-MinimumCoresNeeded') // }

   template PriceTemplate{
        attribute price
        unit UnitTemplateCamelModel.UnitTemplateModel.Euros
        value type TypeTemplateCamelModel.TypeTemplateModel.ZeroToPositiveInfinityDouble
    }

    variable SmallWorkerPrice{
        template PriceTemplate
        component SchedulerAndWorkersDeployment.Component_WorkerSmall
    }

// utility function variable CHUV_Utility{ template MetricTemplateCamelModel.MetricTemplateModel.UtilityTemplate //formula: ('1/((1+WorkerSmallCardinality)SmallWorkerPrice)') formula: ('1/((1+exp(-BufferTimeMetric + avgPENDtaskEstDurationRawMetricceil((PENDtaskNumberRawMetric-WorkerCoresWorkerSmallCardinality)/(WorkerCoresWorkerSmallCardinality)))))') }

}

constraint model SAWConstraintModel{
    metric constraint ReconfigureIfPendingTasks : [SAWMetricModel.DeltaTimeActContext] > 0.0

// metric constraint ReconfigureIfCoresNeeded : [SAWMetricModel.NotEnoughCoresContext] > 0.0 metric constraint ReconfigureIfAvgRunTaskDurLong : [SAWMetricModel.avgRUNtaskEstFinishTimeContext] > 10.0 logical constraint Reconfigallconstrains : and (ReconfigureIfPendingTasks,ReconfigureIfAvgRunTaskDurLong) // logical constraint Reconfigallconstrains : and (ReconfigureIfPendingTasks, ReconfigureIfCoresNeeded,ReconfigureIfAvgRunTaskDurLong) //metric constraint ReconfigureIfAvgPendingTaskDurLong : [SAWMetricModel.avgPENDtaskEstDurationContext] > 360.0

    //360.0
    //variable constraint DeltaTime_reconf : SAWMetricModel.DeltaTime_reconf < 900.0   

// variable constraint DeltaTime_reconf : SAWMetricModel.New_cores_constraint > 0.0 }

}`

Amina-Moussaoui commented 1 year ago

Import is tested on the camel model : AppCHUVbrainTwoCompUtily12_designer

Amina-Moussaoui commented 1 year ago

The comparator and the threshold are not set

r14_constraints

etiennebrosse commented 1 year ago

Fixed in dev. It will be released with the next version of Camel Designer