Skip to content

Commit

Permalink
Merge following kepler ds changes into the operator:
Browse files Browse the repository at this point in the history
  • Loading branch information
husky-parul committed Jun 30, 2023
1 parent 0d76d4d commit a16d019
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
2 changes: 1 addition & 1 deletion config/manager/kustomization.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ kind: Kustomization
images:
- name: controller
newName: quay.io/sustainable_computing_io/kepler-operator
newTag: 0.4.1
newTag: "0.5"
2 changes: 0 additions & 2 deletions config/samples/kepler.system_v1alpha1_kepler.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ spec:
collector:
image: quay.io/sustainable_computing_io/kepler:latest
collectorPort: 9103
model-server-exporter:
port: 8100



Expand Down
12 changes: 10 additions & 2 deletions controllers/kepler_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ func (r *collectorReconciler) ensureConfigMap(l klog.Logger) (bool, error) {
var data_map = make(map[string]string)

data_map["KEPLER_NAMESPACE"] = r.Instance.Namespace
data_map["KEPLER_LOG_LEVEL"] = "5"
data_map["KEPLER_LOG_LEVEL"] = "1"
data_map["METRIC_PATH"] = "/metrics"
data_map["BIND_ADDRESS"] = bindAddress
data_map["ENABLE_GPU"] = "true"
Expand All @@ -318,6 +318,8 @@ func (r *collectorReconciler) ensureConfigMap(l klog.Logger) (bool, error) {
data_map["CGROUP_METRICS"] = "*"
data_map["MODEL_CONFIG"] = "| CONTAINER_COMPONENTS_ESTIMATOR=false CONTAINER_COMPONENTS_INIT_URL=https://raw.githubusercontent.com/sustainable-computing-io/kepler-model-server/main/tests/test_models/DynComponentModelWeight/CgroupOnly/ScikitMixed/ScikitMixed.json"

data_map["EXPOSE_HW_COUNTER_METRICS"] = "true"
data_map["EXPOSE_CGROUP_METRICS"] = "true"
r.configMap.Data = data_map

return nil
Expand Down Expand Up @@ -380,7 +382,7 @@ func (r *collectorReconciler) ensureDaemonSet(l klog.Logger) (bool, error) {
Privileged: &scc_value,
},
Image: image,
Command: []string{"/usr/bin/kepler", "-address", bindAddress, "-enable-gpu=true", "enable-cgroup-id=true", "v=5"},
Command: []string{"/usr/bin/kepler", "-address", bindAddress, "-enable-gpu=true", "enable-cgroup-id=true", "v=5", "-kernel-source-dir=/usr/share/kepler/kernel_sources"},
Ports: []corev1.ContainerPort{{
ContainerPort: collectorPort,
Name: "http",
Expand Down Expand Up @@ -411,8 +413,14 @@ func (r *collectorReconciler) ensureDaemonSet(l klog.Logger) (bool, error) {
FieldPath: "status.hostIP",
},
}
envFromSourceNode := corev1.EnvVarSource{
FieldRef: &corev1.ObjectFieldSelector{
FieldPath: "spec.nodeName",
},
}
r.daemonSet.Spec.Template.Spec.Containers[0].Env = []corev1.EnvVar{
{Name: "NODE_IP", ValueFrom: &envFromSource},
{Name: "NODE_NAME", ValueFrom: &envFromSourceNode},
}

r.daemonSet.Spec.Template.Spec.Containers[0].VolumeMounts = []corev1.VolumeMount{
Expand Down
2 changes: 1 addition & 1 deletion controllers/sahandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func (d *keplerSADescription) createOrUpdateClusterRole(l klog.Logger) (*rbacv1.
Rules: []rbacv1.PolicyRule{
{
APIGroups: []string{""},
Resources: []string{"nodes/metrics", "nodes/proxy", "nodes/stats"},
Resources: []string{"nodes/metrics", "nodes/proxy", "nodes/stats", "pods"},
Verbs: []string{"get", "watch", "list"},
},
},
Expand Down

0 comments on commit a16d019

Please sign in to comment.