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

Improve Mac setup procedure #135

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open
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
7 changes: 5 additions & 2 deletions docker/everest-playground/.devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"dockerfile": "Dockerfile"
},
"containerEnv": {
"MQTT_SERVER_ADDRESS": "mqtt-server",
"MQTT_SERVER_ADDRESS": "localhost",
"MQTT_SERVER_PORT": "1883"
},
"extensions": [
Expand All @@ -28,5 +28,8 @@
},
"terminal.integrated.defaultProfile.linux": "bash",
"python.pythonPath": "/usr/bin/python3"
}
},
"features": {
"ghcr.io/devcontainers/features/docker-in-docker:2": {}
}
}
1 change: 1 addition & 0 deletions docker/everest-playground/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ RUN apt-get update \
libcurl4-openssl-dev \
pkg-config \
libpcap-dev \
libcap-dev \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
2 changes: 2 additions & 0 deletions docker/mqtt-devcontainer.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
docker run -d --name mqtt-server -p 1883:1883 -p 9001:9001 -v ./mosquitto/mosquitto.conf:/mosquitto/config/mosquitto.conf eclipse-mosquitto:2.0.10
2 changes: 1 addition & 1 deletion everest-cpp/init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -33,4 +33,4 @@ cd everest-core/build
echo ""
echo "You can now build everest-core with the following commands:"
echo ""
echo "cmake .. && make install -j$(nproc)"
echo "cmake .. -DBUILD_SHARED_LIBS=on && make install -j$(nproc)"
41 changes: 41 additions & 0 deletions mac-setup.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# How To: Develop on a Mac

Check notice on line 1 in mac-setup.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

mac-setup.md#L1

Expected: [None]; Actual: # How To: Develop on a Mac

## Preparation

1. Clone the repository `git clone [email protected]:EVerest/everest-utils.git`
1. From inside VSCode, type `Cmd+Shift+P`
1. Select the directory `everest-utils/docker/everest-playground` to start a
DevContainer - all the following commands must be executed in VSCode terminals
inside the DevContainer.
1. Run `. init.sh` to initialize the dependencies.
1. Compile and install

```bash
cmake .. -DBUILD_SHARED_LIBS=on && make install
```

## MQTT
Open a terminal tab to start the MQTT server

```bash
cd /workspace/docker ; ./mqtt-devcontainer.sh
```

## Nodered / Simulator UI
Open a terminal tab to start the Nodered server

```bash
cd /workspace/everest-cpp/everest-core/build ; ./run-scripts/nodered-sil.sh
```

## Software-in-the-loop Simulator
Open a terminal tab to start the simulation

```bash
export LD_LIBRARY_PATH=$(find / -name "*.so*" 2>/dev/null |
xargs -I {} dirname {} | sort -u | tr '\n' ':' | sed 's/:$//')

cd /workspace/everest-cpp/everest-core/build ; ./run-scripts/run-sil.sh
```

Open http://localhost:1880/ui and test the Charging Station and EV simulators.