-
Notifications
You must be signed in to change notification settings - Fork 122
Feature/eebus rebased #1561
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
base: main
Are you sure you want to change the base?
Feature/eebus rebased #1561
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -13,3 +13,86 @@ | |
|
|
||
| # FIXME(kai): Install libsystemd-dev as a dependency of sdbus-c++ | ||
| RUN apt-get update && apt-get -y install libsystemd-dev | ||
| ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache | ||
| ENV EVEREST_CMAKE_PATH=/usr/lib/cmake/everest-cmake | ||
| ENV EVEREST_CMAKE_VERSION=tmp/eebus | ||
| RUN rm -rf ${EVEREST_CMAKE_PATH} \ | ||
| && git clone https://github.com/EVerest/everest-cmake.git ${EVEREST_CMAKE_PATH} \ | ||
| && cd ${EVEREST_CMAKE_PATH} \ | ||
| && git checkout ${EVEREST_CMAKE_VERSION} \ | ||
| && rm -r .git | ||
|
|
||
| ARG GO_VERSION=1.24.2 | ||
| ADD https://go.dev/dl/go${GO_VERSION}.linux-amd64.tar.gz /tmp/go.tar.gz | ||
| RUN if [ -d /usr/local/go ]; then \ | ||
| echo "Go is already installed"; \ | ||
| else \ | ||
| tar -C /usr/local -xzf /tmp/go.tar.gz; \ | ||
| fi | ||
| ENV PATH="/usr/local/go/bin:${PATH}" | ||
| RUN go version | ||
|
|
||
| ENV GRPC_VERSION=v1.71.0 | ||
| ENV GRPC_EXTENDED_CPP_PLUGIN_VERSION=main | ||
| RUN tmpdir=$(mktemp -d) \ | ||
|
Check warning on line 37 in .ci/build-kit/docker/Dockerfile
|
||
| && cd $tmpdir \ | ||
| && git clone --depth 1 --recurse-submodules --shallow-submodules --branch ${GRPC_VERSION} https://github.com/grpc/grpc.git \ | ||
| && git clone --branch ${GRPC_EXTENDED_CPP_PLUGIN_VERSION} https://github.com/EVerest/grpc-extended-cpp-plugin.git \ | ||
| && cmake -B build -S grpc-extended-cpp-plugin -G Ninja -D gRPC_INSTALL=ON \ | ||
| && cmake --build build \ | ||
| && cmake --install build \ | ||
| && rm -rf $tmpdir | ||
|
|
||
| RUN apt update \ | ||
| && apt install -y \ | ||
| build-essential \ | ||
| zlib1g-dev \ | ||
| libncurses5-dev \ | ||
| libgdbm-dev \ | ||
| libnss3-dev \ | ||
| libssl-dev \ | ||
| libreadline-dev \ | ||
| libffi-dev \ | ||
| libsqlite3-dev \ | ||
| wget | ||
| ENV PYTHON_VERSION=3.13.3 | ||
| ENV PYTHON_SOURCE_URL=https://www.python.org/ftp/python/${PYTHON_VERSION}/Python-${PYTHON_VERSION}.tgz | ||
| RUN tmpdir=$(mktemp -d) \ | ||
| && cd $tmpdir \ | ||
| && wget ${PYTHON_SOURCE_URL} \ | ||
| && tar -xzvf Python-${PYTHON_VERSION}.tgz \ | ||
| && cd Python-${PYTHON_VERSION} \ | ||
| && ./configure --enable-optimizations \ | ||
| && make -j $(nproc) \ | ||
| && make install \ | ||
| && short_version=$(echo ${PYTHON_VERSION} | cut -d. -f1-2) \ | ||
| && rm /usr/local/bin/python3 \ | ||
| && ln -s /usr/local/bin/python${short_version} /usr/local/bin/python3 | ||
|
|
||
| RUN python3.13 -m pip install --break-system-packages \ | ||
|
Check warning on line 72 in .ci/build-kit/docker/Dockerfile
|
||
| grpcio \ | ||
| grpcio-tools \ | ||
| pydantic \ | ||
| cryptography \ | ||
| netifaces \ | ||
| psutil \ | ||
| environs \ | ||
| py4j \ | ||
| aiofile \ | ||
| build \ | ||
| sphinx \ | ||
| gcovr \ | ||
| sphinxcontrib-contentui \ | ||
| sphinxcontrib-svg2pdfconverter \ | ||
| git+https://github.com/EVerest/[email protected]#subdirectory=dependency_manager | ||
|
|
||
|
|
||
| # Can be used to use an other version of everest-cmake | ||
| ADD "https://www.random.org/cgi-bin/randbyte?nbytes=10&format=h" skipcache | ||
| ENV EVEREST_CMAKE_PATH=/usr/lib/cmake/everest-cmake | ||
| ENV EVEREST_CMAKE_VERSION=tmp/eebus | ||
| RUN rm -rf ${EVEREST_CMAKE_PATH} \ | ||
| && git clone https://github.com/EVerest/everest-cmake.git ${EVEREST_CMAKE_PATH} \ | ||
| && cd ${EVEREST_CMAKE_PATH} \ | ||
| && git checkout ${EVEREST_CMAKE_VERSION} \ | ||
| && rm -r .git | ||
|
Comment on lines
+90
to
+98
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is duplicated |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,7 +8,7 @@ if [ $retVal -ne 0 ]; then | |
| exit $retVal | ||
| fi | ||
|
|
||
| pip install --break-system-packages \ | ||
| python3 -m pip install --break-system-packages \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be in a dedicated PR "Improce CI scripts" or so, but not required from my side |
||
| "$EXT_MOUNT"/wheels/everestpy-*.whl \ | ||
| "$EXT_MOUNT"/wheels/everest_testing-*.whl \ | ||
| "$EXT_MOUNT"/wheels/iso15118-*.whl \ | ||
|
|
@@ -20,6 +20,6 @@ if [ $retVal -ne 0 ]; then | |
| exit $retVal | ||
| fi | ||
|
|
||
| pip install --break-system-packages -r tests/ocpp_tests/requirements.txt | ||
| python3 -m pip install --break-system-packages -r tests/ocpp_tests/requirements.txt | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be in a dedicated PR "Improce CI scripts" or so, but not required from my side |
||
|
|
||
| $(cd ./tests/ocpp_tests/test_sets/everest-aux/ && ./install_certs.sh "$EXT_MOUNT/dist" && ./install_configs.sh "$EXT_MOUNT/dist") | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,13 +1,14 @@ | ||
| #!/bin/sh | ||
|
|
||
| cd tests | ||
| pytest \ | ||
| python3 -m pytest \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be in a dedicated PR "Improce CI scripts" or so, but not required from my side |
||
| -rA \ | ||
| --junitxml="$EXT_MOUNT/result.xml" \ | ||
| --html="$EXT_MOUNT/report.html" \ | ||
| --self-contained-html \ | ||
| core_tests/*.py \ | ||
| framework_tests/*.py \ | ||
| eebus_tests/*.py \ | ||
| --everest-prefix "$EXT_MOUNT/dist" | ||
| retVal=$? | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,7 +6,7 @@ PARALLEL_TESTS=$(nproc) | |
|
|
||
| echo "Running $PARALLEL_TESTS ocpp tests in parallel" | ||
|
|
||
| pytest \ | ||
| python3 -m pytest \ | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could be in a dedicated PR "Improce CI scripts" or so, but not required from my side |
||
| -rA \ | ||
| -n "$PARALLEL_TESTS" \ | ||
| --dist=loadgroup \ | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ on: | |
| jobs: | ||
| ci: | ||
| name: Build, Lint and Test | ||
| uses: everest/everest-ci/.github/workflows/continuous_integration.yml@v1.4.6 | ||
| uses: everest/everest-ci/.github/workflows/continuous_integration.yml@feature/eebus | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be updated to a proper tag before merging |
||
| permissions: | ||
| contents: read | ||
| secrets: | ||
|
|
@@ -30,6 +30,7 @@ jobs: | |
| do_not_run_coverage_badge_creation: true | ||
| run_install_wheels: true | ||
| run_integration_tests: true | ||
| build_kit_base_image_tag: feature-eebus | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be updated to a proper tag before merging |
||
| ocpp-tests: | ||
| name: OCPP Tests | ||
| needs: | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,12 +6,12 @@ project(everest-core | |
| LANGUAGES CXX C | ||
| ) | ||
|
|
||
| find_package(everest-cmake 0.5 | ||
| find_package(everest-cmake 0.6 | ||
| COMPONENTS bundling | ||
| PATHS ../everest-cmake | ||
| NO_DEFAULT_PATH | ||
| ) | ||
| find_package(everest-cmake 0.5 | ||
| find_package(everest-cmake 0.6 | ||
| COMPONENTS bundling | ||
| ) | ||
|
|
||
|
|
@@ -21,7 +21,7 @@ if (NOT everest-cmake_FOUND) | |
| FetchContent_Declare( | ||
| everest-cmake | ||
| GIT_REPOSITORY https://github.com/EVerest/everest-cmake.git | ||
| GIT_TAG main | ||
| GIT_TAG v0.6.0 | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should be main, since this is a feature for convenience "auto downloading latest everest-cmake" |
||
| ) | ||
| FetchContent_MakeAvailable(everest-cmake) | ||
| set(everest-cmake_DIR "${everest-cmake_SOURCE_DIR}") | ||
|
|
@@ -65,6 +65,7 @@ option(CREATE_SYMLINKS "Create symlinks to javascript modules and auxillary file | |
| option(CMAKE_RUN_CLANG_TIDY "Run clang-tidy" OFF) | ||
| option(EVEREST_BUILD_API_DOCS "Build EVerest API documentation" OFF) | ||
| option(ISO15118_2_GENERATE_AND_INSTALL_CERTIFICATES "Automatically generate and install certificates for development purposes" ON) | ||
| option(EEBUS_GENERATE_AND_INSTALL_CERTIFICATES "Automatically generate and install certificates for development purposes" ON) | ||
| option(EVEREST_ENABLE_RUN_SCRIPT_GENERATION "Enables the generation of run scripts (convenience scripts for starting available configurations)" ON) | ||
| option(${PROJECT_NAME}_BUILD_TESTING "Build unit tests, used if included as dependency" OFF) | ||
| option(BUILD_TESTING "Build unit tests, used if standalone project" OFF) | ||
|
|
@@ -124,6 +125,10 @@ if(NOT DISABLE_EDM) | |
| # FIXME (aw): this implicit definition for child projects is hacky | ||
| set(THIRD_PARTY_APP_DST "${CMAKE_INSTALL_LIBEXECDIR}/everest/3rd_party") | ||
|
|
||
| if(GRPC_EDM) | ||
| enable_language(ASM) | ||
| endif() | ||
|
|
||
| evc_setup_edm() | ||
|
|
||
| # FIXME (aw): we need to set this by hand due to edm | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,132 @@ | ||
| include_guard(GLOBAL) | ||
|
|
||
| if (NOT CPM_PACKAGE_eebus-grpc_SOURCE_DIR) | ||
| message(FATAL_ERROR "CPM_PACKAGE_eebus-grpc_SOURCE_DIR not set") | ||
| endif() | ||
|
|
||
| set(EEBUS_GRPC_API_SOURCE_DIR ${CPM_PACKAGE_eebus-grpc_SOURCE_DIR}) | ||
| set(EEBUS_GRPC_API_BINARY_DIR ${CMAKE_BINARY_DIR}/eebus-grpc) | ||
|
|
||
| file(GLOB_RECURSE EEBUS_GRPC_API_SOURCE_FILES | ||
| CONFIGURE_DEPENDS | ||
| ${EEBUS_GRPC_API_SOURCE_DIR}/* | ||
| ) | ||
|
|
||
| setup_go() | ||
| add_go_target( | ||
| NAME | ||
| eebus_grpc_api_cmd | ||
| OUTPUT | ||
| ${EEBUS_GRPC_API_BINARY_DIR}/cmd | ||
| GO_PACKAGE_SOURCE_PATH | ||
| ${EEBUS_GRPC_API_SOURCE_DIR}/cmd | ||
| OUTPUT_DIRECTORY | ||
| ${EEBUS_GRPC_API_BINARY_DIR} | ||
| WORKING_DIRECTORY | ||
| ${EEBUS_GRPC_API_SOURCE_DIR} | ||
| DEPENDS | ||
| ${EEBUS_GRPC_API_SOURCE_FILES} | ||
| ) | ||
|
|
||
| add_go_target( | ||
| NAME | ||
| eebus_grpc_api_create_cert | ||
| OUTPUT | ||
| ${EEBUS_GRPC_API_BINARY_DIR}/create_cert | ||
| GO_PACKAGE_SOURCE_PATH | ||
| ${EEBUS_GRPC_API_SOURCE_DIR}/cmd/create_cert | ||
| OUTPUT_DIRECTORY | ||
| ${EEBUS_GRPC_API_BINARY_DIR} | ||
| WORKING_DIRECTORY | ||
| ${EEBUS_GRPC_API_SOURCE_DIR} | ||
| DEPENDS | ||
| ${EEBUS_GRPC_API_SOURCE_FILES} | ||
| ) | ||
|
|
||
| add_custom_target(eebus_grpc_api_all | ||
| DEPENDS | ||
| eebus_grpc_api_cmd | ||
| eebus_grpc_api_create_cert | ||
| ) | ||
|
|
||
| install( | ||
| FILES | ||
| ${EEBUS_GRPC_API_BINARY_DIR}/cmd | ||
| DESTINATION | ||
| ${CMAKE_INSTALL_PREFIX}/bin | ||
| RENAME | ||
| eebus_grpc_api | ||
| PERMISSIONS | ||
| OWNER_EXECUTE OWNER_WRITE OWNER_READ | ||
| GROUP_EXECUTE GROUP_READ | ||
| WORLD_EXECUTE WORLD_READ | ||
| ) | ||
|
|
||
| # This function creates certificates for an EEBus component | ||
| # | ||
| # It will generate thre files: | ||
| # - <OUT_DIR>/<NAME>_cert | ||
| # - <OUT_DIR>/<NAME>_key | ||
| # - <OUT_DIR>/<NAME>_ski | ||
| # The generation can be triggered by calling the target <TARGET_NAME> | ||
| # | ||
| function(eebus_create_cert) | ||
| set(options) | ||
| set(one_value_args | ||
| NAME | ||
| OUT_DIR | ||
| TARGET_NAME | ||
| OUT_FILES_VAR | ||
| ) | ||
| set(multi_value_args) | ||
| cmake_parse_arguments(arg "${options}" "${one_value_args}" "${multi_value_args}" ${ARGN}) | ||
|
|
||
| if (arg_UNPARSED_ARGUMENTS) | ||
| message(FATAL_ERROR "Unparsed arguments: ${arg_UNPARSED_ARGUMENTS}") | ||
| endif() | ||
| if (arg_KEYWORDS_MISSING_VALUES) | ||
| message(FATAL_ERROR "Keywords missing values: ${arg_KEYWORDS_MISSING_VALUES}") | ||
| endif() | ||
| if (NOT arg_NAME) | ||
| message(FATAL_ERROR "NAME not set") | ||
| endif() | ||
| if (NOT arg_OUT_DIR) | ||
| message(FATAL_ERROR "OUT_DIR not set") | ||
| endif() | ||
| if (NOT IS_ABSOLUTE ${arg_OUT_DIR}) | ||
| message(FATAL_ERROR "OUT_DIR ${arg_OUT_DIR} is not an absolute path") | ||
| endif() | ||
| if (NOT arg_TARGET_NAME) | ||
| message(FATAL_ERROR "TARGET_NAME not set") | ||
| endif() | ||
|
|
||
| get_target_property(CREATE_CERT_BINARY_FILE eebus_grpc_api_create_cert TARGET_FILE) | ||
| set(OUT_FILES | ||
| ${arg_OUT_DIR}/${arg_NAME}_cert | ||
| ${arg_OUT_DIR}/${arg_NAME}_key | ||
| ${arg_OUT_DIR}/${arg_NAME}_ski | ||
| ) | ||
| add_custom_command( | ||
| OUTPUT | ||
| ${OUT_FILES} | ||
| COMMAND | ||
| mkdir -p ${arg_OUT_DIR} | ||
| COMMAND | ||
| ${CREATE_CERT_BINARY_FILE} | ||
| ARGS | ||
| ${arg_OUT_DIR} | ||
| ${arg_NAME} | ||
| DEPENDS | ||
| eebus_grpc_api_create_cert | ||
| COMMENT | ||
| "Creating ${arg_NAME} certificates" | ||
| ) | ||
| add_custom_target(${arg_TARGET_NAME} | ||
| DEPENDS | ||
| ${OUT_FILES} | ||
| ) | ||
|
|
||
| if (arg_OUT_FILES_VAR) | ||
| set(${arg_OUT_FILES_VAR} ${OUT_FILES} PARENT_SCOPE) | ||
| endif() | ||
| endfunction() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would be good to move most of it in the
ghcr.io/everest/everest-ci/build-env-baseimage before merging,Which means opening a PR in everest-ci, merge it, tag a new version/release, use this tag in the ci workflow