├── .devcontainer ├── Dockerfile ├── devcontainer.json ├── scripts │ ├── configure-codespaces.sh │ ├── configure-proxies.sh │ ├── container-set.sh │ ├── onCreateCommand.sh │ ├── postStartCommand.sh │ ├── setup-dependencies.sh │ ├── setup-git.sh │ └── upgrade-cli.sh └── tests │ └── automated_tests │ ├── requirements.txt │ ├── requirements_test.py │ └── runtime_test.py ├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.yml │ ├── feature-request.yml │ └── question.yml ├── PULL_REQUEST_TEMPLATE.md ├── dependabot.yml ├── scripts │ ├── deploy_image_from_artifact.sh │ └── junit.tpl └── workflows │ ├── build-docker-image.yml │ ├── build-multiarch-image.yml │ ├── check-devcontainer.yml │ ├── check-licenses.yml │ ├── check-updates.yml │ ├── ci.yml │ ├── ensure-lifecycle.yml │ ├── gen-desired-state.yml │ └── release.yml ├── .gitignore ├── .licensechecker.yml ├── .ort.yml ├── .pre-commit-config.yaml ├── .velocitas-lock.json ├── .velocitas.json ├── .vscode ├── launch.json ├── scripts │ └── import-example-app.sh ├── settings.json └── tasks.json ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── NOTICE-3RD-PARTY-CONTENT.md ├── NOTICE.md ├── README.md ├── SECURITY.md ├── app ├── AppManifest.json ├── Dockerfile ├── requirements-links.txt ├── requirements.in ├── requirements.txt ├── src │ └── main.py └── tests │ ├── integration │ └── integration_test.py │ ├── requirements.in │ ├── requirements.txt │ └── unit │ └── test_run.py ├── license_header.txt ├── requirements.in ├── requirements.txt ├── setup.cfg └── whitelisted-licenses.txt /.devcontainer/Dockerfile: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 17 | 18 | ENV DOCKER_BUILDKIT=1 19 | 20 | COPY scripts/*.sh /tmp/scripts/ 21 | RUN find /tmp/scripts/ -type f -iname "*.sh" -exec chmod +x {} \; 22 | RUN /bin/bash /tmp/scripts/container-set.sh 23 | RUN /bin/bash /tmp/scripts/configure-proxies.sh 24 | -------------------------------------------------------------------------------- /.devcontainer/devcontainer.json: -------------------------------------------------------------------------------- 1 | // This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | { 3 | "name": "Python vehicle app", 4 | "build": { 5 | "dockerfile": "Dockerfile" 6 | }, 7 | "runArgs": [ 8 | "--init", 9 | "--privileged" 10 | ], 11 | "containerEnv": { 12 | "GITHUB_API_TOKEN": "${localEnv:GITHUB_API_TOKEN}", 13 | "GIT_CONFIG_NAME": "${localEnv:GIT_CONFIG_NAME}", 14 | "GIT_CONFIG_EMAIL": "${localEnv:GIT_CONFIG_EMAIL}" 15 | }, 16 | "customizations": { 17 | "vscode": { 18 | // Set *default* container specific settings.json values on container create. 19 | "settings": { 20 | "python.defaultInterpreterPath": "/usr/bin/python3", 21 | "python.analysis.typeCheckingMode": "basic", 22 | // Strong Type Checker 23 | "mypy.enabled": true, 24 | "mypy.runUsingActiveInterpreter": true, 25 | "mypy.targets": [ 26 | "app" 27 | ], 28 | "python.analysis.extraPaths": [ 29 | "./proto", 30 | "./src/vehicle_model" 31 | ], 32 | "python.testing.unittestEnabled": false, 33 | "python.testing.pytestEnabled": true, 34 | "[python]": { 35 | "editor.formatOnSave": true, 36 | "editor.codeActionsOnSave": { 37 | "source.fixAll": true, 38 | "source.organizeImports": true 39 | }, 40 | "editor.defaultFormatter": "charliermarsh.ruff" 41 | }, 42 | "terminal.integrated.defaultProfile.linux": "zsh", 43 | "terminal.integrated.profiles.linux": { 44 | "zsh": { 45 | "path": "/usr/bin/zsh" 46 | } 47 | }, 48 | "vsmqtt.brokerProfiles": [ 49 | { 50 | "name": "mosquitto", 51 | "host": "localhost", 52 | "port": 1883, 53 | "clientId": "vsmqtt_client" 54 | } 55 | ] 56 | }, 57 | // Add the IDs of extensions you want installed when the container is created. 58 | "extensions": [ 59 | "dbaeumer.vscode-eslint", 60 | "ms-azuretools.vscode-docker", 61 | "ms-python.python", 62 | "cschleiden.vscode-github-actions", 63 | "rpdswtk.vsmqtt", 64 | "dotjoshjohnson.xml", 65 | "matangover.mypy", 66 | "augustocdias.tasks-shell-input", 67 | "ms-python.mypy-type-checker", 68 | "charliermarsh.ruff" 69 | ] 70 | } 71 | }, 72 | "onCreateCommand": "bash .devcontainer/scripts/onCreateCommand.sh", 73 | "postStartCommand": "bash .devcontainer/scripts/postStartCommand.sh", 74 | // Comment out connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. 75 | "remoteUser": "vscode" 76 | } 77 | -------------------------------------------------------------------------------- /.devcontainer/scripts/configure-codespaces.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | if [ "${CODESPACES}" = "true" ]; then 18 | echo "#######################################################" 19 | echo "### Setup Access to Codespaces ###" 20 | echo "#######################################################" 21 | 22 | # restart Docker connection if in Codespaces 23 | # Workaround according to https://github.com/devcontainers/features/issues/671#issuecomment-1701754897 24 | sudo pkill dockerd && sudo pkill containerd 25 | /usr/local/share/docker-init.sh 26 | 27 | # Remove the default credential helper 28 | sudo sed -i -E 's/helper =.*//' /etc/gitconfig 29 | 30 | # Add one that just uses secrets available in the Codespace 31 | git config --global credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${MY_GH_TOKEN}"; }; f' 32 | fi 33 | -------------------------------------------------------------------------------- /.devcontainer/scripts/configure-proxies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | echo "#######################################################" 18 | echo "### Configure-proxies ###" 19 | echo "#######################################################" 20 | 21 | if [ "$HTTP_PROXY" != "" ]; then 22 | USE_PROXIES="true" 23 | CONFIGURE_GIT="true" 24 | FTP_PROXY=$HTTP_PROXY 25 | ALL_PROXY=$HTTP_PROXY 26 | NO_PROXY="localhost,127.0.0.1,0.0.0.0,10.0.0.0/8,192.168.122.0/24,172.0.0.0/8,cattle-system.svc,.svc,.cluster.local" 27 | fi 28 | 29 | echo "Use proxies: $USE_PROXIES" 30 | echo "Http-proxy: $HTTP_PROXY" 31 | echo "Https-proxy: $HTTPS_PROXY" 32 | echo "Ftp-proxy: $FTP_PROXY" 33 | echo "All proxy: $ALL_PROXY" 34 | echo "No proxy: $NO_PROXY" 35 | echo "Configure git: $CONFIGURE_GIT" 36 | 37 | set -e 38 | 39 | if [ "$(id -u)" -ne 0 ]; then 40 | echo -e 'Script must be run as root. Use sudo, su, or add "USER root" to your Dockerfile before running this script.' 41 | exit 1 42 | fi 43 | 44 | # Determine the appropriate non-root user 45 | # This recognizes the same possible user names found in Microsoft base Docker images 46 | # as the scripts in the ../library-scripts directory 47 | if [ "${USERNAME}" = "auto" ] || [ "${USERNAME}" = "automatic" ]; then 48 | USERNAME="" 49 | POSSIBLE_USERS=("vscode" "node" "codespace" "$(awk -v val=1000 -F ":" '$3==val{print $1}' /etc/passwd)") 50 | for CURRENT_USER in ${POSSIBLE_USERS[@]}; do 51 | if id -u ${CURRENT_USER} > /dev/null 2>&1; then 52 | USERNAME=${CURRENT_USER} 53 | break 54 | fi 55 | done 56 | elif [ "${USERNAME}" = "none" ] || ! id -u ${USERNAME} > /dev/null 2>&1; then 57 | USERNAME=root 58 | fi 59 | 60 | if [ "${USERNAME}" = "" ]; then 61 | USERNAME=vscode 62 | fi 63 | echo "Selected user name is ${USERNAME}" 64 | 65 | if [ "${USE_PROXIES}" = "true" ]; then 66 | echo "Configuring proxies" 67 | 68 | mkdir -p /home/${USERNAME} 69 | echo "export HTTP_PROXY=\"${HTTP_PROXY}\"" >> /home/${USERNAME}/.profile 70 | echo "export http_proxy=\"${HTTP_PROXY}\"" >> /home/${USERNAME}/.profile 71 | echo "export HTTPS_PROXY=\"${HTTPS_PROXY}\"" >> /home/${USERNAME}/.profile 72 | echo "export https_proxy=\"${HTTPS_PROXY}\"" >> /home/${USERNAME}/.profile 73 | echo "export FTP_PROXY=\"${FTP_PROXY}\"" >> /home/${USERNAME}/.profile 74 | echo "export ftp_proxy=\"${FTP_PROXY}\"" >> /home/${USERNAME}/.profile 75 | echo "export ALL_PROXY=\"${ALL_PROXY}\"" >> /home/${USERNAME}/.profile 76 | echo "export all_proxy=\"${ALL_PROXY}\"" >> /home/${USERNAME}/.profile 77 | echo "export NO_PROXY=\"${NO_PROXY}\"" >> /home/${USERNAME}/.profile 78 | echo "export no_proxy=\"${NO_PROXY}\"" >> /home/${USERNAME}/.profile 79 | 80 | # # Apply common tools proxy settings for installed tools 81 | if [ "${CONFIGURE_GIT}" = "true" ]; then 82 | su -c "git config --global http.proxy ${HTTP_PROXY}" ${USERNAME} 83 | su -c "git config --global https.proxy ${HTTPS_PROXY}" ${USERNAME} 84 | git config --global http.proxy ${HTTP_PROXY} 85 | git config --global https.proxy ${HTTPS_PROXY} 86 | fi 87 | 88 | echo "# Proxy settings" >> /etc/wgetrc 89 | echo "http_proxy=${HTTP_PROXY}" >> /etc/wgetrc 90 | echo "https_proxy=${HTTPS_PROXY}" >> /etc/wgetrc 91 | echo "ftp_proxy=${FTP_PROXY}" >> /etc/wgetrc 92 | echo "no_proxy=${NO_PROXY}" >> /etc/wgetrc 93 | echo "use_proxy=on" >> /etc/wgetrc 94 | 95 | # enable root user to "apt-get" via proxy 96 | echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf 97 | echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf 98 | fi 99 | 100 | exit 0 101 | -------------------------------------------------------------------------------- /.devcontainer/scripts/container-set.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | echo "#######################################################" 18 | echo "### Checking container creation ###" 19 | echo "#######################################################" 20 | useradd vscode --password vscode -m 21 | usermod -aG sudo vscode 22 | -------------------------------------------------------------------------------- /.devcontainer/scripts/onCreateCommand.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | sudo chmod +x .devcontainer/scripts/*.sh 18 | 19 | .devcontainer/scripts/setup-git.sh 20 | 21 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then 22 | .devcontainer/scripts/configure-codespaces.sh 23 | .devcontainer/scripts/upgrade-cli.sh 24 | fi 25 | 26 | # Call user initialization hook if present 27 | ON_CREATE_USER_HOOK_PATH=.devcontainer/scripts/onCreateUserHook.sh 28 | if [[ -x $ON_CREATE_USER_HOOK_PATH ]]; then 29 | $ON_CREATE_USER_HOOK_PATH 30 | fi 31 | 32 | echo "#######################################################" 33 | echo "### Run VADF Lifecycle Management ###" 34 | echo "#######################################################" 35 | velocitas init 36 | velocitas sync 37 | 38 | # Some setup might be required even in offline mode 39 | .devcontainer/scripts/setup-dependencies.sh 40 | 41 | echo "#######################################################" 42 | echo "### VADF package status ###" 43 | echo "#######################################################" 44 | velocitas upgrade --dry-run --ignore-bounds 45 | 46 | # Don't let container creation fail if lifecycle management fails 47 | echo "Done!" 48 | -------------------------------------------------------------------------------- /.devcontainer/scripts/postStartCommand.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then 18 | .devcontainer/scripts/upgrade-cli.sh 19 | fi 20 | 21 | # Call user initialization hook if present 22 | POST_START_USER_HOOK_PATH=.devcontainer/scripts/onPostStartUserHook.sh 23 | if [[ -x $POST_START_USER_HOOK_PATH ]]; then 24 | $POST_START_USER_HOOK_PATH 25 | fi 26 | -------------------------------------------------------------------------------- /.devcontainer/scripts/setup-dependencies.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | if [[ -z "${VELOCITAS_OFFLINE}" ]]; then 18 | echo "#######################################################" 19 | echo "### Install python requirements ###" 20 | echo "#######################################################" 21 | # Update pip before installing requirements 22 | pip3 install --upgrade pip 23 | REQUIREMENTS="./requirements.txt" 24 | if [ -f $REQUIREMENTS ]; then 25 | pip3 install -r $REQUIREMENTS 26 | fi 27 | REQUIREMENTS="./app/requirements-links.txt" 28 | if [ -f $REQUIREMENTS ]; then 29 | pip3 install -r $REQUIREMENTS 30 | fi 31 | # Dependencies for the app 32 | REQUIREMENTS="./app/requirements.txt" 33 | if [ -f $REQUIREMENTS ]; then 34 | pip3 install -r $REQUIREMENTS 35 | fi 36 | 37 | # Dependencies for unit and integration tests 38 | REQUIREMENTS="./app/tests/requirements.txt" 39 | if [ -f $REQUIREMENTS ]; then 40 | pip3 install -r $REQUIREMENTS 41 | fi 42 | fi 43 | -------------------------------------------------------------------------------- /.devcontainer/scripts/setup-git.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | echo "#######################################################" 18 | echo "### Setup Git ###" 19 | echo "#######################################################" 20 | # Add git name and email from env variables 21 | if [[ -n "${GIT_CONFIG_NAME}" && -n "${GIT_CONFIG_EMAIL}" ]]; then 22 | git config --global user.name $GIT_CONFIG_NAME 23 | git config --global user.email $GIT_CONFIG_EMAIL 24 | fi 25 | 26 | git config --global --add safe.directory "*" 27 | -------------------------------------------------------------------------------- /.devcontainer/scripts/upgrade-cli.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | echo "#######################################################" 18 | echo "### Auto-upgrade CLI ###" 19 | echo "#######################################################" 20 | 21 | ROOT_DIRECTORY=$( realpath "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/../.." ) 22 | DESIRED_VERSION=$(cat $ROOT_DIRECTORY/.velocitas.json | jq .cliVersion | tr -d '"') 23 | 24 | # Get installed CLI version 25 | INSTALLED_VERSION=v$(velocitas --version | sed -E 's/velocitas-cli\/(\w+.\w+.\w+).*/\1/') 26 | 27 | if [ "$DESIRED_VERSION" = "$INSTALLED_VERSION" ]; then 28 | echo "> Already up to date!" 29 | exit 0 30 | else 31 | echo "> Checking upgrade to $DESIRED_VERSION" 32 | fi 33 | 34 | AUTHORIZATION_HEADER="" 35 | if [ "${GITHUB_API_TOKEN}" != "" ]; then 36 | AUTHORIZATION_HEADER="-H \"Authorization: Bearer ${GITHUB_API_TOKEN}\"" 37 | fi 38 | 39 | if [ "$DESIRED_VERSION" = "latest" ]; then 40 | CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/latest 41 | else 42 | CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/tags/${DESIRED_VERSION} 43 | fi 44 | 45 | CLI_RELEASES=$(curl -s -L \ 46 | -H "Accept: application/vnd.github+json" \ 47 | -H "X-GitHub-Api-Version: 2022-11-28" \ 48 | ${AUTHORIZATION_HEADER} \ 49 | ${CLI_RELEASES_URL}) 50 | 51 | res=$? 52 | if test "$res" != "0"; then 53 | echo "the curl command failed with exit code: $res" 54 | exit 0 55 | fi 56 | 57 | DESIRED_VERSION_TAG=$(echo ${CLI_RELEASES} | jq -r .name) 58 | 59 | if [ "$DESIRED_VERSION_TAG" = "null" ] || [ "$DESIRED_VERSION_TAG" = "" ]; then 60 | echo "> Can't find desired Velocitas CLI version: $DESIRED_VERSION. Skipping Auto-Upgrade." 61 | exit 0 62 | fi 63 | 64 | if [ "$DESIRED_VERSION_TAG" != "$INSTALLED_VERSION" ]; then 65 | echo "> Upgrading CLI..." 66 | if [[ $(arch) == "aarch64" ]]; then 67 | CLI_ASSET_NAME=velocitas-linux-arm64 68 | else 69 | CLI_ASSET_NAME=velocitas-linux-x64 70 | fi 71 | CLI_INSTALL_PATH=/usr/bin/velocitas 72 | CLI_DOWNLOAD_URL="https://github.com/eclipse-velocitas/cli/releases/download/${DESIRED_VERSION_TAG}/${CLI_ASSET_NAME}" 73 | 74 | echo "> Downloading Velocitas CLI from ${CLI_DOWNLOAD_URL}" 75 | sudo curl -s -L ${CLI_DOWNLOAD_URL} -o "${CLI_INSTALL_PATH}" 76 | sudo chmod +x "${CLI_INSTALL_PATH}" 77 | else 78 | echo "> Up to date!" 79 | fi 80 | 81 | echo "> Using CLI: $(velocitas --version)" 82 | -------------------------------------------------------------------------------- /.devcontainer/tests/automated_tests/requirements.txt: -------------------------------------------------------------------------------- 1 | parameterized==0.9.0 2 | -------------------------------------------------------------------------------- /.devcontainer/tests/automated_tests/requirements_test.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | import unittest 16 | from pathlib import Path 17 | 18 | import pkg_resources 19 | from parameterized import parameterized 20 | 21 | 22 | class TestRequirements(unittest.TestCase): 23 | """Test availability of required packages.""" 24 | 25 | @parameterized.expand( 26 | ["./requirements.txt", "./app/requirements.txt", "./app/tests/requirements.txt"] 27 | ) 28 | def test_requirements(self, requirement_file_path): 29 | """Test that each required package is available.""" 30 | requirements = pkg_resources.parse_requirements( 31 | Path(requirement_file_path).open() 32 | ) 33 | for requirement in requirements: 34 | requirement = str(requirement) 35 | with self.subTest(requirement=requirement): 36 | pkg_resources.require(requirement) 37 | -------------------------------------------------------------------------------- /.devcontainer/tests/automated_tests/runtime_test.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | import os 16 | import subprocess # nosec 17 | import unittest 18 | 19 | from parameterized import parameterized 20 | 21 | devenv_runtimes_path = ( 22 | subprocess.check_output(["velocitas", "package", "-p", "devenv-runtimes"]) # nosec 23 | .decode("utf-8") 24 | .strip("\n") 25 | ) 26 | 27 | os.environ["VDB_PORT"] = "30555" 28 | os.environ["MQTT_PORT"] = "31883" 29 | 30 | 31 | class RuntimeTest(unittest.TestCase): 32 | @parameterized.expand(["runtime_kanto", "runtime_local"]) 33 | def test_runtime(self, runtime): 34 | subprocess.check_call( # nosec 35 | [ 36 | "pytest", 37 | "-s", 38 | "-x", 39 | ( 40 | f"{devenv_runtimes_path}/{runtime}/test/integration/" 41 | f"integration_test.py::test_scripts_run_successfully" 42 | ), 43 | ] 44 | ) 45 | subprocess.check_call( # nosec 46 | ["pytest", "-s", "-x", "./app/tests/integration/integration_test.py"] 47 | ) 48 | if runtime != "runtime_local": 49 | subprocess.check_call( # nosec 50 | ["velocitas", "exec", runtime.replace("_", "-"), "down"] 51 | ) 52 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | end_of_line = lf 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Automatically normalize line endings for all text-based files 2 | # http://git-scm.com/docs/gitattributes#_end_of_line_conversion 3 | * text=auto 4 | 5 | # For the following file types, normalize line endings to LF on 6 | # checkin and prevent conversion to CRLF when they are checked out 7 | # (this is required in order to prevent newline related issues like, 8 | # for example, after the build script is run) 9 | .* text eol=lf 10 | *.css text eol=lf 11 | *.html text eol=lf 12 | *.js text eol=lf 13 | *.json text eol=lf 14 | *.md text eol=lf 15 | *.sh text eol=lf 16 | *.txt text eol=lf 17 | *.xml text eol=lf 18 | *.yml text eol=lf 19 | *.yaml text eol=lf 20 | 21 | # Source files 22 | # ============ 23 | *.pxd text diff=python 24 | *.py text diff=python 25 | *.py3 text diff=python 26 | *.pyw text diff=python 27 | *.pyx text diff=python 28 | *.pyz text diff=python 29 | *.pyi text diff=python 30 | 31 | # Binary files 32 | # ============ 33 | *.db binary 34 | *.p binary 35 | *.pkl binary 36 | *.pickle binary 37 | *.pyc binary export-ignore 38 | *.pyo binary export-ignore 39 | *.pyd binary 40 | 41 | # Jupyter notebook 42 | *.ipynb text 43 | 44 | # Note: .db, .p, and .pkl files are associated 45 | # with the python modules ``pickle``, ``dbm.*``, 46 | # ``shelve``, ``marshal``, ``anydbm``, & ``bsddb`` 47 | # (among others). 48 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug-report.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: 🐞 Bug Report 17 | description: Provide a general summary of the bug in the title below. 18 | title: "[Bug]: " 19 | labels: 20 | - bug 21 | body: 22 | - type: markdown 23 | attributes: 24 | value: | 25 | **Thank you :heart: for taking the time to fill out this bug report!** 26 | - type: dropdown 27 | id: severity 28 | validations: 29 | required: true 30 | attributes: 31 | label: Severity 32 | description: How severe is the bug in your opinion? 33 | multiple: false 34 | options: 35 | - "Trivial" 36 | - "Medium" 37 | - "High" 38 | - "Critical" 39 | - "Blocker" 40 | - type: input 41 | id: version 42 | validations: 43 | required: true 44 | attributes: 45 | label: What release version, tag or commit-hash did you use? 46 | description: Please include a link if possible. 47 | placeholder: v0.1.0 or 06f432a00e4c66804202c91bdfb9c9b12823928b 48 | - type: textarea 49 | id: current-behavior 50 | validations: 51 | required: true 52 | attributes: 53 | label: Current Behavior 54 | description: Tell us what happened instead of the expected behavior. 55 | placeholder: Error message appeared when I cloned a repository... 56 | - type: textarea 57 | id: steps-to-reproduce 58 | validations: 59 | required: true 60 | attributes: 61 | label: Steps to Reproduce 62 | description: Provide a link to a live example, or an unambiguous set of steps to reproduce this bug. Include code to reproduce, if relevant 63 | placeholder: | 64 | 1. ... 65 | 2. ... 66 | 3. ... 67 | - type: textarea 68 | id: expected-behavior 69 | validations: 70 | required: true 71 | attributes: 72 | label: Expected Behavior 73 | description: Tell us what should happen 74 | placeholder: Clone of repository shall be prune of errors. 75 | - type: textarea 76 | id: possible-solution 77 | validations: 78 | required: false 79 | attributes: 80 | label: Possible Solution 81 | description: Fix/reason of the bug suggestion 82 | placeholder: A possible solution or fix is... 83 | - type: textarea 84 | id: additional-information 85 | validations: 86 | required: false 87 | attributes: 88 | label: Additional Information 89 | description: Provide an additional detailed description / screenshots / evidences of the bug 90 | placeholder: I would like to add... 91 | - type: checkboxes 92 | id: code-of-conduct 93 | attributes: 94 | label: Code of Conduct 95 | description: By submitting this issue, you agree to follow our "Code of Conduct". 96 | options: 97 | - label: I agree to follow this project's "Code of Conduct". 98 | required: true 99 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: 🛠️ Feature Request 17 | description: Suggest an idea to help us improve our product. 18 | title: "[Feature]: " 19 | labels: 20 | - "enhancement" 21 | body: 22 | - type: markdown 23 | attributes: 24 | value: | 25 | **Thank you :heart: for taking the time to fill out this feature request report!** 26 | We kindly ask you to search if an issue already exists for your requested feature. 27 | 28 | We are happy about contributions from all users. 29 | - type: textarea 30 | attributes: 31 | label: Description 32 | description: | 33 | A clear and concise description of the feature you're interested in. 34 | validations: 35 | required: true 36 | 37 | - type: textarea 38 | attributes: 39 | label: Suggested Solution 40 | description: | 41 | Describe the solution you'd like to be implemented. Provide a clear and concise description of what you want to happen. 42 | validations: 43 | required: false 44 | 45 | - type: textarea 46 | attributes: 47 | label: Alternatives 48 | description: | 49 | Describe alternatives you've considered. 50 | A clear and concise description of alternative solutions or features you've considered. 51 | validations: 52 | required: false 53 | 54 | - type: textarea 55 | attributes: 56 | label: Additional Context 57 | description: | 58 | Add any other context about the problem here. 59 | validations: 60 | required: false 61 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/question.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: ❓ Question or general issue 17 | description: Approach us with a question 18 | title: "[Q]: " 19 | labels: 20 | - question 21 | body: 22 | - type: markdown 23 | attributes: 24 | value: | 25 | **We are happy that you have a question to ask!** 26 | - type: textarea 27 | validations: 28 | required: true 29 | attributes: 30 | label: Question 31 | description: Feel free to ask us if you need assistance 32 | placeholder: How can I create a repository based on your template? 33 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | 2 | # Description 3 | 4 | 7 | 8 | ## Issue ticket number and link 9 | 10 | 13 | 14 | ## Checklist 15 | 16 | 19 | 20 | * [ ] Vehicle App can be started with native runtime and is connecting to vehicle data broker 21 | * [ ] Vehicle App can process MQTT messages and call the seat service 22 | * [ ] Vehicle App can be deployed to local Kanto runtime and is running 23 | 24 | * [ ] Created/updated tests, if necessary. Code Coverage percentage on new code shall be >= 70%. 25 | 26 | * [ ] Extended the documentation in Velocitas repo 27 | * [ ] Extended the documentation in README.md 28 | 29 | * [ ] Devcontainer can be opened successfully 30 | * [ ] Devcontainer can be opened successfully behind a corporate proxy 31 | * [ ] Devcontainer can be re-built successfully 32 | 33 | * [ ] Release workflow is passing 34 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | # To get started with Dependabot version updates, you'll need to specify which 17 | # package ecosystems to update and where the package manifests are located. 18 | # Please see the documentation for all configuration options: 19 | # https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates 20 | 21 | version: 2 22 | updates: 23 | - package-ecosystem: "pip" 24 | directory: "/" 25 | schedule: 26 | interval: "monthly" 27 | # Disable dependencies version updates 28 | open-pull-requests-limit: 0 29 | -------------------------------------------------------------------------------- /.github/scripts/deploy_image_from_artifact.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 3 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 4 | # 5 | # This program and the accompanying materials are made available under the 6 | # terms of the Apache License, Version 2.0 which is available at 7 | # https://www.apache.org/licenses/LICENSE-2.0. 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 11 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 12 | # License for the specific language governing permissions and limitations 13 | # under the License. 14 | # 15 | # SPDX-License-Identifier: Apache-2.0 16 | 17 | set -e 18 | 19 | ROOT_DIRECTORY=$( realpath "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/../.." ) 20 | APP_ARTIFACT_NAME=$(cat $ROOT_DIRECTORY/app/AppManifest.json | jq -r .name | tr -d '"') 21 | APP_NAME_LOWERCASE=$(echo $APP_ARTIFACT_NAME | tr '[:upper:]' '[:lower:]') 22 | APP_REGISTRY="localhost:12345" 23 | 24 | local_tag="$APP_REGISTRY/$APP_NAME_LOWERCASE:local" 25 | echo "Local URL: $local_tag" 26 | 27 | docker load -i "$APP_ARTIFACT_NAME.tar" | cut -d ':' -f 3 | xargs -i docker tag {} $local_tag 28 | docker push $local_tag 29 | 30 | cd $ROOT_DIRECTORY 31 | velocitas exec deployment-kanto deploy-vehicleapp 32 | -------------------------------------------------------------------------------- /.github/scripts/junit.tpl: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | {{- range . -}} 5 | {{- $failures := len .Vulnerabilities }} 6 | 7 | {{- if not (eq .Type "") }} 8 | 9 | 10 | 11 | {{- end -}} 12 | {{ range .Vulnerabilities }} 13 | 14 | {{ escapeXML .Description }} 15 | 16 | {{- end }} 17 | 18 | {{- end }} 19 | 20 | -------------------------------------------------------------------------------- /.github/workflows/build-docker-image.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Build Docker Image for single arch 17 | 18 | on: 19 | workflow_call: 20 | inputs: 21 | platform: 22 | required: true 23 | type: string 24 | app_name: 25 | required: true 26 | type: string 27 | 28 | jobs: 29 | build-image: 30 | name: "Building image (${{ inputs.app_name }})" 31 | runs-on: ubuntu-22.04 32 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 33 | outputs: 34 | archs: ${{ steps.set_args.outputs.archs_matrix }} 35 | env: 36 | APP_NAME: ${{ inputs.app_name }} 37 | 38 | steps: 39 | - name: Checkout repository 40 | uses: actions/checkout@v4 41 | with: 42 | submodules: "recursive" 43 | 44 | - name: Clone Release Documentation Action repository 45 | uses: actions/checkout@v4 46 | with: 47 | repository: eclipse-velocitas/release-documentation-action 48 | path: "./.github/actions" 49 | 50 | - name: Set up QEMU 51 | uses: docker/setup-qemu-action@v3 52 | 53 | - name: Set up Docker Buildx 54 | uses: docker/setup-buildx-action@v3 55 | 56 | - id: github-repository-name-case-adjusted 57 | name: Prepare repository name in lower case for docker upload. This supports repository names in mixed case 58 | uses: ASzc/change-string-case-action@v6 59 | with: 60 | string: ${{ github.repository }} 61 | 62 | - uses: de-vri-es/setup-git-credentials@v2 63 | with: 64 | credentials: https://user:${{ secrets.GITHUB_TOKEN }}@github.com/ 65 | 66 | - name: Init velocitas project 67 | run: | 68 | velocitas init 69 | 70 | - name: Setup git config 71 | shell: bash 72 | run: | 73 | git config --global user.email "github-automation@users.noreply.github.com" 74 | git config --global user.name "Github Automation" 75 | 76 | - name: Set Arguments for next step 77 | id: set_args 78 | run: | 79 | archs="" 80 | if [ ${{ inputs.platform }} = "multiarch" ]; then 81 | echo "Build Multiarch" 82 | echo "platforms=linux/amd64, linux/arm64" >> $GITHUB_OUTPUT 83 | archs=$(echo "linux/amd64, linux/arm64" | tr -d "linux\/,") 84 | else 85 | echo "Build ${{inputs.platform}}" 86 | echo "platforms=linux/${{ inputs.platform }}" >> $GITHUB_OUTPUT 87 | archs=${{ inputs.platform }} 88 | fi 89 | echo "archs=$archs" >> $GITHUB_OUTPUT 90 | json_array=$(echo "$archs" | jq -R 'sub("^ "; "") | split(" ")' ) 91 | echo "archs_matrix=$(jq -cn --argjson archs "$json_array" '{arch: $archs}')" >> $GITHUB_OUTPUT 92 | shell: bash 93 | 94 | - name: "${{ env.APP_NAME }} -- Build image" 95 | id: image_build 96 | uses: docker/build-push-action@v5 97 | with: 98 | provenance: false 99 | pull: true 100 | push: false 101 | outputs: | 102 | type=oci,dest=./${{ env.APP_NAME }}-oci-${{inputs.platform}}.tar 103 | file: ./app/Dockerfile 104 | context: . 105 | platforms: ${{ steps.set_args.outputs.platforms }} 106 | secrets: | 107 | "github_token=user:${{ secrets.GITHUB_TOKEN }}" 108 | tags: ${{ github.sha }} 109 | labels: | 110 | org.opencontainers.image.source=https://github.com/${{steps.github-repository-name-case-adjusted.outputs.lowercase}} 111 | 112 | - name: "Install skopeo" 113 | run: | 114 | sudo apt-get update 115 | sudo apt-get -y install skopeo 116 | 117 | - name: "${{ env.APP_NAME }} -- Inspect image with skopeo and create docker archives" 118 | id: inspect_tar 119 | run: | 120 | skopeo inspect --raw oci-archive:${{ env.APP_NAME }}-oci-${{inputs.platform}}.tar | jq 121 | skopeo inspect oci-archive:${{ env.APP_NAME }}-oci-${{inputs.platform}}.tar 122 | for arch in ${{ steps.set_args.outputs.archs }}; do 123 | skopeo copy --override-arch $arch oci-archive:${{ env.APP_NAME }}-oci-${{inputs.platform}}.tar docker-archive:${{ env.APP_NAME }}-docker-$arch.tar 124 | done 125 | 126 | - name: "${{ env.APP_NAME }} -- Get Native Binaries from image" 127 | run: | 128 | for arch in ${{ steps.set_args.outputs.archs }}; do 129 | image=$(docker load -i ${{ env.APP_NAME }}-docker-$arch.tar | cut -d ':' -f 3) 130 | id=$(docker create $image --platform linux/$arch) 131 | mkdir -p ./out 132 | app_name=$(echo ${{ env.APP_NAME }}_$arch | tr '[:upper:]' '[:lower:]') 133 | docker cp $id:/app ./out/$app_name 134 | done 135 | 136 | - name: "${{ env.APP_NAME }} -- Upload native binaries to artifacts" 137 | uses: actions/upload-artifact@v4 138 | with: 139 | name: binaries 140 | path: | 141 | out/* 142 | 143 | - name: "${{ env.APP_NAME }} -- Upload oci compliant image to artifacts" 144 | if: ${{ steps.image_build.outcome == 'success' }} 145 | uses: actions/upload-artifact@v4 146 | with: 147 | name: ${{ env.APP_NAME }}-${{ inputs.platform }}-oci-archive 148 | path: ./${{ env.APP_NAME }}-oci*.tar 149 | if-no-files-found: error 150 | 151 | - name: "${{ env.APP_NAME }} -- Upload docker image to artifacts" 152 | if: ${{ steps.image_build.outcome == 'success' }} 153 | uses: actions/upload-artifact@v4 154 | with: 155 | name: ${{ env.APP_NAME }}-${{ inputs.platform }}-docker-archive 156 | path: ./${{ env.APP_NAME }}-docker*.tar 157 | if-no-files-found: error 158 | 159 | - name: "${{ env.APP_NAME }} -- Upload AppManifest.json to artifacts" 160 | if: ${{ steps.image_build.outcome == 'success' }} 161 | uses: actions/upload-artifact@v4 162 | with: 163 | name: AppManifest 164 | path: ./app/AppManifest.json 165 | if-no-files-found: error 166 | 167 | scan-image: 168 | name: "Scan image (${{ inputs.app_name }}-${{ matrix.arch }})" 169 | runs-on: ubuntu-22.04 170 | needs: build-image 171 | strategy: 172 | matrix: ${{fromJSON(needs.build-image.outputs.archs)}} 173 | env: 174 | APP_NAME: ${{ inputs.app_name }} 175 | 176 | steps: 177 | - name: Checkout repository 178 | uses: actions/checkout@v4 179 | with: 180 | submodules: "recursive" 181 | 182 | - name: Clone Release Documentation Action repository 183 | uses: actions/checkout@v4 184 | with: 185 | repository: eclipse-velocitas/release-documentation-action 186 | path: "./.github/actions" 187 | 188 | - name: Download Artifacts 189 | uses: actions/download-artifact@v4 190 | with: 191 | path: . 192 | pattern: ${{ env.APP_NAME }}*-docker-archive 193 | merge-multiple: true 194 | 195 | - name: "${{ env.APP_NAME }} -- Scan docker image for vulnerabilities" 196 | uses: aquasecurity/trivy-action@0.19.0 197 | with: 198 | input: ${{ env.APP_NAME }}-docker-${{ matrix.arch }}.tar 199 | exit-code: "0" 200 | ignore-unfixed: true 201 | severity: "CRITICAL,HIGH" 202 | format: "template" 203 | template: "@.github/scripts/junit.tpl" 204 | output: "junit.xml" 205 | 206 | - name: "${{ env.APP_NAME }} -- Show scan results" 207 | if: ${{ always() }} 208 | run: cat ./junit.xml 209 | 210 | - name: "${{ env.APP_NAME }} -- Package vulnerability scan files" 211 | uses: ./.github/actions/package 212 | with: 213 | name: "VulnerabilityScan-${{ env.APP_NAME }}" 214 | type: "VulnerabilityScan" 215 | schema: "JUnit" 216 | sourcePath: ./junit.xml 217 | packagePath: results/Documentation/renderer 218 | 219 | - name: "${{ env.APP_NAME }} -- Upload trivy report as artifacts" 220 | uses: actions/upload-artifact@v4 221 | with: 222 | name: test-results-trivy-${{ matrix.arch }} 223 | path: | 224 | results/Documentation/renderer/* 225 | 226 | - name: "${{ env.APP_NAME }} -- Publish Trivy Scan Results" 227 | uses: mikepenz/action-junit-report@v4 228 | with: 229 | check_name: Trivy Scan Results (${{ env.APP_NAME }}) 230 | report_paths: ./junit.xml 231 | summary: true 232 | update_check: true 233 | annotate_only: true 234 | -------------------------------------------------------------------------------- /.github/workflows/build-multiarch-image.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Build multiarch image 17 | 18 | on: 19 | workflow_dispatch: 20 | push: 21 | # Run only on branches/commits and not tags 22 | branches: 23 | - main 24 | 25 | jobs: 26 | get-app-name: 27 | runs-on: ubuntu-22.04 28 | name: Get App-Name 29 | outputs: 30 | app_name: ${{ steps.export-app-name.outputs.app_name }} 31 | 32 | steps: 33 | - name: Checkout repository 34 | uses: actions/checkout@v4 35 | 36 | - name: Get app-name 37 | id: export-app-name 38 | run: | 39 | NAME=$(cat ./app/AppManifest.json | jq -r '.name') 40 | echo "app_name=$NAME" >> $GITHUB_OUTPUT 41 | 42 | build-image-multiarch: 43 | uses: ./.github/workflows/build-docker-image.yml 44 | needs: [get-app-name] 45 | with: 46 | platform: multiarch 47 | app_name: ${{ needs.get-app-name.outputs.app_name }} 48 | 49 | merge-test-results: 50 | runs-on: ubuntu-22.04 51 | name: Merge Trivy results 52 | needs: build-image-multiarch 53 | steps: 54 | - name: Merge Artifacts 55 | uses: actions/upload-artifact/merge@v4 56 | with: 57 | delete-merged: true 58 | name: test-results-trivy 59 | pattern: test-results-* 60 | -------------------------------------------------------------------------------- /.github/workflows/check-devcontainer.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Devcontainer check 17 | 18 | on: 19 | workflow_dispatch: 20 | push: 21 | # Run only on branches/commits and not tags 22 | branches: 23 | - main 24 | pull_request: 25 | branches: 26 | - main 27 | schedule: 28 | - cron: "0 4 * * *" 29 | 30 | jobs: 31 | automated-tests: 32 | runs-on: ubuntu-22.04 33 | 34 | steps: 35 | - name: Checkout repository 36 | uses: actions/checkout@v4 37 | 38 | - name: Build devcontainer and run automated tests 39 | uses: devcontainers/ci@v0.3 40 | with: 41 | runCmd: | 42 | pip3 install -r .devcontainer/tests/automated_tests/requirements.txt 43 | export PATH=$HOME/.local/bin:$PATH 44 | pytest -sx .devcontainer/tests 45 | 46 | - name: Upload logs 47 | uses: actions/upload-artifact@v4 48 | if: always() 49 | with: 50 | name: logs 51 | path: ./logs 52 | retention-days: 1 53 | -------------------------------------------------------------------------------- /.github/workflows/check-licenses.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | # _Summary_ 17 | # 18 | # Scans the repository for all 3rd party dependencies 19 | # and generates a notice file containing all used software within 20 | # the project. 21 | 22 | name: Check licenses 23 | 24 | on: 25 | workflow_dispatch: 26 | pull_request: 27 | branches: 28 | - main 29 | schedule: 30 | - cron: "0 4 * * *" 31 | 32 | jobs: 33 | check-licenses: 34 | runs-on: ubuntu-22.04 35 | name: Check Software Licenses 36 | 37 | steps: 38 | - name: Checkout repository 39 | uses: actions/checkout@v4 40 | 41 | - name: Clone License Check Repo 42 | uses: actions/checkout@v4 43 | with: 44 | repository: eclipse-velocitas/license-check 45 | ref: v1.2 46 | path: .github/actions/license-check 47 | 48 | - name: Run License Checker 49 | uses: ./.github/actions/license-check 50 | with: 51 | config-file-path: ./.licensechecker.yml 52 | fail-on-violation: false 53 | notice-file-name: "NOTICE-3RD-PARTY-CONTENT" 54 | generate-dash: true 55 | 56 | - name: Setup Java JDK 57 | uses: actions/setup-java@v4 58 | with: 59 | distribution: "temurin" 60 | java-version: 11.0.19 61 | 62 | - name: Run dash 63 | shell: bash 64 | run: | 65 | wget -O dash.jar "https://repo.eclipse.org/content/repositories/dash-licenses/org/eclipse/dash/org.eclipse.dash.licenses/1.0.2/org.eclipse.dash.licenses-1.0.2.jar" 66 | java -jar dash.jar clearlydefined.input -summary DEPENDENCIES > dash.out 2>&1 || true 67 | echo -e "Dash output: \n\`\`\` " >> $GITHUB_STEP_SUMMARY 68 | cat dash.out >> $GITHUB_STEP_SUMMARY 69 | echo -e "\n\`\`\`" 70 | 71 | - name: Upload dash input/output as artifacts 72 | uses: actions/upload-artifact@v4 73 | if: always() 74 | with: 75 | name: "dash-artifacts" 76 | path: | 77 | clearlydefined.input 78 | DEPENDENCIES 79 | dash.out 80 | -------------------------------------------------------------------------------- /.github/workflows/check-updates.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Automatic Package Update Check 17 | 18 | on: 19 | workflow_dispatch: 20 | schedule: 21 | - cron: "0 4 * * *" 22 | 23 | jobs: 24 | package_update_check: 25 | if: github.repository_owner == 'eclipse-velocitas' 26 | runs-on: ubuntu-22.04 27 | 28 | steps: 29 | - name: Checkout Repository 30 | uses: actions/checkout@v4 31 | with: 32 | token: ${{ secrets.VELOCITAS_PROJECT_TOKEN }} 33 | 34 | - name: Use devcontainer for upgrade and PR creation 35 | uses: devcontainers/ci@v0.3 36 | with: 37 | runCmd: | 38 | sudo apt-get update && sudo apt-get install -y gh 39 | 40 | echo "${{ secrets.VELOCITAS_PROJECT_TOKEN }}" | gh auth login --with-token 41 | 42 | velocitas upgrade --ignore-bounds && velocitas init && velocitas sync 43 | 44 | git config --global user.name "${{ github.actor }}" 45 | git config --global user.email "${{ github.actor }}@users.noreply.github.com" 46 | 47 | if [ -n "$(git status --porcelain)" ]; then 48 | PR_TITLE="Automated Package Update" 49 | PR_BODY="This pull request was created automatically by GitHub Actions to update package versions." 50 | 51 | # Check if a PR with the same title already exists 52 | PR_EXISTING=$(gh pr list --state open --search "$PR_TITLE" --json number | jq -r '.[0].number // empty') 53 | 54 | if [ -n "$PR_EXISTING" ]; then 55 | echo "Existing PR found (#${PR_EXISTING}). Editing..." 56 | git checkout . 57 | gh pr checkout "$PR_EXISTING" 58 | velocitas upgrade --ignore-bounds && velocitas init && velocitas sync 59 | git add . 60 | git commit -m "Update velocitas package versions" 61 | if [ $? -eq 0 ]; then 62 | git push 63 | gh pr comment "$PR_EXISTING" --body "Updated PR with latest package updates" 64 | fi 65 | else 66 | git add . 67 | git commit -m "Update velocitas package versions" 68 | BRANCH_NAME="automated-update-${{ github.sha }}" 69 | git push origin HEAD:$BRANCH_NAME 70 | echo "Creating new PR..." 71 | gh pr create --title "$PR_TITLE" --body "$PR_BODY" --head $BRANCH_NAME --base main 72 | fi 73 | else 74 | echo "No changes detected. Skip creating Pull Request." 75 | fi 76 | -------------------------------------------------------------------------------- /.github/workflows/ci.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: CI workflow 17 | 18 | concurrency: 19 | group: ${{ github.ref }} 20 | cancel-in-progress: true 21 | 22 | on: 23 | workflow_dispatch: 24 | push: 25 | # Run only on branches/commits and not tags 26 | branches: 27 | - main 28 | pull_request: 29 | branches: 30 | - main 31 | 32 | jobs: 33 | unit-tests: 34 | runs-on: ubuntu-22.04 35 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 36 | name: Run unit tests and linters 37 | 38 | steps: 39 | - name: Checkout repository 40 | uses: actions/checkout@v4 41 | 42 | - uses: de-vri-es/setup-git-credentials@v2 43 | with: 44 | credentials: https://user:${{ secrets.GITHUB_TOKEN }}@github.com/ 45 | 46 | - name: Init velocitas project 47 | run: | 48 | velocitas init 49 | 50 | - name: Install required packages 51 | run: | 52 | pip install -r requirements.txt 53 | pip install -r app/requirements-links.txt 54 | pip install -r app/requirements.txt 55 | pip install -r app/tests/requirements.txt 56 | 57 | - name: Fix dubious ownership 58 | run: | 59 | git config --global --add safe.directory $( pwd ) 60 | 61 | - name: Run Linters 62 | uses: pre-commit/action@v3.0.1 63 | 64 | - name: Clone Release Documentation Action repository 65 | uses: actions/checkout@v4 66 | with: 67 | repository: eclipse-velocitas/release-documentation-action 68 | path: "./.github/release-documentation/actions" 69 | 70 | - name: unit test 71 | shell: bash 72 | run: | 73 | pytest --rootdir=./app/tests/unit \ 74 | --override-ini junit_family=xunit1 \ 75 | --junit-xml=./results/UnitTest/junit.xml \ 76 | --cov ./app/src \ 77 | --cov-report=xml:results/CodeCoverage/cobertura-coverage.xml \ 78 | --cov-branch ./app/tests/unit 79 | 80 | - name: Publish Test Report 81 | uses: mikepenz/action-junit-report@v4 82 | if: always() 83 | with: 84 | report_paths: ./results/UnitTest/junit.xml 85 | summary: true 86 | update_check: true 87 | annotate_only: true 88 | 89 | - uses: irongut/CodeCoverageSummary@v1.3.0 90 | with: 91 | filename: results/CodeCoverage/cobertura-coverage.xml 92 | badge: true 93 | format: markdown 94 | hide_complexity: true 95 | indicators: true 96 | output: both 97 | 98 | - run: | 99 | cat code-coverage-results.md >> $GITHUB_STEP_SUMMARY 100 | 101 | - name: Package unit test files 102 | uses: ./.github/release-documentation/actions/package 103 | with: 104 | name: "UnitTest" 105 | type: "UnitTest" 106 | schema: "JUnit" 107 | sourcePath: ./results/UnitTest/junit.xml 108 | packagePath: ./results/Documentation/renderer 109 | 110 | - name: Package code coverage files 111 | uses: ./.github/release-documentation/actions/package 112 | with: 113 | name: "CodeCoverage" 114 | type: "CodeCoverage" 115 | schema: "Cobertura" 116 | sourcePath: results/CodeCoverage 117 | packagePath: results/Documentation/renderer 118 | 119 | - name: Upload test results as artifacts 120 | uses: actions/upload-artifact@v4 121 | if: always() 122 | with: 123 | name: "test-results-unit-tests" 124 | path: | 125 | results/Documentation/renderer/* 126 | 127 | get-app-name: 128 | runs-on: ubuntu-22.04 129 | name: Get App-Name 130 | outputs: 131 | app_name: ${{ steps.export-app-name.outputs.app_name }} 132 | 133 | steps: 134 | - name: Checkout repository 135 | uses: actions/checkout@v4 136 | 137 | - name: Get app-name 138 | id: export-app-name 139 | run: | 140 | NAME=$(cat ./app/AppManifest.json | jq -r '.name') 141 | echo "app_name=$NAME" >> $GITHUB_OUTPUT 142 | 143 | build-image-amd64: 144 | uses: ./.github/workflows/build-docker-image.yml 145 | needs: [get-app-name] 146 | with: 147 | platform: amd64 148 | app_name: ${{ needs.get-app-name.outputs.app_name }} 149 | 150 | run-integration-tests: 151 | name: Run Integration Tests (${{ needs.get-app-name.outputs.app_name }}) 152 | runs-on: ubuntu-22.04 153 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 154 | needs: [get-app-name, build-image-amd64] 155 | env: 156 | APP_NAME: ${{ needs.get-app-name.outputs.app_name }} 157 | steps: 158 | - name: Checkout repository 159 | uses: actions/checkout@v4 160 | 161 | - uses: de-vri-es/setup-git-credentials@v2 162 | with: 163 | credentials: https://user:${{ secrets.GITHUB_TOKEN }}@github.com/ 164 | 165 | - name: Init velocitas project 166 | run: | 167 | velocitas init 168 | 169 | - name: Login to GitHub Container Registry 170 | uses: docker/login-action@v3 171 | with: 172 | registry: ghcr.io 173 | username: ${{ github.repository_owner }} 174 | password: ${{ secrets.GITHUB_TOKEN }} 175 | 176 | - name: Install required packages 177 | run: | 178 | pip install -r ./app/requirements.txt 179 | pip install -r ./app/requirements-links.txt 180 | pip install -r ./app/tests/requirements.txt 181 | 182 | - name: Configure Kanto and start runtime containers 183 | run: velocitas exec runtime-kanto up 184 | 185 | - id: github-repository-name-case-adjusted 186 | name: Prepare repository name in lower case for docker upload. This supports repository names in mixed case 187 | uses: ASzc/change-string-case-action@v6 188 | with: 189 | string: ${{ github.repository }} 190 | 191 | - name: Download stored image from artifacts 192 | uses: actions/download-artifact@v4 193 | with: 194 | name: ${{ env.APP_NAME }}-amd64-docker-archive 195 | path: ./.github/scripts/ 196 | 197 | - name: Deploy image 198 | working-directory: ./.github/scripts 199 | run: | 200 | mv ${{ env.APP_NAME }}-docker-amd64.tar ${{ env.APP_NAME }}.tar 201 | ./deploy_image_from_artifact.sh 202 | 203 | - name: Run Python integration tests 204 | shell: bash 205 | env: 206 | VDB_PORT: 55555 207 | MQTT_PORT: 1883 208 | run: | 209 | pip install -r app/tests/requirements.txt 210 | pytest ./app/tests/integration --override-ini junit_family=xunit1 --junit-xml=./results/IntTest/junit.xml 211 | 212 | - name: Publish Test Report 213 | uses: mikepenz/action-junit-report@v4 214 | if: always() 215 | with: 216 | report_paths: ./results/IntTest/junit.xml 217 | summary: true 218 | update_check: true 219 | annotate_only: true 220 | 221 | - name: Clone release documentation action repository 222 | uses: actions/checkout@v4 223 | with: 224 | repository: eclipse-velocitas/release-documentation-action 225 | path: "./.github/actions" 226 | 227 | - name: Package integration test result files 228 | uses: ./.github/actions/package 229 | with: 230 | name: "IntegrationTest" 231 | type: "UnitTest" 232 | schema: "JUnit" 233 | sourcePath: ./results/IntTest/junit.xml 234 | packagePath: ./results/Documentation/renderer 235 | 236 | - name: Upload integration test results as artifacts 237 | uses: actions/upload-artifact@v4 238 | if: always() 239 | with: 240 | name: "test-results-integration-tests" 241 | path: | 242 | results/Documentation/renderer/* 243 | 244 | merge-test-results: 245 | runs-on: ubuntu-22.04 246 | needs: run-integration-tests 247 | steps: 248 | - name: Merge Artifacts 249 | uses: actions/upload-artifact/merge@v4 250 | with: 251 | delete-merged: true 252 | name: test-results 253 | pattern: test-results-* 254 | -------------------------------------------------------------------------------- /.github/workflows/ensure-lifecycle.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Ensure lifecycle management 17 | concurrency: 18 | group: ${{ github.ref }}-ensure-lifecycle 19 | cancel-in-progress: true 20 | 21 | on: 22 | workflow_dispatch: 23 | pull_request: 24 | branches: 25 | - main 26 | schedule: 27 | - cron: "0 4 * * *" 28 | 29 | jobs: 30 | check-sync: 31 | runs-on: ubuntu-22.04 32 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 33 | name: Are files in sync? 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v4 38 | 39 | - name: Run CLI 40 | run: | 41 | velocitas init 42 | velocitas sync 43 | 44 | - name: Fix dubious ownership 45 | run: | 46 | git config --global --add safe.directory $( pwd ) 47 | 48 | - name: Has Changes 49 | id: changes 50 | run: | 51 | if [[ -z "$(git status --porcelain .)" ]]; 52 | then 53 | echo "changed=0" >> $GITHUB_OUTPUT 54 | else 55 | echo "changed=1" >> $GITHUB_OUTPUT 56 | 57 | echo -e "## Summary of detected changes\n" >> $GITHUB_STEP_SUMMARY 58 | echo -e "\`\`\`bash" >> $GITHUB_STEP_SUMMARY 59 | git status --porcelain >> $GITHUB_STEP_SUMMARY 60 | echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY 61 | echo -e "## Diff Details\n" >> $GITHUB_STEP_SUMMARY 62 | echo -e "\`\`\`bash" >> $GITHUB_STEP_SUMMARY 63 | git diff >> $GITHUB_STEP_SUMMARY 64 | echo -e "\`\`\`" >> $GITHUB_STEP_SUMMARY 65 | fi 66 | shell: bash 67 | 68 | - name: Fail if there are changes 69 | if: steps.changes.outputs.changed == 1 70 | run: exit 1 71 | -------------------------------------------------------------------------------- /.github/workflows/gen-desired-state.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Generate desired state 17 | 18 | on: 19 | workflow_call: 20 | inputs: 21 | app_name: 22 | required: true 23 | type: string 24 | 25 | jobs: 26 | gen-desired-state: 27 | name: "Generate desired state for ${{ inputs.app_name }}" 28 | runs-on: ubuntu-22.04 29 | container: ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 30 | 31 | steps: 32 | - name: Checkout repository 33 | uses: actions/checkout@v4 34 | 35 | - uses: actions/setup-python@v5 36 | with: 37 | python-version: "3.10" 38 | 39 | - name: Init velocitas project 40 | run: | 41 | sudo curl -L https://github.com/eclipse-velocitas/cli/releases/latest/download/velocitas-linux-x64 -o /usr/bin/velocitas 42 | sudo chmod +x /usr/bin/velocitas 43 | velocitas init -v 44 | 45 | - name: Extract version from tag 46 | id: get_version 47 | run: | 48 | VERSION=${GITHUB_REF_NAME#v} 49 | echo Version: $VERSION 50 | echo "version-without-v=$VERSION" >> $GITHUB_OUTPUT 51 | 52 | - id: github-repository-name-case-adjusted 53 | name: Prepare repository name in lower case for docker upload. 54 | uses: ASzc/change-string-case-action@v6 55 | with: 56 | string: ${{ github.repository }} 57 | 58 | - name: "Generate desired state for ${{ inputs.app_name }}" 59 | working-directory: ${{github.workspace}} 60 | env: 61 | VAPP_VERSION: ${{ steps.get_version.outputs.version-without-v }} 62 | REGISTRY: "ghcr.io/${{steps.github-repository-name-case-adjusted.outputs.lowercase}}" 63 | run: | 64 | velocitas exec pantaris-integration generate-desired-state -s $(echo $REGISTRY/${{ inputs.app_name }}:$VAPP_VERSION | tr '[:upper:]' '[:lower:]') 65 | 66 | - name: Upload desired state manifest 67 | uses: softprops/action-gh-release@v2 68 | if: startsWith(github.ref, 'refs/tags/') 69 | with: 70 | files: | 71 | ./*_manifest_*.json 72 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | # This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | name: Release workflow 17 | 18 | on: 19 | release: 20 | types: [published, edited] 21 | 22 | # Needed if GITHUB_TOKEN by default do not have right to create release 23 | permissions: 24 | contents: write 25 | packages: write 26 | 27 | jobs: 28 | 29 | get-app-name: 30 | runs-on: ubuntu-22.04 31 | name: Get App-Name 32 | outputs: 33 | app_name: ${{ steps.export-app-name.outputs.app_name }} 34 | 35 | steps: 36 | - name: Checkout repository 37 | uses: actions/checkout@v4 38 | 39 | - name: Get app-name 40 | id: export-app-name 41 | run: | 42 | NAME=$(cat ./app/AppManifest.json | jq -r '.name') 43 | echo "app_name=$NAME" >> $GITHUB_OUTPUT 44 | 45 | gen-desired-state: 46 | uses: ./.github/workflows/gen-desired-state.yml 47 | needs: [get-app-name] 48 | with: 49 | app_name: ${{ needs.get-app-name.outputs.app_name }} 50 | 51 | upload-images: 52 | name: "Upload image (${{ needs.get-app-name.outputs.app_name }})" 53 | runs-on: ubuntu-22.04 54 | needs: get-app-name 55 | env: 56 | APP_NAME: ${{ needs.get-app-name.outputs.app_name }} 57 | 58 | steps: 59 | - name: Checkout repository 60 | uses: actions/checkout@v4 61 | 62 | - name: Extract version from tag 63 | id: get_version 64 | run: | 65 | VERSION=${GITHUB_REF_NAME#v} 66 | echo Version: $VERSION 67 | echo "version-without-v=$VERSION" >> $GITHUB_OUTPUT 68 | 69 | - run: echo "Using VehicleApp version ${{ steps.get_version.outputs.version-without-v }} from tag" 70 | 71 | - name: Login to GitHub Container Registry 72 | uses: docker/login-action@v3 73 | with: 74 | registry: ghcr.io 75 | username: ${{ github.repository_owner }} 76 | password: ${{ secrets.GITHUB_TOKEN }} 77 | 78 | - id: github-repository-name-case-adjusted 79 | name: Prepare repository name in lower case for docker upload. 80 | uses: ASzc/change-string-case-action@v6 81 | with: 82 | string: ${{ github.repository }} 83 | 84 | - name: Wait for Multi-Arch build to succeed 85 | uses: fountainhead/action-wait-for-check@v1.2.0 86 | with: 87 | checkName: Merge Trivy results 88 | token: ${{ secrets.GITHUB_TOKEN }} 89 | timeoutSeconds: 1800 90 | intervalSeconds: 20 91 | 92 | - name: Download builds from Build multiarch image workflow artifacts 93 | uses: dawidd6/action-download-artifact@v6 94 | with: 95 | github_token: ${{secrets.GITHUB_TOKEN}} 96 | workflow: build-multiarch-image.yml 97 | workflow_conclusion: success 98 | commit: ${{ github.sha }} 99 | path: ${{github.workspace}} 100 | 101 | - name: "${{ env.APP_NAME }} -- Publish release image to GHCR" 102 | working-directory: ${{github.workspace}} 103 | env: 104 | VAPP_IMAGE: ${{ env.APP_NAME }}-multiarch-oci-archive/${{ env.APP_NAME }}-oci-multiarch.tar 105 | VAPP_NAME: ${{ env.APP_NAME }} 106 | VAPP_VERSION: ${{ steps.get_version.outputs.version-without-v }} 107 | REGISTRY: "ghcr.io/${{steps.github-repository-name-case-adjusted.outputs.lowercase}}" 108 | run: | 109 | tag=$(echo docker://$REGISTRY/$VAPP_NAME:$VAPP_VERSION | tr '[:upper:]' '[:lower:]') 110 | echo "Copy vApp image $VAPP_IMAGE to '$tag'" 111 | skopeo copy --all oci-archive:$VAPP_IMAGE "$tag" 112 | 113 | - name: ${{ env.APP_NAME }} -- Upload assets 114 | uses: softprops/action-gh-release@v2 115 | if: startsWith(github.ref, 'refs/tags/') 116 | with: 117 | files: | 118 | ${{github.workspace}}/AppManifest/AppManifest.json 119 | ${{github.workspace}}/binaries/* 120 | ${{github.workspace}}/${{ env.APP_NAME }}-multiarch-docker-archive/* 121 | 122 | release-documentation: 123 | name: Generate release documentation 124 | runs-on: ubuntu-22.04 125 | needs: get-app-name 126 | env: 127 | APP_NAME: ${{ needs.get-app-name.outputs.app_name }} 128 | TEST_RESULT_FOLDER_NAME: test-results 129 | steps: 130 | - uses: actions/checkout@v4 131 | 132 | - name: Clone Release Documentation Action repository 133 | uses: actions/checkout@v4 134 | with: 135 | repository: eclipse-velocitas/release-documentation-action 136 | path: "./.github/actions" 137 | 138 | - uses: actions/setup-node@v4 139 | with: 140 | node-version: "18" 141 | check-latest: true 142 | 143 | - name: Conditional input event value 144 | uses: haya14busa/action-cond@v1 145 | id: condval 146 | with: 147 | cond: ${{ !github.event.inputs.name }} 148 | if_true: ${{ github.event.inputs.name }} 149 | if_false: ${{ github.sha }} 150 | 151 | - name: Wait for CI workflow to succeed 152 | uses: fountainhead/action-wait-for-check@v1.2.0 153 | with: 154 | checkName: Run Integration Tests (${{ env.APP_NAME }}) 155 | token: ${{ secrets.GITHUB_TOKEN }} 156 | timeoutSeconds: 600 157 | intervalSeconds: 10 158 | 159 | - name: Download artifact from CI workflow 160 | uses: dawidd6/action-download-artifact@v6 161 | with: 162 | workflow: ci.yml 163 | workflow_conclusion: success 164 | commit: ${{ steps.condval.outputs.value }} 165 | path: .vehicleApp/Documentation/Inbox 166 | 167 | - name: Render documentation (test-results) 168 | uses: ./.github/actions/render 169 | with: 170 | inboxPath: .vehicleApp/Documentation/Inbox/test-results 171 | outboxPath: .vehicleApp/Documentation/Outbox 172 | templatePath: ./.github/actions/templates 173 | 174 | - name: Setup Hugo 175 | uses: peaceiris/actions-hugo@v3 176 | with: 177 | hugo-version: "0.89.4" 178 | extended: true 179 | 180 | - name: Set tags output 181 | id: vars 182 | run: echo "tag=${GITHUB_REF#refs/*/}" >> $GITHUB_OUTPUT 183 | 184 | - name: Check output 185 | env: 186 | RELEASE_VERSION: ${{ steps.vars.outputs.tag }} 187 | run: | 188 | echo $RELEASE_VERSION 189 | echo ${{ steps.vars.outputs.tag }} 190 | 191 | - name: Create and Add reports to hugo static html site 192 | run: | 193 | hugo new site hugo 194 | 195 | cp ./README.md ./hugo/content/_index.md 196 | 197 | mkdir ./hugo/content/documentation 198 | mkdir ./hugo/content/reports 199 | 200 | cp ./README.md ./hugo/content/documentation/_index.md 201 | sed -i '1d' hugo/content/documentation/_index.md 202 | sed -i '1s/^/---\ntitle: "VehicleApp using python"\ndraft: false\n---\n/' hugo/content/documentation/_index.md 203 | 204 | cp .vehicleApp/Documentation/Outbox/* ./hugo/content/reports 205 | 206 | sed -i '1s/^/---\ntitle: "Code Coverage Test"\ndraft: false\n---\n/' hugo/content/reports/CodeCoverage-*.md 207 | sed -i '1s/^/---\ntitle: "Unit Test Results"\ndraft: false\n---\n/' hugo/content/reports/UnitTest-*.md 208 | cat hugo/content/reports/VulnerabilityScan-*.md > hugo/content/reports/vulnerability-scan-results.md 209 | sed -i '1s/^/---\ntitle: "Vulnerability Scan Results"\ndraft: false\n---\n/' hugo/content/reports/vulnerability-scan-results.md 210 | rm hugo/content/reports/VulnerabilityScan-*.md 211 | 212 | mkdir ./hugo/config 213 | mkdir ./hugo/config/_default 214 | mkdir ./hugo/config/pages 215 | 216 | echo $'languageCode = "en-us"\ntitle = "Release Documentation - @tag"\n\nbaseURL = "http://example.org/"\n\n# Keep uglyURLs for now, as this provides the best out of the box support for rendering markdown images in VSCode preview and Hugo\n# Link: https://gohugo.io/content-management/urls/#ugly-urls\nuglyURLs = "true"\n\nenableGitInfo = true\n\ntheme = "hugo-geekdoc"\n\n# Geekdoc required configuration\npygmentsUseClasses = true\npygmentsCodeFences = true\ndisablePathToLower = true\n\n[markup]\ndefaultMarkdownHandler = "goldmark"\n\n[markup.goldmark.renderer]\nunsafe = true\n\n[markup.tableOfContents]\n ordered= false\n startLevel= 1\n endLevel= 3\n\n[params]\ngeekdocRepo = "https://github.com/eclipse-velocitas/vehicle-app-python-template"\ngeekdocEditPath = "edit/main/hugo/content"\ngeekdocCollapseSection = true\n' > ./hugo/config/_default/config.toml 217 | echo $'# Hugo-Geekdoc Theme Config\n\nbaseURL = "https://fantastic-fiesta-da4ab8e5.pages.github.io/"\n\ntheme = "hugo-geekdoc"\n\nenableGitInfo = false\n\npluralizeListTitles = false\npygmentsUseClasses = true\n\n[markup]\n defaultMarkdownHandler = "goldmark"\n\n[markup.highlight]\n anchorLineNos = false\n codeFences = true\n guessSyntax = false\n hl_Lines = ""\n lineAnchors = ""\n lineNoStart = 1\n lineNos = true\n lineNumbersInTable = true\n noClasses = false\n style = "paraiso-dark"\n tabWidth = 4\n\n[markup.tableOfContents]\n endLevel = 3\n ordered = false\n startLevel = 1\n\n[markup.goldmark.extensions]\n typographer = true\n\n[markup.goldmark.renderer]\n unsafe = true\n\n# Disable geekdoc default theme settings\n[params]\ngeekdocRepo = ""\ngeekdocEditPath = ""\n# disable non-working search when serving from local file system\ngeekdocSearch = false\n' > ./hugo/config/pages/config.toml 218 | 219 | mkdir hugo/data/menu 220 | echo "---" > ./hugo/data/menu/extra.yaml 221 | printf "header:\n - name: GitHub\n ref: https://github.com/eclipse-velocitas/vehicle-app-python-template\n icon: gdoc_github\n external: true\n" >> ./hugo/data/menu/extra.yaml 222 | 223 | echo "---" > ./hugo/data/menu/more.yaml 224 | printf 'more:\n - name: Releases\n ref: "https://github.com/eclipse-velocitas/vehicle-app-python-template/releases"\n external: true\n icon: "gdoc_download"\n - name: "View Source"\n ref: "https://github.com/eclipse-velocitas/vehicle-app-python-template/tree/@tag"\n external: true\n icon: "gdoc_github"\n' >> ./hugo/data/menu/more.yaml 225 | 226 | sed -i -e 's/@tag/${{ steps.vars.outputs.tag }}/g' ./hugo/config/_default/config.toml 227 | sed -i -e 's/@tag/${{ steps.vars.outputs.tag }}/g' ./hugo/data/menu/more.yaml 228 | 229 | - name: Build 230 | working-directory: ${{github.workspace}}/hugo 231 | env: 232 | GEEKDOC_THEME_VERSION: 0.21.1 233 | # hugo --minify not fully supported by hugo-geekdoc theme 234 | run: | 235 | echo "Download theme hugo-geekdoc v${GEEKDOC_THEME_VERSION}" 236 | mkdir -p themes/hugo-geekdoc/ 237 | curl -L https://github.com/thegeeklab/hugo-geekdoc/releases/download/v${GEEKDOC_THEME_VERSION}/hugo-geekdoc.tar.gz | tar -xz -C themes/hugo-geekdoc/ --strip-components=1 238 | echo "Build release documentation for GitHub Pages" 239 | hugo -d ./public --environment=pages 240 | 241 | - name: zip 242 | run: | 243 | zip -r .vehicleApp/Documentation/release-documentation.zip ${{github.workspace}}/hugo/public 244 | 245 | - name: Upload assets 246 | uses: softprops/action-gh-release@v2 247 | if: startsWith(github.ref, 'refs/tags/') 248 | with: 249 | files: | 250 | .vehicleApp/Documentation/release-documentation.zip 251 | env: 252 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 253 | 254 | - name: Publish to GH Pages 255 | uses: peaceiris/actions-gh-pages@v4 256 | with: 257 | github_token: ${{ secrets.GITHUB_TOKEN }} 258 | publish_dir: ${{github.workspace}}/hugo/public 259 | publish_branch: gh_pages 260 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Aa][Rr][Mm]/ 27 | [Aa][Rr][Mm]64/ 28 | bld/ 29 | [Bb]in/ 30 | [Oo]bj/ 31 | [Ll]og/ 32 | [Ll]ogs/ 33 | 34 | # Visual Studio 2015/2017 cache/options directory 35 | .vs/ 36 | # Uncomment if you have tasks that create the project's static files in wwwroot 37 | #wwwroot/ 38 | 39 | # Visual Studio 2017 auto generated files 40 | Generated\ Files/ 41 | 42 | # MSTest test Results 43 | [Tt]est[Rr]esult*/ 44 | [Bb]uild[Ll]og.* 45 | 46 | # NUnit 47 | *.VisualState.xml 48 | TestResult.xml 49 | nunit-*.xml 50 | 51 | # Build Results of an ATL Project 52 | [Dd]ebugPS/ 53 | [Rr]eleasePS/ 54 | dlldata.c 55 | 56 | # Benchmark Results 57 | BenchmarkDotNet.Artifacts/ 58 | 59 | # .NET Core 60 | project.lock.json 61 | project.fragment.lock.json 62 | artifacts/ 63 | 64 | # StyleCop 65 | StyleCopReport.xml 66 | 67 | # Files built by Visual Studio 68 | *_i.c 69 | *_p.c 70 | *_h.h 71 | *.ilk 72 | *.meta 73 | *.obj 74 | *.iobj 75 | *.pch 76 | *.pdb 77 | *.ipdb 78 | *.pgc 79 | *.pgd 80 | *.rsp 81 | *.sbr 82 | *.tlb 83 | *.tli 84 | *.tlh 85 | *.tmp 86 | *.tmp_proj 87 | *_wpftmp.csproj 88 | *.log 89 | #Except the CAN dump logs 90 | !candump*.log 91 | *.vspscc 92 | *.vssscc 93 | .builds 94 | *.pidb 95 | *.svclog 96 | *.scc 97 | 98 | # Chutzpah Test files 99 | _Chutzpah* 100 | 101 | # Visual C++ cache files 102 | ipch/ 103 | *.aps 104 | *.ncb 105 | *.opendb 106 | *.opensdf 107 | *.sdf 108 | *.cachefile 109 | *.VC.db 110 | *.VC.VC.opendb 111 | 112 | # Visual Studio profiler 113 | *.psess 114 | *.vsp 115 | *.vspx 116 | *.sap 117 | 118 | # Visual Studio Trace Files 119 | *.e2e 120 | 121 | # TFS 2012 Local Workspace 122 | $tf/ 123 | 124 | # Guidance Automation Toolkit 125 | *.gpState 126 | 127 | # ReSharper is a .NET coding add-in 128 | _ReSharper*/ 129 | *.[Rr]e[Ss]harper 130 | *.DotSettings.user 131 | 132 | # TeamCity is a build add-in 133 | _TeamCity* 134 | 135 | # DotCover is a Code Coverage Tool 136 | *.dotCover 137 | 138 | # AxoCover is a Code Coverage Tool 139 | .axoCover/* 140 | !.axoCover/settings.json 141 | 142 | # Visual Studio code coverage results 143 | *.coverage 144 | *.coveragexml 145 | 146 | # NCrunch 147 | _NCrunch_* 148 | .*crunch*.local.xml 149 | nCrunchTemp_* 150 | 151 | # MightyMoose 152 | *.mm.* 153 | AutoTest.Net/ 154 | 155 | # Web workbench (sass) 156 | .sass-cache/ 157 | 158 | # Installshield output folder 159 | [Ee]xpress/ 160 | 161 | # DocProject is a documentation generator add-in 162 | DocProject/buildhelp/ 163 | DocProject/Help/*.HxT 164 | DocProject/Help/*.HxC 165 | DocProject/Help/*.hhc 166 | DocProject/Help/*.hhk 167 | DocProject/Help/*.hhp 168 | DocProject/Help/Html2 169 | DocProject/Help/html 170 | 171 | # Click-Once directory 172 | publish/ 173 | 174 | # Publish Web Output 175 | *.[Pp]ublish.xml 176 | *.azurePubxml 177 | # Note: Comment the next line if you want to checkin your web deploy settings, 178 | # but database connection strings (with potential passwords) will be unencrypted 179 | *.pubxml 180 | *.publishproj 181 | 182 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 183 | # checkin your Azure Web App publish settings, but sensitive information contained 184 | # in these scripts will be unencrypted 185 | PublishScripts/ 186 | 187 | # NuGet Packages 188 | *.nupkg 189 | # NuGet Symbol Packages 190 | *.snupkg 191 | # The packages folder can be ignored because of Package Restore 192 | **/[Pp]ackages/* 193 | # except build/, which is used as an MSBuild target. 194 | !**/[Pp]ackages/build/ 195 | # Uncomment if necessary however generally it will be regenerated when needed 196 | #!**/[Pp]ackages/repositories.config 197 | # NuGet v3's project.json files produces more ignorable files 198 | *.nuget.props 199 | *.nuget.targets 200 | 201 | # Microsoft Azure Build Output 202 | csx/ 203 | *.build.csdef 204 | 205 | # Microsoft Azure Emulator 206 | ecf/ 207 | rcf/ 208 | 209 | # Windows Store app package directories and files 210 | AppPackages/ 211 | BundleArtifacts/ 212 | Package.StoreAssociation.xml 213 | _pkginfo.txt 214 | *.appx 215 | *.appxbundle 216 | *.appxupload 217 | 218 | # Visual Studio cache files 219 | # files ending in .cache can be ignored 220 | *.[Cc]ache 221 | # but keep track of directories ending in .cache 222 | !?*.[Cc]ache/ 223 | 224 | # Others 225 | ClientBin/ 226 | ~$* 227 | *~ 228 | *.dbmdl 229 | *.dbproj.schemaview 230 | *.jfm 231 | *.pfx 232 | *.publishsettings 233 | orleans.codegen.cs 234 | 235 | # Including strong name files can present a security risk 236 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 237 | #*.snk 238 | 239 | # Since there are multiple workflows, uncomment next line to ignore bower_components 240 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 241 | #bower_components/ 242 | 243 | # RIA/Silverlight projects 244 | Generated_Code/ 245 | 246 | # Backup & report files from converting an old project file 247 | # to a newer Visual Studio version. Backup files are not needed, 248 | # because we have git ;-) 249 | _UpgradeReport_Files/ 250 | Backup*/ 251 | UpgradeLog*.XML 252 | UpgradeLog*.htm 253 | ServiceFabricBackup/ 254 | *.rptproj.bak 255 | 256 | # SQL Server files 257 | *.mdf 258 | *.ldf 259 | *.ndf 260 | 261 | # Business Intelligence projects 262 | *.rdl.data 263 | *.bim.layout 264 | *.bim_*.settings 265 | *.rptproj.rsuser 266 | *- [Bb]ackup.rdl 267 | *- [Bb]ackup ([0-9]).rdl 268 | *- [Bb]ackup ([0-9][0-9]).rdl 269 | 270 | # Microsoft Fakes 271 | FakesAssemblies/ 272 | 273 | # GhostDoc plugin setting file 274 | *.GhostDoc.xml 275 | 276 | # Node.js Tools for Visual Studio 277 | .ntvs_analysis.dat 278 | node_modules/ 279 | 280 | # Visual Studio 6 build log 281 | *.plg 282 | 283 | # Visual Studio 6 workspace options file 284 | *.opt 285 | 286 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 287 | *.vbw 288 | 289 | # Visual Studio LightSwitch build output 290 | **/*.HTMLClient/GeneratedArtifacts 291 | **/*.DesktopClient/GeneratedArtifacts 292 | **/*.DesktopClient/ModelManifest.xml 293 | **/*.Server/GeneratedArtifacts 294 | **/*.Server/ModelManifest.xml 295 | _Pvt_Extensions 296 | 297 | # Paket dependency manager 298 | .paket/paket.exe 299 | paket-files/ 300 | 301 | # FAKE - F# Make 302 | .fake/ 303 | 304 | # CodeRush personal settings 305 | .cr/personal 306 | 307 | # Python Tools for Visual Studio (PTVS) 308 | __pycache__/ 309 | *.pyc 310 | 311 | # Cake - Uncomment if you are using it 312 | # tools/** 313 | # !tools/packages.config 314 | 315 | # Tabs Studio 316 | *.tss 317 | 318 | # Telerik's JustMock configuration file 319 | *.jmconfig 320 | 321 | # BizTalk build output 322 | *.btp.cs 323 | *.btm.cs 324 | *.odx.cs 325 | *.xsd.cs 326 | 327 | # OpenCover UI analysis results 328 | OpenCover/ 329 | 330 | # Azure Stream Analytics local run output 331 | ASALocalRun/ 332 | 333 | # MSBuild Binary and Structured Log 334 | *.binlog 335 | 336 | # NVidia Nsight GPU debugger configuration file 337 | *.nvuser 338 | 339 | # MFractors (Xamarin productivity tool) working folder 340 | .mfractor/ 341 | 342 | # Local History for Visual Studio 343 | .localhistory/ 344 | 345 | # BeatPulse healthcheck temp database 346 | healthchecksdb 347 | 348 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 349 | MigrationBackup/ 350 | 351 | # Ionide (cross platform F# VS Code tools) working folder 352 | .ionide/ 353 | 354 | # build results temp folder 355 | results/ 356 | 357 | # Don't commit runtime binaries 358 | .vscode/**/assets 359 | 360 | # venv catalog 361 | venv/ 362 | 363 | # Mac files 364 | .DS_Store 365 | 366 | # generated files 367 | gen/ 368 | -------------------------------------------------------------------------------- /.licensechecker.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | whitelist-file-path: ./whitelisted-licenses.txt 16 | scan-dirs: 17 | - path: ./ 18 | python-version: 3 19 | python-pip-included-requirement-files: 20 | - requirements.txt 21 | - .devcontainer/tests/automated_tests/requirements.txt 22 | - app/requirements.txt 23 | - app/tests/requirements.txt 24 | -------------------------------------------------------------------------------- /.ort.yml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | curations: 16 | packages: 17 | - id: "PyPI::pytest-cov:4.0.0" 18 | curations: 19 | comment: "Proper license is defined in package repository https://pypi.org/project/pytest-cov/" 20 | concluded_license: "MIT" 21 | - id: "PyPI::coverage:6.5.0" 22 | curations: 23 | comment: "Proper license is defined in package repository https://pypi.org/project/coverage/" 24 | concluded_license: "Apache-2.0" 25 | - id: "PyPI::gitdb:4.0.10" 26 | curations: 27 | comment: "Proper license is defined in package repository https://pypi.org/project/gitdb/" 28 | concluded_license: "BSD-3-Clause" 29 | - id: "PyPI::grpcio:1.48.2" 30 | curations: 31 | comment: "Proper license is defined in package repository https://pypi.org/project/grpcio/" 32 | concluded_license: "Apache-2.0" 33 | - id: "PyPI::identify:2.5.9" 34 | curations: 35 | comment: "Proper license is defined in package repository https://pypi.org/project/identify/" 36 | concluded_license: "MIT" 37 | - id: "PyPI::setuptools:67.2.0" 38 | curations: 39 | comment: "Proper license is defined in package repository https://pypi.org/project/setuptools/" 40 | concluded_license: "MIT" 41 | - id: "PyPI::packaging:23.0" 42 | curations: 43 | comment: "Proper license is defined in package repository https://pypi.org/project/packaging/" 44 | concluded_license: "Apache-2.0" 45 | 46 | resolutions: 47 | vulnerabilities: 48 | - id: "CVE-2022-42969" 49 | reason: "INEFFECTIVE_VULNERABILITY" 50 | comment: "Vulnerability only applicable for SVN projects. Requires a change to be made by a third party https://github.com/pytest-dev/py/issues/287" 51 | - id: "CVE-2018-20225" 52 | reason: "MITIGATED_VULNERABILITY" 53 | comment: "Mitigating control: avoiding use of the --extra-index-url parameter for pip" 54 | - id: "CVE-2019-20907" 55 | reason: "INVALID_MATCH_VULNERABILITY" 56 | comment: "Only applicable for python version <=3.8.3 or <3.9.0-b5 python 3.10 in use" 57 | - id: "CVE-2019-20916" 58 | reason: "INVALID_MATCH_VULNERABILITY" 59 | comment: "pip < 19.2 is affected pip in use 22.3.1" 60 | - id: "sonatype-2012-0071" 61 | reason: "INVALID_MATCH_VULNERABILITY" 62 | comment: "only relevan for python 2.7 python 3.10 in use" 63 | - id: "sonatype-2022-6046" 64 | reason: "INVALID_MATCH_VULNERABILITY" 65 | comment: "affected wheel < 0.38.4 wheel = 0.38.4 in use" 66 | - id: " CVE-2022-33124" 67 | reason: "CANT_FIX_VULNERABILITY" 68 | comment: "aiohttp consider this vulnerability as false possitive. No prove that issue leads to DoS attack. Requires a change to be made by a third party" 69 | - id: "CVE-2020-11023" 70 | reason: "INEFFECTIVE_VULNERABILITY" 71 | comment: "No evidences that pkg:pypi/deprecation@2.1.0 is affected. mainly jquery package is affected" 72 | - id: "CVE-2022-24439" 73 | reason: "INEFFECTIVE_VULNERABILITY" 74 | comment: "bandit has dependency on gitpython but not using affected functinality. No usage of gitpython directly" 75 | - id: "CVE-2022-23491" 76 | reason: "INVALID_MATCH_VULNERABILITY" 77 | comment: "certifi is not used by our components directly or indirectly" 78 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | --- 16 | # See https://pre-commit.com for more information 17 | # See https://pre-commit.com/hooks.html for more hooks 18 | repos: 19 | - repo: https://github.com/pre-commit/pre-commit-hooks 20 | rev: v5.0.0 21 | hooks: 22 | - id: trailing-whitespace 23 | - id: end-of-file-fixer 24 | - id: check-yaml 25 | args: [--allow-multiple-documents] 26 | - id: check-added-large-files 27 | exclude: > 28 | (?x)^( 29 | .*.log 30 | )$ 31 | - id: check-merge-conflict 32 | 33 | - repo: https://github.com/astral-sh/ruff-pre-commit 34 | rev: v0.9.10 35 | hooks: 36 | - id: ruff 37 | args: [--fix] 38 | - id: ruff-format 39 | 40 | - repo: https://github.com/pre-commit/mirrors-mypy 41 | rev: "v1.15.0" 42 | hooks: 43 | - id: mypy 44 | args: [app] 45 | language: system 46 | pass_filenames: false 47 | 48 | - repo: https://github.com/Lucas-C/pre-commit-hooks 49 | rev: v1.5.5 50 | hooks: 51 | - id: insert-license 52 | files: '.*\.(py|pyi|yaml|yml|sh|in)$' 53 | exclude: .devcontainer/tests 54 | args: 55 | - --license-filepath 56 | - license_header.txt 57 | - --comment-style 58 | - "#" 59 | - --use-current-year 60 | - --allow-past-years 61 | - --skip-license-insertion-comment=This file is maintained by velocitas CLI, do not modify manually. 62 | - id: insert-license 63 | files: "Dockerfile.*" 64 | args: 65 | - --license-filepath 66 | - license_header.txt 67 | - --comment-style 68 | - "#" 69 | - --use-current-year 70 | - --allow-past-years 71 | - --skip-license-insertion-comment=This file is maintained by velocitas CLI, do not modify manually. 72 | -------------------------------------------------------------------------------- /.velocitas-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": { 3 | "devenv-runtimes": "v4.1.0", 4 | "devenv-github-workflows": "v6.1.4", 5 | "devenv-github-templates": "v1.0.5", 6 | "devenv-devcontainer-setup": "v2.6.3" 7 | } 8 | } 9 | -------------------------------------------------------------------------------- /.velocitas.json: -------------------------------------------------------------------------------- 1 | { 2 | "packages": { 3 | "devenv-runtimes": "v4.1.0", 4 | "devenv-github-workflows": "v6.1.4", 5 | "devenv-github-templates": "v1.0.5", 6 | "devenv-devcontainer-setup": "v2.6.3" 7 | }, 8 | "components": [ 9 | "runtime-local", 10 | "runtime-kanto", 11 | "deployment-kanto", 12 | "pantaris-integration", 13 | "github-workflows", 14 | "github-templates", 15 | "devcontainer-setup", 16 | "vehicle-signal-interface", 17 | "grpc-interface-support" 18 | ], 19 | "variables": { 20 | "language": "python", 21 | "repoType": "app", 22 | "appManifestPath": "app/AppManifest.json", 23 | "githubRepoId": "eclipse-velocitas/vehicle-app-python-template", 24 | "generatedModelPath": "./gen/vehicle_model" 25 | }, 26 | "cliVersion": "v0.13.1" 27 | } 28 | -------------------------------------------------------------------------------- /.vscode/launch.json: -------------------------------------------------------------------------------- 1 | { 2 | // Use IntelliSense to learn about possible attributes. 3 | // Hover to view descriptions of existing attributes. 4 | // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 5 | "version": "0.2.0", 6 | "compounds": [], 7 | "configurations": [ 8 | { 9 | "type": "python", 10 | "justMyCode": false, 11 | "request": "launch", 12 | "name": "VehicleApp", 13 | "program": "${workspaceFolder}/app/src/main.py", 14 | "console": "integratedTerminal", 15 | "env": { 16 | "SDV_MIDDLEWARE_TYPE": "native", 17 | "SDV_VEHICLEDATABROKER_ADDRESS": "grpc://127.0.0.1:55555", 18 | "SDV_MQTT_ADDRESS": "mqtt://127.0.0.1:1883" 19 | } 20 | } 21 | ] 22 | } 23 | -------------------------------------------------------------------------------- /.vscode/scripts/import-example-app.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 3 | # 4 | # This program and the accompanying materials are made available under the 5 | # terms of the Apache License, Version 2.0 which is available at 6 | # https://www.apache.org/licenses/LICENSE-2.0. 7 | # 8 | # Unless required by applicable law or agreed to in writing, software 9 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 10 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 11 | # License for the specific language governing permissions and limitations 12 | # under the License. 13 | # 14 | # SPDX-License-Identifier: Apache-2.0 15 | 16 | set -e 17 | 18 | VELOCITAS_EXAMPLES_PATH="$(python -c 'import velocitas_examples; print(velocitas_examples.__path__[0])')" 19 | CHOSEN_EXAMPLE=$@ 20 | 21 | if [[ `git status --porcelain app/` ]]; then 22 | echo "######################## WARNING #########################" 23 | echo "#### Please commit or stash your changes in the app ####" 24 | echo "#### directory before an import is possible: ####" 25 | echo "#### The content of the app directory needs being ####" 26 | echo "#### completely replaced by the example code! ####" 27 | echo "######################## WARNING #########################" 28 | else 29 | rm -rf app/ 30 | cp -r $VELOCITAS_EXAMPLES_PATH/$CHOSEN_EXAMPLE/. app/ 31 | 32 | # Re-compile requirements*.txt (including app and tests one) 33 | pip-compile -r -q ./requirements.in 34 | # Re-intstall necessary packages in DevContainer 35 | for file in ./requirements.txt ./app/requirements.txt ./app/tests/requirements.txt ./app/requirements-links.txt 36 | do 37 | if [ -f $file ]; then 38 | pip3 install -r $file 39 | fi 40 | done 41 | 42 | # Generate model referenced by imported example 43 | velocitas exec vehicle-signal-interface download-vspec 44 | velocitas exec vehicle-signal-interface generate-model 45 | 46 | echo "#######################################################" 47 | echo "Successfully imported $@" 48 | echo "#######################################################" 49 | fi 50 | -------------------------------------------------------------------------------- /.vscode/settings.json: -------------------------------------------------------------------------------- 1 | {} 2 | -------------------------------------------------------------------------------- /.vscode/tasks.json: -------------------------------------------------------------------------------- 1 | { 2 | "version": "2.0.0", 3 | "tasks": [ 4 | { 5 | "label": "Local Runtime - Up", 6 | "detail": "Starts up the local runtime", 7 | "type": "shell", 8 | "command": "velocitas exec runtime-local up", 9 | "group": "none", 10 | "presentation": { 11 | "panel": "dedicated", 12 | "clear": true, 13 | }, 14 | "problemMatcher": [] 15 | }, 16 | { 17 | "label": "Local Runtime - Down", 18 | "detail": "Stops the local runtime", 19 | "type": "shell", 20 | "command": "velocitas exec runtime-local down", 21 | "group": "none", 22 | "presentation": { 23 | "panel": "dedicated", 24 | "clear": true, 25 | }, 26 | "problemMatcher": [] 27 | }, 28 | { 29 | "label": "Local Runtime - Run VehicleApp", 30 | "detail": "Starts the VehicleApp under development", 31 | "type": "shell", 32 | "command": [ 33 | "velocitas exec runtime-local run-vehicle-app python3 ${workspaceFolder}/app/src/main.py" 34 | ], 35 | "presentation": { 36 | "panel": "dedicated", 37 | "close": false, 38 | "reveal": "always" 39 | }, 40 | "problemMatcher": [] 41 | }, 42 | { 43 | "label": "Local Runtime - VehicleDataBroker CLI", 44 | "detail": "Starts the VehicleDataBroker CLI", 45 | "type": "shell", 46 | "command": "velocitas exec runtime-local run-vehicledatabroker-cli", 47 | "presentation": { 48 | "panel": "dedicated", 49 | "clear": true, 50 | }, 51 | "group": "none", 52 | "problemMatcher": [] 53 | }, 54 | { 55 | "label": "Pre Commit Action", 56 | "detail": "Perform checking/formating of the code", 57 | "type": "shell", 58 | "command": "pre-commit run --show-diff-on-failure --color=always --all-files", 59 | "group": "none", 60 | "problemMatcher": [] 61 | }, 62 | { 63 | "label": "Import example app from SDK", 64 | "detail": "Replace the app implementation in the app folder by an example app chosen from SDK repository", 65 | "type": "shell", 66 | "command": "./.vscode/scripts/import-example-app.sh ${input:exampleApp}", 67 | "problemMatcher": [] 68 | }, 69 | { 70 | "label": "(Re-)generate vehicle model", 71 | "detail": "(Re-)generates the vehicle model from source files specified in the AppManifest.", 72 | "type": "shell", 73 | "command": "velocitas exec vehicle-signal-interface download-vspec && velocitas exec vehicle-signal-interface generate-model", 74 | "group": "none", 75 | "presentation": { 76 | "reveal": "always", 77 | "panel": "dedicated", 78 | "clear": true, 79 | "close": false 80 | }, 81 | "problemMatcher": [] 82 | }, 83 | { 84 | "label": "(Re-)generate gRPC SDKs", 85 | "detail": "(Re-)generates all auto-generated gRPC SDKs used by the app", 86 | "type": "shell", 87 | "command": "velocitas exec grpc-interface-support generate-sdk", 88 | "group": "none", 89 | "presentation": { 90 | "reveal": "always", 91 | "panel": "dedicated", 92 | "clear": true, 93 | "close": false 94 | }, 95 | "problemMatcher": [] 96 | }, 97 | { 98 | "label": "Kanto Runtime - Up", 99 | "detail": "Starts up the Kanto runtime.", 100 | "type": "shell", 101 | "command": "velocitas exec runtime-kanto up", 102 | "group": "none", 103 | "isBackground": true, 104 | "presentation": { 105 | "reveal": "always", 106 | "clear": true, 107 | "close": false 108 | }, 109 | "problemMatcher": { 110 | "pattern": [ 111 | { 112 | "regexp": ".", 113 | "file": 1, 114 | "location": 2, 115 | "message": 3 116 | } 117 | ], 118 | "background": { 119 | "activeOnStart": true, 120 | "beginsPattern": "Hint:", 121 | "endsPattern": "^✅ Kanto is ready to use!.*" 122 | } 123 | } 124 | }, 125 | { 126 | "label": "Kanto Runtime - Down", 127 | "detail": "Stops the Kanto runtime", 128 | "type": "shell", 129 | "command": "velocitas exec runtime-kanto down", 130 | "group": "none", 131 | "presentation": { 132 | "reveal": "always", 133 | "clear": true, 134 | "close": false 135 | }, 136 | "problemMatcher": [] 137 | }, 138 | { 139 | "label": "Kanto Runtime - Build VehicleApp", 140 | "detail": "Builds the VehicleApp.", 141 | "type": "shell", 142 | "command": "velocitas exec deployment-kanto build-vehicleapp", 143 | "group": "none", 144 | "presentation": { 145 | "reveal": "always", 146 | "panel": "dedicated", 147 | "clear": true, 148 | "close": false 149 | }, 150 | "problemMatcher": [] 151 | }, 152 | { 153 | "label": "Kanto Runtime - Deploy VehicleApp", 154 | "detail": "Builds and deploys the VehicleApp via Kanto-cm", 155 | "type": "shell", 156 | "command": "velocitas exec deployment-kanto deploy-vehicleapp", 157 | "group": "none", 158 | "presentation": { 159 | "reveal": "always", 160 | "panel": "dedicated", 161 | "clear": true, 162 | "close": false 163 | }, 164 | "dependsOn": [ 165 | "Kanto Runtime - Up", 166 | "Kanto Runtime - Build VehicleApp" 167 | ], 168 | "problemMatcher": [] 169 | }, 170 | { 171 | "label": "Kanto Runtime - Deploy VehicleApp (without rebuild)", 172 | "detail": "Deploys the VehicleApp via Kanto-cm (without rebuilding it)", 173 | "type": "shell", 174 | "command": "velocitas exec deployment-kanto deploy-vehicleapp", 175 | "group": "none", 176 | "presentation": { 177 | "reveal": "always", 178 | "panel": "dedicated", 179 | "clear": true, 180 | "close": false 181 | }, 182 | "dependsOn": [ 183 | "Kanto Runtime - Up" 184 | ], 185 | "problemMatcher": [] 186 | }, 187 | { 188 | "label": "Kanto Runtime - Show kantUI Dashboard", 189 | "detail": "Show dashboard of Kanto Runtime", 190 | "type": "shell", 191 | "command": "sudo kantui", 192 | "group": "none", 193 | "presentation": { 194 | "reveal": "always", 195 | "panel": "dedicated", 196 | "clear": true, 197 | "close": false 198 | }, 199 | "problemMatcher": [] 200 | }, 201 | ], 202 | "inputs": [ 203 | { 204 | "description": "Options for example apps from SDK package.", 205 | "id": "exampleApp", 206 | "type": "pickString", 207 | "options": [ 208 | "seat-adjuster" 209 | ], 210 | } 211 | ] 212 | } 213 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Community Code of Conduct 2 | 3 | **Version 1.0 4 | January 1, 2023** 5 | 6 | ## Our Pledge 7 | 8 | In the interest of fostering an open and welcoming environment, we as community members, contributors, Committers[^1], and Project Leads (collectively "Contributors") pledge to make participation in our projects and our community a harassment-free and inclusive experience for everyone. 9 | 10 | This Community Code of Conduct ("Code") outlines our behavior expectations as members of our community in all Eclipse Foundation activities, both offline and online. It is not intended to govern scenarios or behaviors outside of the scope of Eclipse Foundation activities. Nor is it intended to replace or supersede the protections offered to all our community members under the law. Please follow both the spirit and letter of this Code and encourage other Contributors to follow these principles into our work. Failure to read or acknowledge this Code does not excuse a Contributor from compliance with the Code. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contribute to creating a positive and professional environment include: 15 | 16 | - Using welcoming and inclusive language; 17 | - Actively encouraging all voices; 18 | - Helping others bring their perspectives and listening actively. If you find yourself dominating a discussion, it is especially important to encourage other voices to join in; 19 | - Being respectful of differing viewpoints and experiences; 20 | - Gracefully accepting constructive criticism; 21 | - Focusing on what is best for the community; 22 | - Showing empathy towards other community members; 23 | - Being direct but professional; and 24 | - Leading by example by holding yourself and others accountable 25 | 26 | Examples of unacceptable behavior by Contributors include: 27 | 28 | - The use of sexualized language or imagery; 29 | - Unwelcome sexual attention or advances; 30 | - Trolling, insulting/derogatory comments, and personal or political attacks; 31 | - Public or private harassment, repeated harassment; 32 | - Publishing others' private information, such as a physical or electronic address, without explicit permission; 33 | - Violent threats or language directed against another person; 34 | - Sexist, racist, or otherwise discriminatory jokes and language; 35 | - Posting sexually explicit or violent material; 36 | - Sharing private content, such as emails sent privately or non-publicly, or unlogged forums such as IRC channel history; 37 | - Personal insults, especially those using racist or sexist terms; 38 | - Excessive or unnecessary profanity; 39 | - Advocating for, or encouraging, any of the above behavior; and 40 | - Other conduct which could reasonably be considered inappropriate in a professional setting 41 | 42 | ## Our Responsibilities 43 | 44 | With the support of the Eclipse Foundation employees, consultants, officers, and directors (collectively, the "Staff"), Committers, and Project Leads, the Eclipse Foundation Conduct Committee (the "Conduct Committee") is responsible for clarifying the standards of acceptable behavior. The Conduct Committee takes appropriate and fair corrective action in response to any instances of unacceptable behavior. 45 | 46 | ## Scope 47 | 48 | This Code applies within all Project, Working Group, and Interest Group spaces and communication channels of the Eclipse Foundation (collectively, "Eclipse spaces"), within any Eclipse-organized event or meeting, and in public spaces when an individual is representing an Eclipse Foundation Project, Working Group, Interest Group, or their communities. Examples of representing a Project or community include posting via an official social media account, personal accounts, or acting as an appointed representative at an online or offline event. Representation of Projects, Working Groups, and Interest Groups may be further defined and clarified by Committers, Project Leads, or the Staff. 49 | 50 | ## Enforcement 51 | 52 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the Conduct Committee via . All complaints will be reviewed and investigated and will result in a response that is deemed necessary and appropriate to the circumstances. Without the explicit consent of the reporter, the Conduct Committee is obligated to maintain confidentiality with regard to the reporter of an incident. The Conduct Committee is further obligated to ensure that the respondent is provided with sufficient information about the complaint to reply. If such details cannot be provided while maintaining confidentiality, the Conduct Committee will take the respondent‘s inability to provide a defense into account in its deliberations and decisions. Further details of enforcement guidelines may be posted separately. 53 | 54 | Staff, Committers and Project Leads have the right to report, remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code, or to block temporarily or permanently any Contributor for other behaviors that they deem inappropriate, threatening, offensive, or harmful. Any such actions will be reported to the Conduct Committee for transparency and record keeping. 55 | 56 | Any Staff (including officers and directors of the Eclipse Foundation), Committers, Project Leads, or Conduct Committee members who are the subject of a complaint to the Conduct Committee will be recused from the process of resolving any such complaint. 57 | 58 | ## Responsibility 59 | 60 | The responsibility for administering this Code rests with the Conduct Committee, with oversight by the Executive Director and the Board of Directors. For additional information on the Conduct Committee and its process, please write to . 61 | 62 | ## Investigation of Potential Code Violations 63 | 64 | All conflict is not bad as a healthy debate may sometimes be necessary to push us to do our best. It is, however, unacceptable to be disrespectful or offensive, or violate this Code. If you see someone engaging in objectionable behavior violating this Code, we encourage you to address the behavior directly with those involved. If for some reason, you are unable to resolve the matter or feel uncomfortable doing so, or if the behavior is threatening or harassing, please report it following the procedure laid out below. 65 | 66 | Reports should be directed to . It is the Conduct Committee’s role to receive and address reported violations of this Code and to ensure a fair and speedy resolution. 67 | 68 | The Eclipse Foundation takes all reports of potential Code violations seriously and is committed to confidentiality and a full investigation of all allegations. The identity of the reporter will be omitted from the details of the report supplied to the accused. Contributors who are being investigated for a potential Code violation will have an opportunity to be heard prior to any final determination. Those found to have violated the Code can seek reconsideration of the violation and disciplinary action decisions. Every effort will be made to have all matters disposed of within 60 days of the receipt of the complaint. 69 | 70 | ## Actions 71 | Contributors who do not follow this Code in good faith may face temporary or permanent repercussions as determined by the Conduct Committee. 72 | 73 | This Code does not address all conduct. It works in conjunction with our [Communication Channel Guidelines](https://www.eclipse.org/org/documents/communication-channel-guidelines/), [Social Media Guidelines](https://www.eclipse.org/org/documents/social_media_guidelines.php), [Bylaws](https://www.eclipse.org/org/documents/eclipse-foundation-be-bylaws-en.pdf), and [Internal Rules](https://www.eclipse.org/org/documents/ef-be-internal-rules.pdf) which set out additional protections for, and obligations of, all contributors. The Foundation has additional policies that provide further guidance on other matters. 74 | 75 | It’s impossible to spell out every possible scenario that might be deemed a violation of this Code. Instead, we rely on one another’s good judgment to uphold a high standard of integrity within all Eclipse Spaces. Sometimes, identifying the right thing to do isn’t an easy call. In such a scenario, raise the issue as early as possible. 76 | 77 | ## No Retaliation 78 | 79 | The Eclipse community relies upon and values the help of Contributors who identify potential problems that may need to be addressed within an Eclipse Space. Any retaliation against a Contributor who raises an issue honestly is a violation of this Code. That a Contributor has raised a concern honestly or participated in an investigation, cannot be the basis for any adverse action, including threats, harassment, or discrimination. If you work with someone who has raised a concern or provided information in an investigation, you should continue to treat the person with courtesy and respect. If you believe someone has retaliated against you, report the matter as described by this Code. Honest reporting does not mean that you have to be right when you raise a concern; you just have to believe that the information you are providing is accurate. 80 | 81 | False reporting, especially when intended to retaliate or exclude, is itself a violation of this Code and will not be accepted or tolerated. 82 | 83 | Everyone is encouraged to ask questions about this Code. Your feedback is welcome, and you will get a response within three business days. Write to . 84 | 85 | ## Amendments 86 | 87 | The Eclipse Foundation Board of Directors may amend this Code from time to time and may vary the procedures it sets out where appropriate in a particular case. 88 | 89 | ### Attribution 90 | 91 | This Code was inherited from [Eclipse Foundation Code of Conduct](https://www.eclipse.org/org/documents/Community_Code_of_Conduct.php) and inspired by the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4, available [here](https://www.contributor-covenant.org/version/1/4/code-of-conduct/). 92 | 93 | [^1]: Capitalized terms used herein without definition shall have the meanings assigned to them in the Eclipse Bylaws. 94 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # How to Contribute to Eclipse Velocitas Vehicle App Python Template 2 | 3 | First of all, thanks for considering to contribute to Eclipse Velocitas. We really 4 | appreciate the time and effort you want to spend helping to improve things around here. 5 | 6 | In order to get you started as fast as possible we need to go through some organizational issues first, though. 7 | 8 | ## Eclipse Contributor Agreement 9 | 10 | Before your contribution can be accepted by the project team contributors must 11 | electronically sign the Eclipse Contributor Agreement (ECA). 12 | 13 | * http://www.eclipse.org/legal/ECA.php 14 | 15 | Commits that are provided by non-committers must have a Signed-off-by field in 16 | the footer indicating that the author is aware of the terms by which the 17 | contribution has been provided to the project. The non-committer must 18 | additionally have an Eclipse Foundation account and must have a signed Eclipse 19 | Contributor Agreement (ECA) on file. 20 | 21 | For more information, please see the Eclipse Committer Handbook: 22 | https://www.eclipse.org/projects/handbook/#resources-commit 23 | 24 | ## Code Style Guide 25 | * Use [Ruff](https://docs.astral.sh/ruff/) to format your code. 26 | * Use [mypy](https://mypy.readthedocs.io/) to check for type errors. 27 | * Above and other tools will run automatically if you install 28 | [pre-commit](https://pre-commit.com/) using the instructions below. 29 | 30 | ## Making Your Changes 31 | 32 | * Fork the repository on GitHub. 33 | * Create a new branch for your changes. 34 | * Install dependencies: 35 | 36 | ```bash 37 | pip3 install -r requirements.txt 38 | ``` 39 | * Make your changes following the code style guide (see Code Style Guide section above). 40 | * When you create new files make sure you include a proper license header at the top of the file (see License Header section below). 41 | * Install and run [pre-commit](https://pre-commit.com/) to automatically check for style guide issues. 42 | ```bash 43 | pre-commit install 44 | pre-commit run --all-files 45 | ``` 46 | > **_NOTE:_** Or just use task `Local - Pre Commit Action` by pressing `F1` and select `Tasks - Run Task` 47 | * Make sure the unit and integration test suites passes after your changes. 48 | * Commit your changes into that branch. 49 | * Use descriptive and meaningful commit messages. Start the first line of the commit message with the issue number and title e.g. `[#9865] Add token based authentication`. 50 | * Squash multiple commits that are related to each other semantically into a single one. 51 | * Make sure you use the `-s` flag when committing as explained above. 52 | * Push your changes to your branch in your forked repository. 53 | 54 | ## Python Dependency Management 55 | 56 | In this project, the [pip-tools](https://github.com/jazzband/pip-tools) are used to manage the python dependencies and to keep all packages up-to-date. The required pip-based dependencies of this project are defined in multiple `requirement` input files. 57 | 58 | ### Vehicle app runtime dependencies 59 | * The [./app/requirements.in](./app/requirements.in) file is the requirement input file that used to generate the Vehicle app runtime requirements file [./app/requirements.txt](./app/requirements.txt) 60 | 61 | ### Unit and Integration testing dependencies 62 | * The [./app/tests/requirements.in](./app/tests/requirements.in) file is the requirement input file that used to generate the testing requirements file [./app/tests/requirements.txt](./app/tests/requirements.txt). The test requirements file needs to be installed for the development container to execute the unit and integration tests as well as in the CI Workflow test execution. 63 | 64 | ### Development tools dependencies 65 | * The [./requirements.in](./requirements.in) file is the requirement input file that used to generate requirements file [./requirements.txt](./requirements.txt) for the other development tools. The development requirements list includes all the necessary packages testing and development tools packages and need to be installed before start contributing to the project. The development requirements (i.e. [./requirements.in](./requirements.in) are also aligned with the testing and runtime requirements for better dependency conflict management with the specified constrains. 66 | 67 | The process to manage the dependencies of this project can be summarized as following: 68 | * The `pip-compile` tool will generate the corresponding python `requirements`. When executing this tools for a specific requirements input file, the python `"requirements<>.txt"` file will be updated with all underlying dependencies. The command below shall be executed every time a new python package is added to the project and/or to bump the package versions. 69 | 70 | ```bash 71 | pip-compile <> 72 | ``` 73 | 74 | * Run `pip-sync` or `pip install` to install the required dependencies from all requirement files alternatively. 75 | ```bash 76 | pip-sync <> 77 | ``` 78 | ```bash 79 | pip3 install -r <> 80 | ``` 81 | 82 | If there are any other `non public python dependencies` (E.g. GitHub links), they shall not be added to the requirement files directly. Instead, they must be added to the [requirements-links.txt](./app/requirements-links.txt). 83 | 84 | > **_NOTE:_** `Please don't try to update the versions of the dependencies manually.` 85 | 86 | ## License Header 87 | 88 | Please make sure any file you newly create contains a proper license header like this: 89 | 90 | ```python 91 | # Copyright (c) Contributors to the Eclipse Foundation 92 | # 93 | # This program and the accompanying materials are made available under the 94 | # terms of the Apache License, Version 2.0 which is available at 95 | # https://www.apache.org/licenses/LICENSE-2.0. 96 | # 97 | # Unless required by applicable law or agreed to in writing, software 98 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 99 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 100 | # License for the specific language governing permissions and limitations 101 | # under the License. 102 | # 103 | # SPDX-License-Identifier: Apache-2.0 104 | ``` 105 | Please adjusted the comment character to the specific file format. 106 | 107 | ## Submitting the Changes 108 | 109 | Submit a pull request via the normal GitHub UI. 110 | 111 | ## After Submitting 112 | 113 | * Do not use your branch for any other development, otherwise further changes that you make will be visible in the PR. 114 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /NOTICE-3RD-PARTY-CONTENT.md: -------------------------------------------------------------------------------- 1 | # Licenses Notice 2 | *Note*: This file is auto-generated. Do not modify it manually. 3 | ## Python 4 | | Dependency | Version | License | 5 | |:-----------|:-------:|--------:| 6 | |aiohappyeyeballs|2.5.0|Python Software Foundation License| 7 | |aiohttp|3.10.11|Apache 2.0| 8 | |aiosignal|1.3.2|Apache 2.0| 9 | |async-timeout|5.0.1|Apache 2.0| 10 | |attrs|25.1.0|unknown| 11 | |build|1.2.2.post1|MIT| 12 | |cfgv|3.4.0|MIT| 13 | |click|8.1.8|BSD| 14 | |cloudevents|1.11.0|Apache 2.0| 15 | |coverage|7.6.12|Apache 2.0| 16 | |Deprecated|1.2.18|MIT| 17 | |deprecation|2.1.0|Apache 2.0| 18 | |distlib|0.3.9|Python Software Foundation License| 19 | |exceptiongroup|1.2.2|MIT| 20 | |filelock|3.17.0|The Unlicense (Unlicense)| 21 | |frozenlist|1.5.0|Apache 2.0| 22 | |grpcio|1.64.1|Apache 2.0| 23 | |identify|2.6.9|MIT| 24 | |idna|3.10|BSD| 25 | |importlib-metadata|7.1.0|Apache 2.0| 26 | |iniconfig|2.0.0|MIT| 27 | |multidict|6.1.0|Apache 2.0| 28 | |mypy|1.15.0|MIT| 29 | |mypy-extensions|1.0.0|MIT| 30 | |mypy-protobuf|3.6.0|Apache 2.0| 31 | |nodeenv|1.9.1|BSD| 32 | |opentelemetry-api|1.25.0|Apache 2.0| 33 | |opentelemetry-distro|0.46b0|Apache 2.0| 34 | |opentelemetry-instrumentation|0.46b0|Apache 2.0| 35 | |opentelemetry-instrumentation-logging|0.46b0|Apache 2.0| 36 | |opentelemetry-sdk|1.25.0|Apache 2.0| 37 | |opentelemetry-semantic-conventions|0.46b0|Apache 2.0| 38 | |packaging|24.2|Apache 2.0
BSD| 39 | |paho-mqtt|2.1.0|OSI Approved| 40 | |parameterized|0.9.0|Simplified BSD| 41 | |pip|23.0.1|MIT| 42 | |pip-tools|7.4.1|BSD| 43 | |platformdirs|4.3.6|MIT| 44 | |pluggy|1.5.0|MIT| 45 | |pre-commit|4.1.0|MIT| 46 | |propcache|0.3.0|Apache 2.0| 47 | |protobuf|5.27.2|Google License| 48 | |pyproject-hooks|1.2.0|MIT| 49 | |pytest|8.3.5|MIT| 50 | |pytest-asyncio|0.25.3|Apache 2.0| 51 | |pytest-cov|6.0.0|MIT| 52 | |pytest-ordering|0.6|MIT| 53 | |PyYAML|6.0.2|MIT| 54 | |setuptools|65.5.1|MIT| 55 | |tomli|2.2.1|MIT| 56 | |types-mock|5.1.0.20240425|Apache 2.0| 57 | |types-protobuf|5.29.1.20250208|Apache 2.0| 58 | |typing-extensions|4.12.2|Python Software Foundation License| 59 | |velocitas-sdk|0.15.5|Apache 2.0| 60 | |virtualenv|20.29.3|MIT| 61 | |wheel|0.45.1|MIT| 62 | |wrapt|1.17.2|BSD| 63 | |yarl|1.18.3|Apache 2.0| 64 | |zipp|3.21.0|MIT| 65 | ## Workflows 66 | | Dependency | Version | License | 67 | |:-----------|:-------:|--------:| 68 | |actions/checkout|v4|MIT License| 69 | |actions/download-artifact|v4|MIT License| 70 | |actions/setup-java|v4|MIT License| 71 | |actions/setup-node|v4|MIT License| 72 | |actions/setup-python|v5|MIT License| 73 | |actions/upload-artifact|v4|MIT License| 74 | |aquasecurity/trivy-action|0.19.0|Apache License 2.0| 75 | |ASzc/change-string-case-action|v6|ISC License| 76 | |dawidd6/action-download-artifact|v6|MIT License| 77 | |de-vri-es/setup-git-credentials|v2|BSD 2-Clause "Simplified" License| 78 | |devcontainers/ci|v0.3|MIT License| 79 | |docker/build-push-action|v5|Apache License 2.0| 80 | |docker/login-action|v3|Apache License 2.0| 81 | |docker/setup-buildx-action|v3|Apache License 2.0| 82 | |docker/setup-qemu-action|v3|Apache License 2.0| 83 | |fountainhead/action-wait-for-check|v1.2.0|MIT License| 84 | |haya14busa/action-cond|v1|MIT License| 85 | |irongut/CodeCoverageSummary|v1.3.0|MIT License| 86 | |mikepenz/action-junit-report|v4|Apache License 2.0| 87 | |peaceiris/actions-gh-pages|v4|MIT License| 88 | |peaceiris/actions-hugo|v3|MIT License| 89 | |pre-commit/action|v3.0.1|MIT License| 90 | |softprops/action-gh-release|v2|MIT License| 91 | -------------------------------------------------------------------------------- /NOTICE.md: -------------------------------------------------------------------------------- 1 | ## Declared Project Licenses 2 | 3 | This program and the accompanying materials are made available under the terms of the Apache License, Version 2.0 which is available at https://www.apache.org/licenses/LICENSE-2.0. 4 | 5 | SPDX-License-Identifier: Apache-2.0 6 | 7 | ## Contributors: 8 | * Robert Bosch GmbH - initial API and implementation 9 | * Microsoft Corporation - initial API and implementation 10 | 11 | ## Third-party Content 12 | 13 | ### Devcontainer 14 | 15 | | Software | License | 16 | | :------------------ | :--------------------------------------------------------------------------------------------------------------- | 17 | | Python | https://docs.python.org/3/license.html | 18 | | Mosquitto | https://github.com/eclipse/mosquitto/blob/master/LICENSE.txt | 19 | 20 | ### Development 21 | | Software | License | 22 | | :------: | :------------------------------------------------------------------: | 23 | | GRPC | https://github.com/grpc/grpc/blob/master/LICENSE | 24 | | Pre-Commit | https://github.com/pre-commit/pre-commit/blob/main/LICENSE | 25 | | Mypy | https://github.com/python/mypy/blob/master/LICENSE | 26 | | Ruff | https://raw.githubusercontent.com/astral-sh/ruff/main/LICENSE | 27 | 28 | ### Further 3rd party licenses used in project 29 | * [Auto-generated 3rd party licenses](./NOTICE-3RD-PARTY-CONTENT.md) 30 | * [Full list of dependencies in the devcontainer base-image](https://github.com/eclipse-velocitas/devcontainer-base-images/tree/sbom/SBOM/Markdown) 31 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | > Note: 2 | This is a template repository to kickstart the creation of a Python Vehicle App. Please create your own repository from this template repository by clicking the green button [`Use this template`](https://github.com/eclipse-velocitas/vehicle-app-python-template). 3 | 4 | # Vehicle App Development using Python 5 | 6 | ![CI Workflow](https://github.com/eclipse-velocitas/vehicle-app-python-template/actions/workflows/ci.yml/badge.svg#branch=main) 7 | [![License: Apache](https://img.shields.io/badge/License-Apache-yellow.svg)](http://www.apache.org/licenses/LICENSE-2.0) 8 | 9 | This repository provides you with a complete development environment for your own Vehicle App based on the [Software defined vehicle platform](https://sdv.eclipse.org/) including a sample Vehicle App using the [Vehicle App Python SDK](https://github.com/eclipse-velocitas/vehicle-app-python-sdk). The development environment uses the [Development Container](https://code.visualstudio.com/docs/remote/create-dev-container#:~:text=%20Create%20a%20development%20container%20%201%20Path,additional%20software%20in%20your%20dev%20container.%20More%20) feature of Visual Studio Code. 10 | 11 | ## Documentation 12 | * [Velocitas Development Model](https://eclipse.dev/velocitas/docs/concepts/development_model/) 13 | * [Vehicle App SDK Overview](https://eclipse.dev/velocitas/docs/concepts/development_model/vehicle_app_sdk/) 14 | 15 | ## Quickstart Tutorials 16 | 1. [Setup and Explore Development Environment](https://eclipse.dev/velocitas/docs/tutorials/quickstart/) 17 | 1. [Develop your own Vehicle Model](https://eclipse.dev/velocitas/docs/tutorials/vehicle_model_creation/) 18 | 1. [Develop your own Vehicle App](https://eclipse.dev/velocitas/docs/tutorials/vehicle_app_development/) 19 | 20 | ## Contribution 21 | - [GitHub Issues](https://github.com/eclipse-velocitas/vehicle-app-python-template/issues) 22 | - [Mailing List](https://accounts.eclipse.org/mailing-list/velocitas-dev) 23 | - [Contribution](CONTRIBUTING.md) 24 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | 2 | _ISO 27005 defines vulnerability as: 3 | "A weakness of an asset or group of assets that can be exploited by one or more threats."_ 4 | 5 | ## The Eclipse Security Team 6 | 7 | The Eclipse Security Team provides help and advice to Eclipse projects 8 | on vulnerability issues and is the first point of contact 9 | for handling security vulnerabilities. 10 | Members of the Security Team are committers on Eclipse Projects 11 | and members of the Eclipse Architecture Council. 12 | 13 | Contact the [Eclipse Security Team](mailto:security@eclipse.org). 14 | 15 | **Note that, as a matter of policy, the security team does not open attachments.** 16 | 17 | ## Reporting a Security Vulnerability 18 | 19 | Vulnerabilities can be reported either via email to the Eclipse Security Team 20 | or directly with a project via the Eclipse Foundation's Bugzilla instance. 21 | 22 | The general security mailing list address is security@eclipse.org. 23 | Members of the Eclipse Security Team will receive messages sent to this address. 24 | This address should be used only for reporting undisclosed vulnerabilities; 25 | regular issue reports and questions unrelated to vulnerabilities in Eclipse software 26 | will be ignored. 27 | Note that this email address is not encrypted. 28 | 29 | The community is also encouraged to report vulnerabilities using the 30 | [Eclipse Foundation's Bugzilla instance](https://bugs.eclipse.org/bugs/enter_bug.cgi?product=Community&component=Vulnerability%20Reports&keywords=security&groups=Security_Advisories). 31 | Note that you will require an Eclipse Foundation account to create an issue report, 32 | but by doing so you will be able to participate directly in the resolution of the issue. 33 | 34 | Issue reports related to vulnerabilities must be marked as "committers-only", 35 | either automatically by clicking the provided link, by the reporter, 36 | or by a committer during the triage process. 37 | Note that issues marked "committers-only" are visible to all Eclipse committers. 38 | By default, a "committers-only" issue is also accessible to the reporter 39 | and individuals explicitly indicated in the "cc" list. 40 | 41 | ## Disclosure 42 | 43 | Disclosure is initially limited to the reporter and all Eclipse Committers, 44 | but is expanded to include other individuals, and the general public. 45 | The timing and manner of disclosure is governed by the 46 | [Eclipse Security Policy](https://www.eclipse.org/security/policy.php). 47 | 48 | Publicly disclosed issues are listed on the 49 | [Disclosed Vulnerabilities Page](https://www.eclipse.org/security/known.php). 50 | -------------------------------------------------------------------------------- /app/AppManifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "manifestVersion": "v3", 3 | "name": "SampleApp", 4 | "interfaces": [ 5 | { 6 | "type": "vehicle-signal-interface", 7 | "config": { 8 | "src": "https://github.com/COVESA/vehicle_signal_specification/releases/download/v4.0/vss_rel_4.0.json", 9 | "datapoints": { 10 | "required": [ 11 | { 12 | "path": "Vehicle.Speed", 13 | "access": "read" 14 | } 15 | ] 16 | } 17 | } 18 | }, 19 | { 20 | "type": "pubsub", 21 | "config": { 22 | "reads": [ 23 | "sampleapp/getSpeed" 24 | ], 25 | "writes": [ 26 | "sampleapp/getSpeed/response", 27 | "sampleapp/currentSpeed" 28 | ] 29 | } 30 | } 31 | ] 32 | } 33 | -------------------------------------------------------------------------------- /app/Dockerfile: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | # syntax=docker/dockerfile:1.2 16 | 17 | # Build stage, to create the executable 18 | FROM --platform=$TARGETPLATFORM ghcr.io/eclipse-velocitas/devcontainer-base-images/python:v0.3 AS builder 19 | ARG TARGETARCH 20 | 21 | RUN apt-get update && apt-get install -y python3-dev 22 | 23 | COPY ./.velocitas.json /workspace/.velocitas.json 24 | COPY ./app /workspace/app 25 | 26 | # Remove this installation for Arm64 once staticx has a prebuilt wheel for Arm64 27 | RUN /bin/bash -c 'set -ex && \ 28 | ARCH=`uname -m` && \ 29 | if [ "$ARCH" == "aarch64" ]; then \ 30 | echo "ARM64" && \ 31 | apt-get install -y gcc && \ 32 | pip3 install --no-cache-dir scons; \ 33 | fi' 34 | 35 | RUN pip3 install --no-cache-dir pyinstaller==5.9.0 \ 36 | && pip3 install --no-cache-dir patchelf==0.17.0.0 \ 37 | && pip3 install --no-cache-dir staticx \ 38 | && pip3 install --no-cache-dir -r ./workspace/app/requirements.txt \ 39 | && pip3 install --no-cache-dir -r ./workspace/app/requirements-links.txt 40 | 41 | WORKDIR /workspace 42 | 43 | RUN velocitas init 44 | 45 | WORKDIR /workspace/app 46 | 47 | RUN pyinstaller --clean -F -s src/main.py 48 | 49 | WORKDIR /workspace/app/dist 50 | 51 | RUN staticx --strip main run-exe 52 | 53 | # Runner stage, to copy the executable 54 | FROM scratch AS runner 55 | 56 | COPY --from=builder ./workspace/app/dist/run-exe /app 57 | 58 | WORKDIR /tmp 59 | 60 | ENV PATH="/:$PATH" 61 | 62 | LABEL org.opencontainers.image.source="https://github.com/eclipse-velocitas/vehicle-app-python-template" 63 | 64 | CMD ["/app"] 65 | -------------------------------------------------------------------------------- /app/requirements-links.txt: -------------------------------------------------------------------------------- 1 | # velocitas SDK now installed via 'sdk-installer' Velocitas component. 2 | -------------------------------------------------------------------------------- /app/requirements.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | velocitas-sdk==0.15.5 16 | -------------------------------------------------------------------------------- /app/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.10 3 | # by the following command: 4 | # 5 | # pip-compile app/requirements.in 6 | # 7 | aiohappyeyeballs==2.5.0 8 | # via aiohttp 9 | aiohttp==3.10.11 10 | # via velocitas-sdk 11 | aiosignal==1.3.2 12 | # via aiohttp 13 | async-timeout==5.0.1 14 | # via aiohttp 15 | attrs==25.1.0 16 | # via aiohttp 17 | cloudevents==1.11.0 18 | # via velocitas-sdk 19 | deprecated==1.2.18 20 | # via opentelemetry-api 21 | deprecation==2.1.0 22 | # via cloudevents 23 | frozenlist==1.5.0 24 | # via 25 | # aiohttp 26 | # aiosignal 27 | grpcio==1.64.1 28 | # via velocitas-sdk 29 | idna==3.10 30 | # via yarl 31 | importlib-metadata==7.1.0 32 | # via opentelemetry-api 33 | multidict==6.1.0 34 | # via 35 | # aiohttp 36 | # yarl 37 | opentelemetry-api==1.25.0 38 | # via 39 | # opentelemetry-distro 40 | # opentelemetry-instrumentation 41 | # opentelemetry-instrumentation-logging 42 | # opentelemetry-sdk 43 | # opentelemetry-semantic-conventions 44 | # velocitas-sdk 45 | opentelemetry-distro==0.46b0 46 | # via velocitas-sdk 47 | opentelemetry-instrumentation==0.46b0 48 | # via 49 | # opentelemetry-distro 50 | # opentelemetry-instrumentation-logging 51 | opentelemetry-instrumentation-logging==0.46b0 52 | # via velocitas-sdk 53 | opentelemetry-sdk==1.25.0 54 | # via 55 | # opentelemetry-distro 56 | # velocitas-sdk 57 | opentelemetry-semantic-conventions==0.46b0 58 | # via opentelemetry-sdk 59 | packaging==24.2 60 | # via deprecation 61 | paho-mqtt==2.1.0 62 | # via velocitas-sdk 63 | propcache==0.3.0 64 | # via yarl 65 | protobuf==5.27.2 66 | # via velocitas-sdk 67 | typing-extensions==4.12.2 68 | # via 69 | # multidict 70 | # opentelemetry-sdk 71 | velocitas-sdk==0.15.5 72 | # via -r app/requirements.in 73 | wrapt==1.17.2 74 | # via 75 | # deprecated 76 | # opentelemetry-instrumentation 77 | yarl==1.18.3 78 | # via aiohttp 79 | zipp==3.21.0 80 | # via importlib-metadata 81 | 82 | # The following packages are considered to be unsafe in a requirements file: 83 | # setuptools 84 | -------------------------------------------------------------------------------- /app/src/main.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | """A sample skeleton vehicle app.""" 16 | 17 | import asyncio 18 | import json 19 | import logging 20 | import signal 21 | 22 | from vehicle import Vehicle, vehicle # type: ignore 23 | from velocitas_sdk.util.log import ( # type: ignore 24 | get_opentelemetry_log_factory, 25 | get_opentelemetry_log_format, 26 | ) 27 | from velocitas_sdk.vdb.reply import DataPointReply 28 | from velocitas_sdk.vehicle_app import VehicleApp, subscribe_topic 29 | 30 | # Configure the VehicleApp logger with the necessary log config and level. 31 | logging.setLogRecordFactory(get_opentelemetry_log_factory()) 32 | logging.basicConfig(format=get_opentelemetry_log_format()) 33 | logging.getLogger().setLevel("DEBUG") 34 | logger = logging.getLogger(__name__) 35 | 36 | GET_SPEED_REQUEST_TOPIC = "sampleapp/getSpeed" 37 | GET_SPEED_RESPONSE_TOPIC = "sampleapp/getSpeed/response" 38 | DATABROKER_SUBSCRIPTION_TOPIC = "sampleapp/currentSpeed" 39 | 40 | 41 | class SampleApp(VehicleApp): 42 | """ 43 | Sample skeleton vehicle app. 44 | 45 | The skeleton subscribes to a getSpeed MQTT topic 46 | to listen for incoming requests to get 47 | the current vehicle speed and publishes it to 48 | a response topic. 49 | 50 | It also subcribes to the VehicleDataBroker 51 | directly for updates of the 52 | Vehicle.Speed signal and publishes this 53 | information via another specific MQTT topic 54 | """ 55 | 56 | def __init__(self, vehicle_client: Vehicle): 57 | # SampleApp inherits from VehicleApp. 58 | super().__init__() 59 | self.Vehicle = vehicle_client 60 | 61 | async def on_start(self): 62 | """Run when the vehicle app starts""" 63 | # This method will be called by the SDK when the connection to the 64 | # Vehicle DataBroker is ready. 65 | # Here you can subscribe for the Vehicle Signals update (e.g. Vehicle Speed). 66 | await self.Vehicle.Speed.subscribe(self.on_speed_change) 67 | 68 | async def on_speed_change(self, data: DataPointReply): 69 | """The on_speed_change callback, this will be executed when receiving a new 70 | vehicle signal updates.""" 71 | # Get the current vehicle speed value from the received DatapointReply. 72 | # The DatapointReply containes the values of all subscribed DataPoints of 73 | # the same callback. 74 | vehicle_speed = data.get(self.Vehicle.Speed).value 75 | 76 | # Do anything with the received value. 77 | # Example: 78 | # - Publishes current speed to MQTT Topic (i.e. DATABROKER_SUBSCRIPTION_TOPIC). 79 | await self.publish_event( 80 | DATABROKER_SUBSCRIPTION_TOPIC, 81 | json.dumps({"speed": vehicle_speed}), 82 | ) 83 | 84 | @subscribe_topic(GET_SPEED_REQUEST_TOPIC) 85 | async def on_get_speed_request_received(self, data: str) -> None: 86 | """The subscribe_topic annotation is used to subscribe for incoming 87 | PubSub events, e.g. MQTT event for GET_SPEED_REQUEST_TOPIC. 88 | """ 89 | 90 | # Use the logger with the preferred log level (e.g. debug, info, error, etc) 91 | logger.debug( 92 | "PubSub event for the Topic: %s -> is received with the data: %s", 93 | GET_SPEED_REQUEST_TOPIC, 94 | data, 95 | ) 96 | 97 | # Getting current speed from VehicleDataBroker using the DataPoint getter. 98 | vehicle_speed = (await self.Vehicle.Speed.get()).value 99 | 100 | # Do anything with the speed value. 101 | # Example: 102 | # - Publishes the vehicle speed to MQTT topic (i.e. GET_SPEED_RESPONSE_TOPIC). 103 | await self.publish_event( 104 | GET_SPEED_RESPONSE_TOPIC, 105 | json.dumps( 106 | { 107 | "result": { 108 | "status": 0, 109 | "message": f"""Current Speed = {vehicle_speed}""", 110 | }, 111 | } 112 | ), 113 | ) 114 | 115 | 116 | async def main(): 117 | """Main function""" 118 | logger.info("Starting SampleApp...") 119 | # Constructing SampleApp and running it. 120 | vehicle_app = SampleApp(vehicle) 121 | await vehicle_app.run() 122 | 123 | 124 | LOOP = asyncio.get_event_loop() 125 | LOOP.add_signal_handler(signal.SIGTERM, LOOP.stop) 126 | LOOP.run_until_complete(main()) 127 | LOOP.close() 128 | -------------------------------------------------------------------------------- /app/tests/integration/integration_test.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | import json 16 | 17 | import pytest 18 | from velocitas_sdk.test.inttesthelper import IntTestHelper 19 | from velocitas_sdk.test.mqtt_util import MqttClient 20 | 21 | # GET_SPEED_REQUEST_TOPIC = "sampleapp/getSpeed" 22 | # GET_SPEED_RESPONSE_TOPIC = "sampleapp/getSpeed/response" 23 | 24 | 25 | @pytest.mark.asyncio 26 | async def test_get_current_speed(): 27 | mqtt_client = MqttClient() 28 | inttesthelper = IntTestHelper() 29 | print(f"{mqtt_client} can be used when your app compiles succesfully!") 30 | print(f"{inttesthelper} can be used when your app compiles succesfully!") 31 | 32 | # When your app compiles succesfully use the inttesthelper to get viable responses 33 | response = "{}" 34 | # response = await inttesthelper.set_float_datapoint( 35 | # name="Vehicle.Speed", value=0 36 | # ) 37 | 38 | # assert len(response.errors) == 0 39 | 40 | # response = mqtt_client.publish_and_wait_for_response( 41 | # request_topic=GET_SPEED_REQUEST_TOPIC, 42 | # response_topic=GET_SPEED_RESPONSE_TOPIC, 43 | # payload={}, 44 | # ) 45 | 46 | body = json.loads(response) 47 | # add expected message to get it assert 48 | expected_message = "Current Speed = 0.0" 49 | 50 | print(f"Received response: {body}") 51 | print(f"Expected message: {expected_message}") 52 | 53 | # Uncomment to test the behaviour of the SampleApp as provided by 54 | # the template repository: 55 | # assert body["result"]["status"] == 0 56 | # assert body["result"]["message"] == expected_message 57 | -------------------------------------------------------------------------------- /app/tests/requirements.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2024-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | pytest 16 | pytest-ordering 17 | pytest-asyncio 18 | pytest-cov 19 | types-mock 20 | -------------------------------------------------------------------------------- /app/tests/requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.10 3 | # by the following command: 4 | # 5 | # pip-compile app/tests/requirements.in 6 | # 7 | coverage[toml]==7.6.12 8 | # via pytest-cov 9 | exceptiongroup==1.2.2 10 | # via pytest 11 | iniconfig==2.0.0 12 | # via pytest 13 | packaging==24.2 14 | # via pytest 15 | pluggy==1.5.0 16 | # via pytest 17 | pytest==8.3.5 18 | # via 19 | # -r app/tests/requirements.in 20 | # pytest-asyncio 21 | # pytest-cov 22 | # pytest-ordering 23 | pytest-asyncio==0.25.3 24 | # via -r app/tests/requirements.in 25 | pytest-cov==6.0.0 26 | # via -r app/tests/requirements.in 27 | pytest-ordering==0.6 28 | # via -r app/tests/requirements.in 29 | tomli==2.2.1 30 | # via 31 | # coverage 32 | # pytest 33 | types-mock==5.1.0.20240425 34 | # via -r app/tests/requirements.in 35 | -------------------------------------------------------------------------------- /app/tests/unit/test_run.py: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2022-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | # skip B101 16 | 17 | 18 | MOCKED_SPEED = 0.0 19 | 20 | 21 | def test_dummy(): 22 | pass 23 | 24 | 25 | # @pytest.mark.asyncio 26 | # async def test_for_get_speed(): 27 | # result = TypedDataPointResult("foo", MOCKED_SPEED, Timestamp(seconds=10, nanos=0)) 28 | 29 | # with mock.patch.object( 30 | # vehicle.Speed, 31 | # "get", 32 | # new_callable=mock.AsyncMock, 33 | # return_value=result, 34 | # ): 35 | # current_speed = (await vehicle.Speed.get()).value 36 | # print(f"Received speed: {current_speed}") 37 | # # Uncomment to test the behaviour of the SampleApp as provided by 38 | # # the template repository: 39 | # # assert current_speed == MOCKED_SPEED 40 | 41 | 42 | # @pytest.mark.asyncio 43 | # async def test_for_publish_to_topic(): 44 | # with mock.patch.object( 45 | # VehicleApp, "publish_mqtt_event", new_callable=mock.AsyncMock, return_value=-1 46 | # ): 47 | # response = await VehicleApp.publish_mqtt_event( 48 | # str("sampleTopic"), # type: ignore 49 | # get_sample_response_data(), 50 | # ) 51 | 52 | # print(f"Received response: {response}") 53 | # # Uncomment to test the behaviour of the SampleApp as provided by 54 | # # the template repository: 55 | # # assert response == -1 56 | 57 | 58 | def get_sample_response_data(): 59 | return { 60 | "result": { 61 | "message": f"""Current Speed = {MOCKED_SPEED}""", 62 | }, 63 | } 64 | -------------------------------------------------------------------------------- /license_header.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2024 Contributors to the Eclipse Foundation 2 | 3 | This program and the accompanying materials are made available under the 4 | terms of the Apache License, Version 2.0 which is available at 5 | https://www.apache.org/licenses/LICENSE-2.0. 6 | 7 | Unless required by applicable law or agreed to in writing, software 8 | distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | License for the specific language governing permissions and limitations 11 | under the License. 12 | 13 | SPDX-License-Identifier: Apache-2.0 14 | -------------------------------------------------------------------------------- /requirements.in: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2023-2025 Contributors to the Eclipse Foundation 2 | # 3 | # This program and the accompanying materials are made available under the 4 | # terms of the Apache License, Version 2.0 which is available at 5 | # https://www.apache.org/licenses/LICENSE-2.0. 6 | # 7 | # Unless required by applicable law or agreed to in writing, software 8 | # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT 9 | # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the 10 | # License for the specific language governing permissions and limitations 11 | # under the License. 12 | # 13 | # SPDX-License-Identifier: Apache-2.0 14 | 15 | ########################################## 16 | # Import src and test requirements 17 | ########################################## 18 | -c app/requirements.txt 19 | -c app/tests/requirements.txt 20 | ########################################## 21 | # Development Tools Packages 22 | ########################################## 23 | mypy-protobuf 24 | pre-commit 25 | mypy 26 | pip-tools 27 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | # 2 | # This file is autogenerated by pip-compile with Python 3.10 3 | # by the following command: 4 | # 5 | # pip-compile requirements.in 6 | # 7 | build==1.2.2.post1 8 | # via pip-tools 9 | cfgv==3.4.0 10 | # via pre-commit 11 | click==8.1.8 12 | # via pip-tools 13 | distlib==0.3.9 14 | # via virtualenv 15 | filelock==3.17.0 16 | # via virtualenv 17 | identify==2.6.9 18 | # via pre-commit 19 | mypy==1.15.0 20 | # via -r requirements.in 21 | mypy-extensions==1.0.0 22 | # via mypy 23 | mypy-protobuf==3.6.0 24 | # via -r requirements.in 25 | nodeenv==1.9.1 26 | # via pre-commit 27 | packaging==24.2 28 | # via 29 | # -c /workspaces/vehicle-app-python-template/app/requirements.txt 30 | # -c /workspaces/vehicle-app-python-template/app/tests/requirements.txt 31 | # build 32 | pip-tools==7.4.1 33 | # via -r requirements.in 34 | platformdirs==4.3.6 35 | # via virtualenv 36 | pre-commit==4.1.0 37 | # via -r requirements.in 38 | protobuf==5.27.2 39 | # via 40 | # -c /workspaces/vehicle-app-python-template/app/requirements.txt 41 | # mypy-protobuf 42 | pyproject-hooks==1.2.0 43 | # via 44 | # build 45 | # pip-tools 46 | pyyaml==6.0.2 47 | # via pre-commit 48 | tomli==2.2.1 49 | # via 50 | # -c /workspaces/vehicle-app-python-template/app/tests/requirements.txt 51 | # build 52 | # mypy 53 | # pip-tools 54 | types-protobuf==5.29.1.20250208 55 | # via mypy-protobuf 56 | typing-extensions==4.12.2 57 | # via 58 | # -c /workspaces/vehicle-app-python-template/app/requirements.txt 59 | # mypy 60 | virtualenv==20.29.3 61 | # via pre-commit 62 | wheel==0.45.1 63 | # via pip-tools 64 | 65 | # The following packages are considered to be unsafe in a requirements file: 66 | # pip 67 | # setuptools 68 | -------------------------------------------------------------------------------- /setup.cfg: -------------------------------------------------------------------------------- 1 | [mypy] 2 | python_version = 3.10 3 | warn_unused_configs = True 4 | warn_redundant_casts = True 5 | show_error_codes = True 6 | check_untyped_defs = True 7 | install_types = False 8 | non_interactive = False 9 | namespace_packages = True 10 | exclude = gen/vehicle_model/* 11 | files = 12 | app/src/**/*.py 13 | 14 | [mypy-vehicle_model.proto.*] 15 | ignore_errors = True 16 | -------------------------------------------------------------------------------- /whitelisted-licenses.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eclipse-velocitas/vehicle-app-python-template/3cb649f794495a430a32c9407406a6ed43463d0f/whitelisted-licenses.txt --------------------------------------------------------------------------------