Skip to content

Commit

Permalink
Merge pull request #6 from US-JOET/resource-constraints
Browse files Browse the repository at this point in the history
Impose resource constraints on demos
  • Loading branch information
shankari authored Dec 8, 2023
2 parents 5b1c5b5 + 82303d6 commit 331a5fe
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 1 deletion.
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

0 comments on commit 331a5fe

Please sign in to comment.