kepler icon indicating copy to clipboard operation
kepler copied to clipboard

kepler_container_joules_total stays costant over time

Open AntonioDiTuri opened this issue 7 months ago • 7 comments

What happened?

I installed kepler on a local kind cluster following the documentation, specifically using the make cluster-up command. I installed the last version of Kepler: release-0.7.10. My hardware is Mac with intel processor.

I then run a simple python code to check what was the consumption for demo purpose.

This is the simple python code:

# inefficient_fibonacci.py
import os

def inefficient_fibonacci(n):
  if n <= 1:
    return n
  return inefficient_fibonacci(n-1) + inefficient_fibonacci(n-2)

def calculate_fibonacci(n):
  return inefficient_fibonacci(n)

if __name__ == "__main__":
  n = os.getenv("INPUT")
  result = calculate_fibonacci(int(n))
  print(f"Fibonacci of {n} is: {result}")

This is the dockerfile:

FROM python:latest
WORKDIR /app
COPY fibonacci-infeccient.py ./app.py
CMD ["python", "app.py"]

And this is the simple pod.yaml I used to deploy:

apiVersion: v1
kind: Pod
metadata:
  name: fibonacci-inefficient
spec:
  containers:
  - name: fibonacci-inefficient
    image: fibonacci-inefficient:latest
    imagePullPolicy: Never
    env:
    - name: INPUT
      value: "995" # a high value to observe the behavior

What did you expect to happen?

When querying in grafana the simple metric: namely kepler_container_joules_total The value of the metric does not increase over time. It stays costant, the queries with mode=idle and mode=dynamic return different numbers but still costant.

Since the container is always on and uses constantly the following resources:

k top pods
NAME                    CPU(cores)   MEMORY(bytes)
fibonacci-inefficient   1000m        4Mi

I would have expected the energy value to rise. But that is not the case. Why? I am attaching a screen of the grafana:

Screenshot 2024-06-25 at 22 07 31

[EDIT] from the screenshot it might seem that I observed this only for few minutes and I did not give enough time to the power models to "trigger a change" in the output. However observing the process for 1h also made no difference, the energy stays constant

Am I missing something?

How can we reproduce it (as minimally and precisely as possible)?

  • Get a Mac with intel chip
  • Deploy local kind cluster using make cluster-up
  • Install latest version (release 0.7.10) using helm file as per docs
  • Build the docker image and Deploy it on the kind registry: kind load docker-image $IMAGE_NAME
  • Apply the pod file
  • Check this query on grafana: kepler_container_joules_total{pod_name="fibonacci-inefficient"}

Anything else we need to know?

No response

Kepler image tag

release-0.7.10.

Kubernetes version

$ kubectl version
1.30.0

Cloud provider or bare metal

Bare metal - Apple wit intel chip

OS version

# On Linux:
$ cat /etc/os-release
# paste output here
$ uname -a
# paste output here

# On Windows:
C:\> wmic os get Caption, Version, BuildNumber, OSArchitecture
# paste output here

Install tools

Kind cluster local

Kepler deployment config

For on kubernetes:

$ KEPLER_NAMESPACE=kepler

# provide kepler configmap
$ kubectl get configmap kepler-cfm -n ${KEPLER_NAMESPACE}
# paste output here

# provide kepler deployment description
$ kubectl describe deployment kepler-exporter -n ${KEPLER_NAMESPACE}

For standalone:

put your Kepler command argument here

Container runtime (CRI) and version (if applicable)

Related plugins (CNI, CSI, ...) and versions (if applicable)

AntonioDiTuri avatar Jun 25 '24 20:06 AntonioDiTuri