EVerest / everest-demo

EVerest demo: Dockerized demo with software in the loop simulation
Apache License 2.0
14 stars 13 forks source link

Impose resource constraints on demos #6

Closed drmrd closed 7 months ago

drmrd commented 8 months ago

As a first step towards emphasizing that EVerest is built for embedded systems, we're adding maximum CPU usage and RAM constraints of 100% (1 core) and 1 GB, respectively, in each demo.

Note that EVerest can run under much more aggressive resource constraints in realistic conditions. See for example this discussion from the mailing list for more details. The manager containers in our demos require more CPU and memory resources at present due to the inclusion of unoptimized test and simulation modules in these containers. Follow-up work will include a demo where the test and simulation code is isolated into a separate image to provide greater realism.

drmrd commented 7 months ago

@shankari: I have another PR ready for you. 😃

While we're here, there was an interesting discussion at the Weekly Technical Sync on Tuesday that's relevant to improved versions of this demo. Someone had asked about the possibility of extracting EV simulations into their own containers/running them on separate boards, and @corneliusclaussen had an in-depth comprehensive response. The short of it is that

shankari commented 7 months ago

Since I merged the OCPP change first, the semver needs to be bumped up by 2.

shankari commented 7 months ago

Although I am not sure that the limits should be applied to the CSMS, since it will typically run in the cloud.

drmrd commented 7 months ago

I am going to merge this now, but this PR is missing a couple of docker compose files (automated-tests and ocpp16j). @drmrd, please submit them in a separate PR 😄

Doh! 😆 Thanks for catching this, @shankari. I've added constraints to the OCPP 1.6J demo in #13. I had intentionally not included constraints on the automated tests demo, since it didn't seem useful to impose constraints on a Pytest run. (If constraints are needed for testing, I'd assume we would impose them from within the Pytest test cases themselves.) The automated testing demo is also called out in the README as the sole exception to the rule on resource constraints.

That said, they're easy to add to the automated testing demo if you'd like them there.