iguazio.dashboard-controls 0.38.7 → 0.38.10-patch1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -32,6 +32,10 @@
32
32
  var UPDATING_STATISTICS_INTERVAL_TIME = 30000;
33
33
 
34
34
  ctrl.filtersCounter = 0;
35
+ ctrl.functionCPUMetric = FunctionsService.functionMetrics.FUNCTION_CPU;
36
+ ctrl.functionEventsMetric = FunctionsService.functionMetrics.FUNCTION_EVENTS;
37
+ ctrl.functionGPUMetric = FunctionsService.functionMetrics.FUNCTION_GPU;
38
+ ctrl.functionMemoryMetric = FunctionsService.functionMetrics.FUNCTION_MEMORY;
35
39
  ctrl.functions = [];
36
40
  ctrl.originalSortedFunctions = [];
37
41
  ctrl.isFiltersShowed = {
@@ -505,10 +509,10 @@
505
509
 
506
510
  if (!isRefresh) {
507
511
  $timeout(function () {
508
- hideSpinners(FunctionsService.functionMetrics.FUNCTION_CPU);
509
- hideSpinners(FunctionsService.functionMetrics.FUNCTION_GPU);
510
- hideSpinners(FunctionsService.functionMetrics.FUNCTION_MEMORY);
511
- hideSpinners(FunctionsService.functionMetrics.FUNCTION_EVENTS);
512
+ hideSpinners(ctrl.functionCPUMetric);
513
+ hideSpinners(ctrl.functionGPUMetric);
514
+ hideSpinners(ctrl.functionMemoryMetric);
515
+ hideSpinners(ctrl.functionEventsMetric);
512
516
  });
513
517
  }
514
518
  }
@@ -691,31 +695,37 @@
691
695
  var now = Date.now();
692
696
  var from = new Date(now - MILLIS_IN_AN_HOUR).toISOString();
693
697
  var until = new Date(now).toISOString();
698
+ var functionEventsProjectName = '{project="' + ctrl.project.metadata.name + '"}';
699
+ var projectName = '{project_name="' + ctrl.project.metadata.name + '"}';
700
+ var gpuUtilizationMetric = ' * on (pod) group_left(function_name)(nuclio_function_pod_labels{project_name="' +
701
+ ctrl.project.metadata.name + '"})';
694
702
  var args = {
695
- metric: FunctionsService.functionMetrics.FUNCTION_EVENTS + '{project="' + ctrl.project.metadata.name + '"}',
703
+ metric: ctrl.functionEventsMetric + functionEventsProjectName,
696
704
  from: from,
697
705
  until: until,
698
706
  interval: '5m'
699
707
  };
700
708
 
701
709
  ctrl.getStatistics(args)
702
- .then(parseData.bind(null, FunctionsService.functionMetrics.FUNCTION_EVENTS))
703
- .catch(handleError.bind(null, FunctionsService.functionMetrics.FUNCTION_EVENTS));
710
+ .then(parseData.bind(null, ctrl.functionEventsMetric))
711
+ .catch(handleError.bind(null, ctrl.functionEventsMetric));
704
712
 
705
- args.metric = FunctionsService.functionMetrics.FUNCTION_CPU;
713
+ args.metric = ctrl.functionCPUMetric + projectName;
706
714
  ctrl.getStatistics(args)
707
- .then(parseData.bind(null, args.metric))
708
- .catch(handleError.bind(null, args.metric));
715
+ .then(parseData.bind(null, ctrl.functionCPUMetric))
716
+ .catch(handleError.bind(null, ctrl.functionCPUMetric));
709
717
 
710
- args.metric = FunctionsService.functionMetrics.FUNCTION_GPU;
718
+ args.metric = ctrl.functionGPUMetric + gpuUtilizationMetric;
719
+ args.appendQueryParamsToUrlPath = true;
711
720
  ctrl.getStatistics(args)
712
- .then(parseData.bind(null, args.metric))
713
- .catch(handleError.bind(null, args.metric));
721
+ .then(parseData.bind(null, ctrl.functionGPUMetric))
722
+ .catch(handleError.bind(null, ctrl.functionGPUMetric));
723
+ delete args.appendQueryParamsToUrlPath;
714
724
 
715
- args.metric = FunctionsService.functionMetrics.FUNCTION_MEMORY;
725
+ args.metric = ctrl.functionMemoryMetric + projectName;
716
726
  ctrl.getStatistics(args)
717
- .then(parseData.bind(null, args.metric))
718
- .catch(handleError.bind(null, args.metric));
727
+ .then(parseData.bind(null, ctrl.functionMemoryMetric))
728
+ .catch(handleError.bind(null, ctrl.functionMemoryMetric));
719
729
 
720
730
  /**
721
731
  * Sets error message to the relevant function
@@ -810,7 +820,7 @@
810
820
  .value();
811
821
  }
812
822
 
813
- if (type === FunctionsService.functionMetrics.FUNCTION_CPU) {
823
+ if (type === ctrl.functionCPUMetric) {
814
824
  lodash.merge(aFunction.ui, {
815
825
  metrics: {
816
826
  'cpu.cores': latestValue,
@@ -819,7 +829,7 @@
819
829
  })
820
830
  }
821
831
  });
822
- } else if (type === FunctionsService.functionMetrics.FUNCTION_MEMORY) {
832
+ } else if (type === ctrl.functionMemoryMetric) {
823
833
  lodash.merge(aFunction.ui, {
824
834
  metrics: {
825
835
  size: Number(latestValue),
@@ -828,7 +838,7 @@
828
838
  })
829
839
  }
830
840
  });
831
- } else if (type === FunctionsService.functionMetrics.FUNCTION_GPU) {
841
+ } else if (type === ctrl.functionGPUMetric) {
832
842
  lodash.merge(aFunction.ui, {
833
843
  metrics: {
834
844
  'gpu.cores': latestValue,
@@ -853,10 +863,10 @@
853
863
  });
854
864
 
855
865
  // if the column values have just been updated, and the table is sorted by this column - update sort
856
- if (type === FunctionsService.functionMetrics.FUNCTION_CPU && ctrl.sortedColumnName === 'ui.metrics[\'cpu.cores\']' ||
857
- type === FunctionsService.functionMetrics.FUNCTION_GPU && ctrl.sortedColumnName === 'ui.metrics[\'gpu.cores\']' ||
858
- type === FunctionsService.functionMetrics.FUNCTION_MEMORY && ctrl.sortedColumnName === 'ui.metrics.size' ||
859
- type === FunctionsService.functionMetrics.FUNCTION_EVENTS &&
866
+ if (type === ctrl.functionCPUMetric && ctrl.sortedColumnName === 'ui.metrics[\'cpu.cores\']' ||
867
+ type === ctrl.functionGPUMetric && ctrl.sortedColumnName === 'ui.metrics[\'gpu.cores\']' ||
868
+ type === ctrl.functionMemoryMetric && ctrl.sortedColumnName === 'ui.metrics.size' ||
869
+ type === ctrl.functionEventsMetric &&
860
870
  lodash.includes(['ui.metrics.invocationPerSec', 'ui.metrics.count'], ctrl.sortedColumnName)) {
861
871
  sortTable();
862
872
  }
@@ -9,9 +9,7 @@
9
9
  checkedItem: '',
10
10
  functionMetrics: {
11
11
  FUNCTION_CPU: 'nuclio_function_cpu',
12
- FUNCTION_GPU: encodeURI(
13
- 'kube_metrics_server_pods_gpu_utilization * on (pod) group_left(function_name)(nuclio_function_pod_labels)'
14
- ),
12
+ FUNCTION_GPU: 'kube_metrics_server_pods_gpu_utilization',
15
13
  FUNCTION_MEMORY: 'nuclio_function_mem',
16
14
  FUNCTION_EVENTS: 'nuclio_processor_handled_events_total'
17
15
  },
@@ -539,12 +537,12 @@
539
537
  defaultValue: lodash.get(
540
538
  ConfigService,
541
539
  'nuclio.defaultFunctionConfig.attributes.spec.triggers.v3ioStream.url',
542
- ''
540
+ 'http://v3io-webapi:8081'
543
541
  ),
544
542
  placeholder: $i18next.t('common:PLACEHOLDER.ENTER_URL', { lng: lng }),
545
543
  moreInfoDescription: $i18next.t('functions:TOOLTIP.V3IO_STREAM_URL', { lng: lng }),
546
544
  moreInfoHtml: true,
547
- isAdvanced: !lodash.isEmpty(lodash.get(additionalData, 'containers')),
545
+ isAdvanced: false,
548
546
  allowEmpty: false
549
547
  },
550
548
  {
@@ -31,7 +31,7 @@
31
31
  pattern: validateUniqueness.bind(null, 'name')
32
32
  }]),
33
33
  secretKey: ValidationService.getValidationRules('k8s.configMapKey'),
34
- secret: ValidationService.getValidationRules('k8s.dns1123Subdomain'),
34
+ secret: ValidationService.getValidationRules('k8s.secretName'),
35
35
  configmapKey: ValidationService.getValidationRules('k8s.configMapKey', [
36
36
  {
37
37
  name: 'uniqueness',
@@ -187,7 +187,8 @@
187
187
  runtimeAttributes: {
188
188
  repositories: []
189
189
  }
190
- }
190
+ },
191
+ resources: $stateParams.isNewFunction ? lodash.get(ConfigService, 'nuclio.defaultFunctionPodResources', {}) : {}
191
192
  },
192
193
  ui: {
193
194
  versionCode: '',