Skip to content
Draft
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
1 change: 1 addition & 0 deletions .devcontainer/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ volumes:

services:
mqtt-server:
image: ghcr.io/everest/everest-dev-environment/mosquitto:docker-images-v0.2.0
build: ../applications/containers/mosquitto
ports:
- 1883:1883
- 9001:9001
Expand All @@ -31,7 +31,7 @@ services:
- all
- ocpp
steve:
image: ghcr.io/everest/everest-dev-environment/steve:docker-images-v0.2.0
build: ../applications/containers/steve
ports:
- 8180:8180
- 8443:8443
Expand All @@ -41,7 +41,7 @@ services:
- all
- ocpp
mqtt-explorer:
image: ghcr.io/everest/everest-dev-environment/mqtt-explorer:docker-images-v0.2.0
build: ../applications/containers/mqtt-explorer
depends_on:
- mqtt-server
ports:
Expand All @@ -50,12 +50,11 @@ services:
- all
- sil
nodered:
image: ghcr.io/everest/everest-dev-environment/nodered:docker-images-v0.2.0
build: ../applications/containers/nodered
ports:
- 1880:1880
volumes:
- node-red-data:/data
- ./nodered-settings.js:/data/settings.js
environment:
- NODE_RED_ENABLE_PROJECTS=false
- MQTT_BROKER=mqtt-server
Expand Down
83 changes: 83 additions & 0 deletions .devcontainer/general-devcontainer/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# syntax=docker/dockerfile:1
FROM ghcr.io/everest/everest-ci/dev-env-base:v1.5.4

# Build arguments for customization
# User and group configuration i.e. to match host user inside the container
ARG USERNAME=docker
ARG USER_UID=1000
ARG USER_GID=1000
# Configuration for everest-dev-tool's default git settings, can be overridden when working i.e. in a fork
ARG EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION_ARG=EVerest
ARG EVEREST_DEV_TOOL_DEFAULT_GIT_HOST_ARG=github.com
ARG EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER_ARG=git

##################################################################
# Should be moved to everest-dev-base at some point

# Update the package list and install dependencies (run as root)
USER root
RUN apt-get update && apt-get install -y \

Check warning on line 19 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L19

Avoid additional packages by specifying `--no-install-recommends`

Check warning on line 19 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L19

Delete the apt-get lists after installing something

Check warning on line 19 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L19

Pin versions in apt get install. Instead of `apt-get install <package>` use `apt-get install <package>=<version>`
protobuf-compiler \
libsystemd-dev \
tmux \
chrpath \
cpio \
diffstat \
gawk \
wget \
zstd \
liblz4-tool \
file \
&& DEBIAN_FRONTEND=noninteractive apt-get install -y locales \
&& sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen \
&& dpkg-reconfigure --frontend=noninteractive locales \
&& update-locale LANG=en_US.UTF-8

ENV LANG en_US.UTF-8



# EVerest Development Tool - Dependencies
RUN pip install --break-system-packages \

Check warning on line 41 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L41

Pin versions in pip. Instead of `pip install <package>` use `pip install <package>==<version>` or `pip install --requirement <requirements file>`
nanopb

# EVerest Development Tool

COPY --from=everest_dev_tool_src . /tmp/everest_dev_tool

Check warning on line 46 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L46

`COPY --from` should reference a previously defined `FROM` alias
RUN ls -al /tmp/everest_dev_tool \
&& python3 -m pip install \
--break-system-packages \
/tmp/everest_dev_tool/ \
&& rm -rf /tmp/everest_dev_tool

##################################################################

# Modify the existing docker user and group to match the host's USER_UID and USER_GID
RUN groupmod --gid ${USER_GID} ${USERNAME} && \
usermod --uid ${USER_UID} --gid ${USER_GID} ${USERNAME} && \
usermod -aG dialout ${USERNAME}

# Switch to the docker user
USER ${USERNAME}
WORKDIR /workspace

# Add known hosts for git repositories
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan ${EVEREST_DEV_TOOL_DEFAULT_GIT_HOST_ARG} >> ~/.ssh/known_hosts

# Set environment variables
ENV EVEREST_DEV_TOOL_DEFAULT_GIT_METHOD=ssh
ENV EVEREST_DEV_TOOL_DEFAULT_GIT_HOST=${EVEREST_DEV_TOOL_DEFAULT_GIT_HOST_ARG}
ENV EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER=${EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER_ARG}
ENV EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION=${EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION_ARG}

# Enable command line completion for devrd script by default
RUN echo "" >> ${HOME}/.bashrc && \

Check warning on line 74 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L74

Double quote to prevent globbing and word splitting.
echo "# Enable devrd command completion if available" >> ${HOME}/.bashrc && \
echo "if [ -f /workspace/applications/devrd/devrd-completion.bash ]; then" >> ${HOME}/.bashrc && \
echo " source /workspace/applications/devrd/devrd-completion.bash" >> ${HOME}/.bashrc && \
echo "fi" >> ${HOME}/.bashrc

# Set up welcome message
RUN echo "echo \"🏔️ 🚘 Welcome to the EVerest development environment!\"" >> ${HOME}/.bashrc && \

Check warning on line 81 in .devcontainer/general-devcontainer/Dockerfile

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

.devcontainer/general-devcontainer/Dockerfile#L81

Double quote to prevent globbing and word splitting.
echo "echo \"Since you are working with the everest-core monorepo, you have all you need to get started here. 🎉🎉🎉\"" >> ${HOME}/.bashrc && \
echo "echo \"You can find the devrd tool in applications/devrd/devrd\"" >> ${HOME}/.bashrc
Original file line number Diff line number Diff line change
@@ -1,10 +1,25 @@
{
"name": "EVerest - ${localWorkspaceFolderBasename}",
"dockerComposeFile": ["../docker-compose.yml", "./docker-compose.devcontainer.yml"],

// Compose configuration
"dockerComposeFile": [
"../docker-compose.yml",
"./docker-compose.devcontainer.yml"
],
"service": "devcontainer",
"runServices": [ "mqtt-server", "ocpp-db", "steve", "mqtt-explorer" ],

"remoteUser": "docker",
// Workspace inside the container
"workspaceFolder": "/workspace",

"initializeCommand": "./applications/devrd/devrd env",

// Prevent generation of broken override compose files
"overrideFeatureInstallCommand": false,
"updateRemoteUserUID": false,

// Networking / forwarded ports
"remoteUser": "docker",
"forwardPorts": [
"mqtt-explorer:4000",
"steve:8180"
Expand All @@ -22,7 +37,12 @@
"protocol": "http",
"requireLocalPort": false
},

// VS Code customizations
"customizations": {

// Be aware that anything set here will not apply to the devcontainer
// when used without VS Code (e.g., plain Docker Compose).
"vscode": {
"settings": {
"terminal.integrated.profiles.linux": {
Expand All @@ -36,27 +56,26 @@
"python.pythonPath": "/usr/bin/python3",
"python.defaultInterpreterPath": "/usr/bin/python3",
"editor.rulers": [79, 120],
// RST/Sphinx language server
"esbonio.sphinx.buildDir": "${workspaceFolder}/everest/docs/_build",
"esbonio.sphinx.confDir": "${workspaceFolder}/everest/docs",

// RST
"restructuredtext.preview.scrollEditorWithPreview": false,
"restructuredtext.pythonRecommendation.disabled": true,
"liveServer.settings.root": "/everest/docs/_build/html"
"restructuredtext.pythonRecommendation.disabled": true
},

"extensions": [
// language support CPP
"ms-vscode.cpptools",

// language support cmake
"twxs.cmake",
"ms-vscode.cmake-tools",
// language support python
"ms-python.python",
// language support restructured text
"lextudio.restructuredtext",
"trond-snekvik.simple-rst",
// doc live server
"ritwickdey.liveserver"

// language support python
"ms-python.python",

// language support reStructuredText
"lextudio.restructuredtext",
"trond-snekvik.simple-rst"
]
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ volumes:

services:


docker-proxy:
image: tecnativa/docker-socket-proxy:latest
volumes:
Expand All @@ -34,15 +33,16 @@ services:
env_file:
- .env
build:
context: ./general-devcontainer
dockerfile: Dockerfile
context: ./general-devcontainer
additional_contexts:
everest_dev_tool_src: ../applications/everest_dev_tool
args:
USER_UID: ${UID:-1000}
USER_GID: ${GID:-1000}
ORGANIZATION_ARG: ${ORGANIZATION_ARG:-EVerest}
REPOSITORY_HOST: ${REPOSITORY_HOST:-github.com}
REPOSITORY_USER: ${REPOSITORY_USER:-git}
EVEREST_TOOL_BRANCH: ${EVEREST_TOOL_BRANCH:-main}
EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION_ARG: ${EVEREST_DEV_TOOL_DEFAULT_GIT_ORGANIZATION:-EVerest}
EVEREST_DEV_TOOL_DEFAULT_GIT_HOST_ARG: ${EVEREST_DEV_TOOL_DEFAULT_GIT_HOST:-github.com}
EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER_ARG: ${EVEREST_DEV_TOOL_DEFAULT_GIT_SSH_USER:-git}
volumes:
- type: bind
source: ${HOST_WORKSPACE_FOLDER:-..}
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
*build
*build-cross
*dist
.cache/
workspace.yaml
.vscode/
Expand Down
File renamed without changes.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ if(NOT DISABLE_EDM)
set(THIRD_PARTY_APP_DST "${CMAKE_INSTALL_LIBEXECDIR}/everest/3rd_party")

# edm
add_subdirectory(applications/dev-environment)
add_subdirectory(applications/)

evc_setup_edm()

Expand Down Expand Up @@ -195,7 +195,7 @@ add_subdirectory(config)
add_subdirectory(doc)

if(EVEREST_BUILD_APPLICATIONS)
add_subdirectory(applications)
# add_subdirectory(applications)
endif()

ev_install_project()
Expand Down
24 changes: 24 additions & 0 deletions applications/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1 +1,25 @@
ev_setup_cmake_variables_python_wheel()

ev_add_pip_package(
NAME edm
SOURCE_DIRECTORY dependency_manager
)

ev_is_python_venv_active(
RESULT_VAR IS_PYTHON_VENV_ACTIVE
)

if(NOT ${IS_PYTHON_VENV_ACTIVE})
message(WARNING "Python venv is not active. Please ensure that edm is available in your environment.")
else()
get_target_property(SOURCE_DIRECTORY ev_pip_package_edm SOURCE_DIRECTORY)
message(STATUS "Installing edm from: ${SOURCE_DIRECTORY}")
ev_pip_install_local(
PACKAGE_NAME "edm"
PACKAGE_SOURCE_DIRECTORY "${SOURCE_DIRECTORY}"
)
unset(EVEREST_DEPENDENCY_MANAGER CACHE)
find_program(EVEREST_DEPENDENCY_MANAGER edm HINTS ${EV_ACTIVATE_PYTHON_VENV_PATH_TO_VENV}/bin REQUIRED)
message(STATUS "Using edm from: ${EDM}")
endif()
add_subdirectory(pionix_chargebridge)
26 changes: 25 additions & 1 deletion applications/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,29 @@
This directory will contain applications that are used during the EVerest build process,
deployed to the target hardware and useful scripts for development.

_utils contains ev-cli and everest-testing as well as additional code integrated from everest-utils.
## containers/

containers/ contains multiple useful Dockerfile based containers that can be used for development.

Check notice on line 8 in applications/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

applications/README.md#L8

Expected: 80; Actual: 98

* `mosquittto` : An mqtt broker
* `mqtt-explorer` : Tool to inspect messages on mqtt topics
* `nodered` : NodeRED application to run i.e. sil flows
* `steve` : OCPP backend

## dependency_manager

Contains the EDM (EVerest Dependency Manager) tool which is a cli to
manage an EVerest workspace and external dependencies during building.

## everest_dev_tool

A CLI designed to provide helpful commands/aliases for developing.

## utils/

utils/ contains ev-cli and everest-testing as well as additional code integrated from everest-utils.

Check notice on line 26 in applications/README.md

View check run for this annotation

Codacy Production / Codacy Static Code Analysis

applications/README.md#L26

Expected: 80; Actual: 100
This might get broken up further in the future.

## devrd

Script to manage devcontainer + containerized services in the development environment
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ RUN npm install [email protected]
RUN npm install [email protected]
RUN npm install [email protected]

COPY nodered-settings.js /data/settings.js

USER root
COPY entrypoint.sh /entrypoint.sh
ARG TARGETARCH
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1337,7 +1337,7 @@ def release_handler(args):

metadata_yaml = {}
metadata_file = os.environ.get('EVEREST_METADATA_FILE', None)
metadata_url = "https://raw.githubusercontent.com/EVerest/everest-dev-environment/main/everest-metadata.yaml"
metadata_url = "https://raw.githubusercontent.com/EVerest/everest-core/main/everest-metadata.yaml"

if not metadata_file:
metadata_path = build_path / "everest-metadata.yaml"
Expand Down
Loading