Skip to content

Conversation

@willcl-ark
Copy link
Contributor

@willcl-ark willcl-ark commented Sep 11, 2023

Closes: #26

Adds a few demo profiles such as laptop, desktop, raspberry_pi, server to the graph config.

While we are using docker-compose, and not swarm, we cannot easily limit physical CPUS (withough downgrading to docker-compose v2), but we can get "relative resourse usage", and memory limitations.

This line:

"cpu_shares": int(self.resource_profile.get("cpus", "0.5")) * 1024,

is the temporary "hack" which converts our cpu number from a profile to a rough cpu_shares value (which docker-compose accepts).

Link: https://docs.docker.com/config/containers/resource_constraints/

Adds a few demo profiles such as laptop, desktop, raspberry_pi, server to the graph config.

While we are using docker-compose, and not swarm, we cannot easily limit physical CPUS (withough downgrading to docker-compose v2), but we can get "relative resourse usage", and memory limitations.
@josibake
Copy link
Collaborator

josibake commented Feb 3, 2024

Concept ACK

Need to look at this with the k8s backend, but I think it should work by having the resource profiles and then each backend translates that into something the backend can understand

@willcl-ark
Copy link
Contributor Author

If we want ot continue with tc_netem, then I think it just needs a big rebase.

If we want to pass it as actual pod resource profile to the cluster (can you even do that), then it might need a total re-write...

@josibake
Copy link
Collaborator

josibake commented Feb 3, 2024

You can set pod resource limits (CPU, memory) directly when defining the pod in k8s. But we could also use tc_netem throughout, because if I remember correctly that's happening inside a docker container? So it should work on both and iirc, it gives more options than just CPU/RAM.

Maybe we just stick with tc_netem through for now? Longterm, I can see value in having the profile be a "warnet" concept, and then each backend translates the profile into what the backend needs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Development

Successfully merging this pull request may close these issues.

Define node personas in the graph file

2 participants