From e9bc66f8aa26ef259313381aa611934e58c15ef2 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Wed, 18 Dec 2024 13:36:19 +0100 Subject: [PATCH 1/2] Add parameter to specify ev-cli version used in everest-docker-image Signed-off-by: Kai-Uwe Hermann --- docker/everest-docker-image/Dockerfile | 3 ++- docker/everest-docker-image/build.sh | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/docker/everest-docker-image/Dockerfile b/docker/everest-docker-image/Dockerfile index b981c002..81e1a79a 100644 --- a/docker/everest-docker-image/Dockerfile +++ b/docker/everest-docker-image/Dockerfile @@ -6,6 +6,7 @@ ARG BRANCH ARG EVEREST_CONFIG ARG OCPP_CONFIG ARG ADDITIONAL_CMAKE_PARAMETERS +ARG EV_CLI_VERSION RUN apt-get update \ && apt-get install --no-install-recommends -y \ @@ -49,7 +50,7 @@ ENV EVEREST_VENV=/workspace/everest/venv RUN python3 -m venv ${EVEREST_VENV} ENV PATH="${EVEREST_VENV}/bin:${PATH}" RUN git clone https://github.com/EVerest/everest-cmake.git -RUN git clone https://github.com/EVerest/everest-utils.git +RUN git clone https://github.com/EVerest/everest-utils.git -b ${EV_CLI_VERSION} WORKDIR /workspace/everest/everest-utils/ev-dev-tools RUN python3 -m pip install . WORKDIR /workspace/everest diff --git a/docker/everest-docker-image/build.sh b/docker/everest-docker-image/build.sh index d8b55c02..53499cd0 100755 --- a/docker/everest-docker-image/build.sh +++ b/docker/everest-docker-image/build.sh @@ -11,12 +11,14 @@ usage() { echo -e "\t--no-ssh: Do not append \"--ssh default\" to docker build - Optional" echo -e "\t--container-runtime: Set container runtime (e.g. docker or podman) for build - Optional" echo -e "\t--additional-cmake-parameters: Set additional cmake parameters for build - Optional, default \"-DEVEREST_BUILD_ALL_MODULES=ON\"" + echo -e "\t--ev-cli-version: Version of ev-cli to use - Optional, defaults to: main" exit 1 } ssh_param="--ssh=default" container_runtime="docker" additional_cmake_parameters="-DEVEREST_BUILD_ALL_MODULES=ON" +ev_cli_version="main" while [ ! -z "$1" ]; do if [ "$1" == "--repo" ]; then @@ -46,6 +48,9 @@ while [ ! -z "$1" ]; do elif [ "$1" == "--additional-cmake-parameters" ]; then additional_cmake_parameters="${2}" shift 2 + elif [ "$1" == "--ev-cli-version" ]; then + ev_cli_version="${2}" + shift 2 else usage break @@ -89,6 +94,7 @@ fi echo "Build date: ${NOW}" echo "Using container runtime \"${container_runtime}\" for building. Version: $(${container_runtime} --version)" echo "Additional CMake parameters for EVerest build: \"${additional_cmake_parameters}\"" +echo "ev-cli version: \"${ev_cli_version}\"" trap 'echo "Build not successful"; exit 1' ERR DOCKER_BUILDKIT=1 ${container_runtime} build \ --build-arg BUILD_DATE="${NOW}" \ @@ -97,5 +103,6 @@ DOCKER_BUILDKIT=1 ${container_runtime} build \ --build-arg OCPP_CONFIG="${ocpp_conf}" \ --build-arg BRANCH="${branch}" \ --build-arg ADDITIONAL_CMAKE_PARAMETERS="${additional_cmake_parameters}" \ + --build-arg EV_CLI_VERSION="${ev_cli_version}" \ -t "${name}" "${ssh_param}" . ${container_runtime} save "${name}":latest | gzip >"$name-${NOW}.tar.gz" From ad02de4c70841ffcdb2b3ab67c113b9a63369bf6 Mon Sep 17 00:00:00 2001 From: Kai-Uwe Hermann Date: Wed, 18 Dec 2024 13:36:53 +0100 Subject: [PATCH 2/2] Add parameter to skip installation of ev-cli in everest-docker-image This can be done automatically since EVerest 2024.9 Signed-off-by: Kai-Uwe Hermann --- docker/everest-docker-image/Dockerfile | 3 ++- docker/everest-docker-image/build.sh | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/docker/everest-docker-image/Dockerfile b/docker/everest-docker-image/Dockerfile index 81e1a79a..7e92bc45 100644 --- a/docker/everest-docker-image/Dockerfile +++ b/docker/everest-docker-image/Dockerfile @@ -7,6 +7,7 @@ ARG EVEREST_CONFIG ARG OCPP_CONFIG ARG ADDITIONAL_CMAKE_PARAMETERS ARG EV_CLI_VERSION +ARG INSTALL_EV_CLI RUN apt-get update \ && apt-get install --no-install-recommends -y \ @@ -52,7 +53,7 @@ ENV PATH="${EVEREST_VENV}/bin:${PATH}" RUN git clone https://github.com/EVerest/everest-cmake.git RUN git clone https://github.com/EVerest/everest-utils.git -b ${EV_CLI_VERSION} WORKDIR /workspace/everest/everest-utils/ev-dev-tools -RUN python3 -m pip install . +RUN if [ "${INSTALL_EV_CLI}" = "install_ev_cli" ] ; then python3 -m pip install . ; fi WORKDIR /workspace/everest RUN git clone https://github.com/EVerest/everest-dev-environment.git WORKDIR /workspace/everest/everest-dev-environment/dependency_manager diff --git a/docker/everest-docker-image/build.sh b/docker/everest-docker-image/build.sh index 53499cd0..187640ed 100755 --- a/docker/everest-docker-image/build.sh +++ b/docker/everest-docker-image/build.sh @@ -12,6 +12,7 @@ usage() { echo -e "\t--container-runtime: Set container runtime (e.g. docker or podman) for build - Optional" echo -e "\t--additional-cmake-parameters: Set additional cmake parameters for build - Optional, default \"-DEVEREST_BUILD_ALL_MODULES=ON\"" echo -e "\t--ev-cli-version: Version of ev-cli to use - Optional, defaults to: main" + echo -e "\t--no-ev-cli: Do not install specific ev-cli version, since EVerest 2024.9 this can be done automatically - Optional" exit 1 } @@ -19,6 +20,7 @@ ssh_param="--ssh=default" container_runtime="docker" additional_cmake_parameters="-DEVEREST_BUILD_ALL_MODULES=ON" ev_cli_version="main" +install_ev_cli="install_ev_cli" while [ ! -z "$1" ]; do if [ "$1" == "--repo" ]; then @@ -51,6 +53,9 @@ while [ ! -z "$1" ]; do elif [ "$1" == "--ev-cli-version" ]; then ev_cli_version="${2}" shift 2 + elif [ "$1" == "--no-ev-cli" ]; then + install_ev_cli="do_not_install_ev_cli" + shift 1 else usage break @@ -104,5 +109,6 @@ DOCKER_BUILDKIT=1 ${container_runtime} build \ --build-arg BRANCH="${branch}" \ --build-arg ADDITIONAL_CMAKE_PARAMETERS="${additional_cmake_parameters}" \ --build-arg EV_CLI_VERSION="${ev_cli_version}" \ + --build-arg INSTALL_EV_CLI="${install_ev_cli}" \ -t "${name}" "${ssh_param}" . ${container_runtime} save "${name}":latest | gzip >"$name-${NOW}.tar.gz"