9.3. How To: Develop on a Mac

This is a tutorial on how to setup your Mac to develop on EVerest.

9.3.1. Application Setup

  1. Install Homebrew

    Follow the instructions on the brew.sh.

    It may ask you for your password, but don’t worry, that is expected.

  2. Install Docker Desktop

    Follow the instructions from Install Docker Desktop on Mac.

  3. Install VSCode

    You can either download it from the VSCode website, or from Homebrew:

    brew install --cask visual-studio-code
    
  4. Install VSCode’s Dev Containers Extension

    Once you have VSCode up and running, follow the instructions at the Dev Container extension’s page.

9.3.2. GitHub Setup

  1. Create an ssh keypair

    ssh-keygen -t rsa -a 100 -Z aes128-gcm@openssh.com
    
  2. Create a file named config in the ~/.ssh folder

    touch ~/.ssh/config
    

    Add the following to the file:

    AddKeysToAgent yes
    User git
    PubkeyAcceptedAlgorithms +ssh-rsa
    
  3. Checkout the EVerest Utils repository

    > git@github.com:EVerest/everest-utils.git
    > cd everest-utils
    

    The EVerest utilities GitHub repository contains the dev container that you will need to develop on a Mac.

9.3.3. Standup the Dev Docker Environment

  1. Stand up the background Docker network and containers

    From the project root of everest-utils, create the infranet_network Docker network:

    docker network create --driver bridge --ipv6  --subnet fd00::/80 infranet_network --attachable || true
    

    Stand up Everest MQTT and Node-RED Docker containers:

    docker compose -f "./docker/docker-compose.yml" up -d mqtt-server
    docker compose -f "./docker/docker-compose.yml" up -d nodered
    

    There is also a script version of this inside the EVerest Utilities repository.

    bin/devup
    
  2. Open the dev container inside VSCode

    • Press CMD + Shift + P

    • type Dev Containers: Open Folder in Container…

    Use the Command Pallet to open the Dev Container
  3. Navigate and open the docker/everest-playground folder.

    ../../_images/shot2_open_folder.png

    This will open the EVerest Playground as a VSCode dev container.

  4. Initialize your environment

    Now we run commands inside the Playground based on the instructions from the /everest-cpp/README.md file.

    Initialize the EVerest workspace sourcing the ./init.sh file:

    ./init.sh

    The working directory will be changed to everest-core/build. Here you can build the project:

    cmake .. && make install
    

    You can also use make’s -j flag to speed up the build:

    cmake .. && make install -j12
    
    ./make install

    Now you’re ready to go.

9.3.4. EVerest SIL Simulation

./dist/bin/manager --config ../config/config-sil-dc.yaml

This starts the EVerest Manager with the modules loaded determined by the config-sil-dc.yaml config file.

You can interact with it using the Node-RED UI by opening your browser to http://localhost:8849/.

EVerest Admin Panel

9.3.4.1. Stopping things

Code > File > Close Remote Connection

9.3.4.2. Resources