### Download and Execute DevContainer Setup Script (One-liner) Source: https://github.com/everest/everest-dev-environment/blob/main/README.md This command downloads the setup script for the development container and makes it executable. It automates the setup process for VS Code development environments. ```bash curl -s https://raw.githubusercontent.com/EVerest/everest-dev-environment/main/devcontainer/template/setup-container > setup-container && chmod +x setup-container && ./setup-container ``` -------------------------------- ### Example .env File Content Source: https://github.com/everest/everest-dev-environment/blob/main/README.md This is an example of the content generated in the .devcontainer/.env file. It includes variables like ORGANIZATION_ARG, REPOSITORY_HOST, and HOST_WORKSPACE_FOLDER. ```bash # Auto-generated by setup script ORGANIZATION_ARG=EVerest REPOSITORY_HOST=gitlab.com REPOSITORY_USER=git COMMIT_HASH=<..> EVEREST_TOOL_BRANCH=main UID=<..> GID=<..> HOST_WORKSPACE_FOLDER=/home/fmihut/checkout/ev-ws ``` -------------------------------- ### Download and Execute DevContainer Setup Script (Manual Clone) Source: https://github.com/everest/everest-dev-environment/blob/main/README.md If the curl command fails, you can manually clone the repository, copy the setup script, make it executable, and then run it. The cloned repository can be deleted afterward. ```bash git clone git@github.com:EVerest/everest-dev-environment.git cp everest-dev-environment/devcontainer/template/setup-container setup-container chmod +x setup-container ./setup-container # you can delete the everest-dev-environment folder, it is not needed anymore rm -rf everest-dev-environment ``` -------------------------------- ### Start Everest Dev Environment Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Starts the Everest development environment. This command should be run after ensuring no port conflicts exist. ```bash ./devrd start ``` -------------------------------- ### Install Python Packages Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Ensure pip, setuptools, and wheel are up-to-date before installing edm. This is a prerequisite for package management. ```bash python3 -m pip install --upgrade pip setuptools wheel ``` -------------------------------- ### Build EVerest Project and Start SIL Simulation Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Steps to build the EVerest project within the container and then switch to the host to start a SIL simulation using a specific Node-RED flow. ```bash # 1. Start environment (HOST) ./devrd start # 2. Build project (CONTAINER) ./devrd prompt cd /workspace cmake -B build -S . -GNinja && ninja -C build install/strip # 3. Switch to simulation (HOST) ./devrd flow everest-core/config/nodered/config-sil-dc-flow.json # 4. Open UI # Visit: http://localhost:1880/ui ``` -------------------------------- ### Install edm and Initialize Workspace Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Clone the repository, navigate to the dependency_manager directory, install edm, and initialize an EVerest workspace. This command also registers the EDM CMake module. ```bash git clone git@github.com:EVerest/everest-dev-environment.git cd everest-dev-environment/dependency_manager python3 -m pip install . edm --config ../everest-complete.yaml --workspace ~/checkout/everest-workspace ``` -------------------------------- ### Dependency Modifications Example Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Example content for a dependencies_modified.yaml file, showing how to nullify Git sources or rename dependencies for find_package. ```yaml nlohmann_json: git: null # this makes edm look for nlohmann_json via find_package libfmt: rename: fmt # if find_package needs a different dependency name you can rename it git: null catch2: git_tag: v1.2.3 # if you want to select a different git tag for a build this is also possible ``` -------------------------------- ### Start Docker Compose Services Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Use these commands to start specific Docker Compose profiles or all services. The default command generates a .env file if it's missing. ```bash ./devrd start # Start all services (generates .env if missing) ./devrd start all # Start all services (same as above) ./devrd start sil # Start SIL simulation tools ./devrd start ocpp # Start OCPP backend ./devrd start mqtt # Start only MQTT server ``` -------------------------------- ### Example devrd Command Completion Usage Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Illustrates how to use tab completion with the devrd command to see available commands or options. ```bash ./devrd # Shows all commands ./devrd start # Shows available profiles to start ``` -------------------------------- ### Install Python Prerequisites Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Installs necessary Python packages for development outside of Docker containers, including protobuf, grpcio-tools, and a specific version of nanopb. ```bash python3 -m pip install protobuf grpcio-tools nanopb==0.4.8 ``` -------------------------------- ### Clone and Build EVerest Repositories Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Commands to clone and build EVerest core and framework repositories within the development container. Assumes the environment is already built and started. ```bash # Follow the Quick Start setup first and # Build and start the environment ./devrd build # generates .env if missing and builds the container code . # if you use VSCode ./devrd start # not using VSCode (generates .env if missing) ./devrd prompt # not using VSCode # inside the container cd /workspace everest clone everest-core # or use the git command to clone everest clone everest-framework # or use the git command to clone cd everest-core # Build the project (see Building EVerest section for details) cmake -S . -B build -G Ninja ninja -C build install # this is building everest-core and it will use the everest-framework cloned locally # the rest of the dependencies will be automatically downloaded by edm # you can manually clone any of the dependencies locally if you want to ``` -------------------------------- ### CLI Commands for Development Environment Management Source: https://github.com/everest/everest-dev-environment/blob/main/doc/REQUIREMENTS.md These bash commands manage the development environment, including setup, starting/stopping services, building, purging, executing commands, and managing flows. ```bash # Installation (one-time setup) ./setup # Development environment management ./devrd start [dev|mqtt|ocpp|nodered|all] ./devrd stop [dev|mqtt|ocpp|nodered|all] ./devrd build [--all|service] ./devrd purge [service|all] [--with-images] [--with-volumes] ./devrd exec "" ./devrd shell ./devrd set-flow ./flows/sim_fast.flow.json ./devrd status ./devrd logs [service] [--follow] ./devrd build-everest ./devrd run-sil [args...] ``` -------------------------------- ### Switch Everest Instances Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Commands to switch between different Everest instances or projects. This involves stopping the current instance, purging resources if necessary (especially when switching branches or projects), and then starting the new instance in the target directory. ```bash # Stop current instance ./devrd stop # Purge if switching to different branch/project ./devrd purge # Start new instance cd ~/different-everest-directory ./devrd start ``` -------------------------------- ### Cross-Compile Everest Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Configures and builds the Everest project for cross-compilation. This involves setting up CMake with specific options for installation prefix, ccache, compile commands export, and disabling JavaScript and Python support, then installing and transferring the build artifacts to a target device. ```bash cd {...}/everest-core cmake -S . -B build-cross -GNinja -DCMAKE_INSTALL_PREFIX=/var/everest -DEVC_ENABLE_CCACHE=1 -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DEVEREST_ENABLE_JS_SUPPORT=OFF -DEVEREST_ENABLE_PY_SUPPORT=OFF -Deverest-cmake_DIR= DESTDIR=dist ninja -C build-cross install/strip && \ rsync -av build-cross/dist/var/everest root@:/var ``` -------------------------------- ### Stop and Kill Process on Port Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Use this command to stop the current instance and kill any process using a specific port, typically before starting a new instance. ```bash sudo lsof -ti:1880 | xargs sudo kill -9 ``` -------------------------------- ### Get Git Repository Information Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Display the status of Git repositories in the current directory or a specified workspace. Use --git-fetch to update remote information. ```bash edm --git-info --git-fetch ``` ```bash edm --workspace ~/checkout/everest-workspace --git-info --git-fetch ``` -------------------------------- ### Check EDM Version Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Displays the installed version of the EDM tool. A minimum version of 0.8.0 is required for compilation using Forgejo. ```bash edm --version ``` -------------------------------- ### EVerest Development Container Management Script Source: https://github.com/everest/everest-dev-environment/blob/main/README.md The `./devrd` script provides a command-line interface for managing the EVerest development container. It supports starting, stopping, building, and accessing the container, as well as managing Node-RED simulations and custom environment configurations. ```bash # Quick start (generate .env and start all services) ./devrd start # Step-by-step workflow: ./devrd build # Build container (generates .env if missing) ./devrd start # Start all services (generates .env if missing) ./devrd stop # Stop all services ./devrd purge # Remove all containers, images, and volumes # Container access: ./devrd prompt # Get interactive shell in container ./devrd exec # Execute single command in container # Node-RED SIL Simulation: ./devrd flows # List available simulation flows ./devrd flow # Switch to specific flow file # Custom environment configuration: ./devrd env -w /path/to/workspace # Set workspace directory mapping ``` -------------------------------- ### Create and Navigate to Workspace Directory Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Use these commands to create a new directory for your project and navigate into it. This directory will serve as your workspace. ```bash mkdir my-workspace cd my-workspace ``` -------------------------------- ### User Journey: Run everything in VS Code Source: https://github.com/everest/everest-dev-environment/blob/main/doc/REQUIREMENTS.md This sequence outlines the steps to set up and run the EVerest development environment entirely within VS Code. ```bash ./setup → Open repo → Reopen in Container → ./devrd start all → open Node-RED/MQTT Explorer in browser. ``` -------------------------------- ### Build Everest with Tests Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Configures the build using CMake with Ninja as the generator, enabling testing, and excluding specific modules. It then builds the project and runs the tests. ```bash cmake -Bbuild -S. -GNinja -DBUILD_TESTING=ON -DEVEREST_EXCLUDE_MODULES="Linux_Systemd_Rauc" ninja -C build ninja -C build test ``` -------------------------------- ### Build EVerest Project using Make Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Alternative to the ninja build system, this command shows how to build the EVerest project using 'make' by omitting the -G Ninja flag during CMake configuration. ```bash cmake -B build -S . && make -C build install/strip ``` -------------------------------- ### Initialize Workspace with Specific Version Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Initialize an EVerest workspace by pulling a specific release version from the server. This is useful for reproducible builds and requires the current code to be in a clean state. ```bash edm init 2023.7.0 ``` -------------------------------- ### Create Workspace Config Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Generate a custom workspace configuration file from an existing directory tree. Use --include-remotes to filter repositories by remote URL patterns. ```bash edm --create-config custom-config.yaml ``` ```bash edm --create-config custom-config.yaml --include-remotes git@github.com:EVerest/* ``` ```bash edm --create-config custom-config.yaml --include-remotes git@github.com:EVerest/everest* git@github.com:EVerest/liblog.git ``` ```bash edm --create-config custom-config.yaml --external-in-config ``` -------------------------------- ### User Journey: Run headless (no VS Code) Source: https://github.com/everest/everest-dev-environment/blob/main/doc/REQUIREMENTS.md This sequence describes how to run the EVerest development environment without VS Code, suitable for headless operations. ```bash ./setup → ./devrd start dev → ./devrd build-everest → ./devrd run-sil --scenario basic ``` -------------------------------- ### User Journey: Switch Node-RED flow Source: https://github.com/everest/everest-dev-environment/blob/main/doc/REQUIREMENTS.md Instructions for changing the active Node-RED flow and restarting the Node-RED service. ```bash ./devrd set-flow ./flows/ac_slow.flow.json → ./devrd stop nodered && ./devrd start nodered ``` -------------------------------- ### Initialize EVerest Workspace Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Initialize a new EVerest workspace using edm. This command can be run from within the workspace directory or by specifying the workspace path. ```bash edm init --workspace ~/checkout/everest-workspace ``` ```bash edm init ``` -------------------------------- ### Clean Rebuild Development Environment Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Performs a clean rebuild of the development environment by stopping all containers, removing all Docker resources (containers, images, volumes), and then rebuilding from scratch. Use this if a standard rebuild doesn't resolve issues. ```bash ./devrd stop ./devrd purge ./devrd build ``` -------------------------------- ### Set Workspace Mapping via Command Line Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Demonstrates how to set the workspace mapping using the -w or --workspace command-line flag when running the devrd env command. This overrides the HOST_WORKSPACE_FOLDER in the .env file. ```bash # Set workspace mapping via command line ./devrd env -w /path/to/workspace # Map to any directory ./devrd start ``` -------------------------------- ### Enable Zsh Shell Completion on Host Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Add these lines to your ~/.zshrc file to enable command-line completion for the devrd script on your host system. ```zsh # Add to your ~/.zshrc autoload -U compinit && compinit source .devcontainer/devrd-completion.zsh ``` -------------------------------- ### Enable Bash Shell Completion on Host Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Add this line to your ~/.bashrc file to enable command-line completion for the devrd script on your host system. ```bash # Add to your ~/.bashrc source .devcontainer/devrd-completion.bash ``` -------------------------------- ### Generate Environment Configuration Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Generates a new .env file for the development environment using auto-detection of necessary configurations. ```bash ./devrd env ``` -------------------------------- ### Define Project Dependencies in YAML Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Use a dependencies.yaml file to specify project dependencies, including their Git repository, tag, and build options. ```yaml --- liblog: git: git@github.com:EVerest/liblog.git git_tag: main options: ["BUILD_EXAMPLES OFF"] libtimer: git: git@github.com:EVerest/libtimer.git git_tag: main options: ["BUILD_EXAMPLES OFF"] ``` -------------------------------- ### Purge and Rebuild Environment Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Removes all Docker resources (containers, images, volumes) for the current folder and then builds the environment. This will also generate a new .env file if one is missing. ```bash ./devrd purge ./devrd build ``` -------------------------------- ### Customize Environment Variables Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Allows customization of environment variables, such as specifying a particular branch for the everest-dev-environment repository. ```bash ./devrd env -v release/1.0 ``` -------------------------------- ### Generate .env File with Auto-Detected Values Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Use this command to generate a .env file with environment variables automatically detected from your host system. This file is typically located at .devcontainer/.env. ```bash ./devrd env # Generate .env file with auto-detected values ``` -------------------------------- ### Rebuild Development Environment Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Regenerates the .env file and then rebuilds the Docker containers with the updated environment variables. This is recommended after manual edits to .env. ```bash ./devrd env ./devrd build ``` -------------------------------- ### Open Workspace in VS Code Source: https://github.com/everest/everest-dev-environment/blob/main/README.md After setting up the development container, use this command to open your workspace folder in Visual Studio Code. VS Code will then prompt you to reopen the workspace within the container. ```bash code . ``` -------------------------------- ### Enable CPM Source Cache Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Set the CPM_SOURCE_CACHE environment variable to prevent re-downloading of dependencies managed by CPM. This optimizes build times by reusing cached sources. ```bash export CPM_SOURCE_CACHE=$HOME/.cache/CPM ``` -------------------------------- ### Conditionally Include Dependencies Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Specify dependencies that should only be included based on a CMake condition. Ensure the condition is defined before calling evc_setup_edm(). ```yaml catch2: git: https://github.com/catchorg/Catch2.git git_tag: v3.4.0 cmake_condition: "BUILD_TESTING" ``` -------------------------------- ### Include EDM CMake Module Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Add this line to your top-level CMakeLists.txt to enable EDM integration. Ensure the EDM CMake module is registered. ```cmake find_package(EDM REQUIRED) ``` -------------------------------- ### Default Configuration Variables Source: https://github.com/everest/everest-dev-environment/blob/main/doc/REQUIREMENTS.md Editable via `.devcontainer/.env`, these variables define default settings for the development environment, including organization, repository host, user, and branch. ```env ORGANIZATION_ARG=EVerest REPOSITORY_HOST=github.com REPOSITORY_USER=git COMMIT_HASH= EVEREST_TOOL_BRANCH=main UID= GID= HOST_WORKSPACE_FOLDER= ``` -------------------------------- ### Stop Docker Compose Services Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Commands to stop services. You can stop all services, a specific profile, or containers matching a pattern. ```bash ./devrd stop # Stop all services ./devrd stop all # Stop all services (same as above) ./devrd stop sil # Stop SIL profile only ./devrd stop ev-ws # Stop all containers matching pattern 'ev-ws' ``` -------------------------------- ### Override Docker Compose Project Name Source: https://github.com/everest/everest-dev-environment/blob/main/README.md Demonstrates how to override the default Docker Compose project name by setting the DOCKER_COMPOSE_PROJECT_NAME environment variable. ```bash DOCKER_COMPOSE_PROJECT_NAME="my-project" ./devrd start ``` -------------------------------- ### Modify Dependency Git URLs Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Set the EVEREST_MODIFY_DEPENDENCIES_URLS environment variable to remap Git repository URLs. Multiple prefix/replace pairs can be chained. ```bash EVEREST_MODIFY_DEPENDENCIES_URLS="prefix=https://github.com/EVerest/ replace=git@github.com:EVerest/" ``` ```bash EVEREST_MODIFY_DEPENDENCIES_URLS="prefix=https://github.com/EVerest/ replace=git@github.com:EVerest/ prefix=https://github.com/EVerest/everest-framework.git replace=https://github.com/EVerest/everest-framework.git" ``` -------------------------------- ### Modify Dependencies with a File Source: https://github.com/everest/everest-dev-environment/blob/main/dependency_manager/README.md Use the EVEREST_MODIFY_DEPENDENCIES environment variable to specify a file containing modifications to the dependencies.yaml. This is applied during the CMake run. ```bash EVEREST_MODIFY_DEPENDENCIES=../dependencies_modified.yaml cmake -S . -B build ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.