Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Impose resource constraints on demos #6

Merged
merged 1 commit into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
TAG=0.0.8
TAG=0.0.9

EVEREST_MANAGER_CPUS='1.0'
EVEREST_MANAGER_MEMORY='1024mb'
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,18 @@ The use cases supported by the three demos are summarized in conceptual block di
| **One EV ↔ EVSE (ISO 15118-2 DC)** | <img src="img/one_ev_one_evse_iso15118-2_dc.png" width="400" height="246"> |
| **Two EV ↔ EVSE** | <img src="img/two_ev_one_evse.png" width="400" height="246"> |

#### Demo Notes
EVerest is designed with embedded applications in mind. To illustrate this, we've imposed maximum CPU usage and RAM constraints of 100% (1 core) and 1024MB, respectively, in each of the demos. The sole exception is the automated testing demo, where resource constraints are less relevant to the demo's purpose. Even on modest desktop hardware, these constraints should only result in slightly longer boot times.

You can experiment with different constraints for a demo by exporting `EVEREST_MANAGER_CPUS` and `EVEREST_MANAGER_MEMORY` environment variables prior to running one of the demos. The values of these variables can take on any valid Docker [CPU value](https://docs.docker.com/config/containers/resource_constraints/#configure-the-default-cfs-scheduler) and [memory limit](https://docs.docker.com/config/containers/resource_constraints/#limit-a-containers-access-to-memory), respectively. For example, to run a demo with two CPUs and 1536 MB of RAM, you could execute

```bash
export EVEREST_MANAGER_CPUS='2.0' EVEREST_MANAGER_MEMORY='1536mb'
```

in your terminal before one of the one-liners presented in the next section.


### STEP 1: Run the demo
- Copy and paste the command for the demo you want to see:
- 🚨 AC Charging ⚡: `curl https://raw.githubusercontent.com/everest/everest-demo/main/demo-ac.sh | bash`
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.admin-panel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ services:

manager:
image: ghcr.io/everest/everest-demo/manager:${TAG}
deploy:
resources:
limits:
cpus: "${EVEREST_MANAGER_CPUS}"
memory: "${EVEREST_MANAGER_MEMORY}"
depends_on:
- mqtt-server
environment:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.iso15118-dc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ services:

manager:
image: ghcr.io/everest/everest-demo/manager:${TAG}
deploy:
resources:
limits:
cpus: "${EVEREST_MANAGER_CPUS}"
memory: "${EVEREST_MANAGER_MEMORY}"
depends_on:
- mqtt-server
environment:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.two-evse.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ services:

manager:
image: ghcr.io/everest/everest-demo/manager:${TAG}
deploy:
resources:
limits:
cpus: "${EVEREST_MANAGER_CPUS}"
memory: "${EVEREST_MANAGER_MEMORY}"
depends_on:
- mqtt-server
environment:
Expand Down
5 changes: 5 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ services:

manager:
image: ghcr.io/everest/everest-demo/manager:${TAG}
deploy:
resources:
limits:
cpus: "${EVEREST_MANAGER_CPUS}"
memory: "${EVEREST_MANAGER_MEMORY}"
depends_on:
- mqtt-server
environment:
Expand Down