diff --git a/.dapr/config.yaml b/.dapr/config.yaml deleted file mode 100644 index e881bc33..00000000 --- a/.dapr/config.yaml +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation -# -# 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. -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. -# -# SPDX-License-Identifier: Apache-2.0 - -apiVersion: dapr.io/v1alpha1 -kind: Configuration -metadata: - name: config -spec: - tracing: - samplingRate: "1" - zipkin: - endpointAddress: http://localhost:9411/api/v2/spans - features: - - name: proxy.grpc - enabled: true diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 7f4dc0fc..8bb57279 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,4 +1,4 @@ -# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation +# Copyright (c) 2022-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the # terms of the Apache License, Version 2.0 which is available at @@ -12,16 +12,11 @@ # # SPDX-License-Identifier: Apache-2.0 -FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.2 +FROM ghcr.io/eclipse-velocitas/devcontainer-base-images/cpp:v0.3 ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE ENV REINSTALL_CMAKE_VERSION_FROM_SOURCE="${REINSTALL_CMAKE_VERSION_FROM_SOURCE:-none}" -# Force dapr to use localhost traffic -ENV DAPR_HOST_IP="127.0.0.1" -# Add daprd to the path for the VS Code Dapr extension. -ENV PATH=$PATH:/home/vscode/.dapr/bin - COPY scripts/*.sh /tmp/scripts/ RUN find /tmp/scripts/ -type f -iname "*.sh" -exec chmod +x {} \; RUN /bin/bash /tmp/scripts/configure-proxies.sh diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 9905ec81..8ae2a014 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -1,7 +1,8 @@ +// This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json // For format details, see https://aka.ms/devcontainer.json. For config options, see the README at: // https://github.com/microsoft/vscode-dev-containers/tree/v0.245.0/containers/cpp { - "name": "Vehicle App C++ SDK", + "name": "C++ vehicle sdk", "build": { "dockerfile": "Dockerfile" }, @@ -45,19 +46,7 @@ }, "vsmqtt.brokerProfiles": [ { - "name": "mosquitto (local)", - "host": "localhost", - "port": 1883, - "clientId": "vsmqtt_client" - }, - { - "name": "mosquitto (k3d)", - "host": "localhost", - "port": 31883, - "clientId": "vsmqtt_client" - }, - { - "name": "mosquitto (kanto)", + "name": "mosquitto", "host": "localhost", "port": 1883, "clientId": "vsmqtt_client" @@ -112,46 +101,14 @@ "tuple": "cpp", "type_traits": "cpp", "typeinfo": "cpp", - "utility": "cpp", - "any": "cpp", - "bitset": "cpp", - "cinttypes": "cpp", - "codecvt": "cpp", - "cstdarg": "cpp", - "cstddef": "cpp", - "forward_list": "cpp", - "set": "cpp", - "unordered_set": "cpp", - "algorithm": "cpp", - "iterator": "cpp", - "memory_resource": "cpp", - "numeric": "cpp", - "optional": "cpp", - "random": "cpp", - "fstream": "cpp", - "future": "cpp", - "iomanip": "cpp", - "ranges": "cpp", - "sstream": "cpp", - "valarray": "cpp", - "variant": "cpp", - "*.inc": "cpp", - "regex": "cpp", - "shared_mutex": "cpp", - "hash_map": "cpp", - "cfenv": "cpp", - "complex": "cpp", - "scoped_allocator": "cpp", - "typeindex": "cpp" + "utility": "cpp" } }, // Add the IDs of extensions you want installed when the container is created. "extensions": [ "ms-vscode.cpptools", "ms-vscode.cmake-tools", - "ms-azuretools.vscode-dapr", "rpdswtk.vsmqtt", - "ms-kubernetes-tools.vscode-kubernetes-tools", "bierner.markdown-mermaid", "cschlosser.doxdocgen", "xaver.clang-format", @@ -165,7 +122,8 @@ // Use 'forwardPorts' to make a list of ports inside the container available locally. // "forwardPorts": [], // Use 'onCreateCommand' to run commands when the container is created. - "onCreateCommand": "bash .devcontainer/scripts/post-create.sh", + "onCreateCommand": "bash .devcontainer/scripts/onCreateCommand.sh", + "postStartCommand": "bash .devcontainer/scripts/postStartCommand.sh", // Comment out to connect as root instead. More info: https://aka.ms/vscode-remote/containers/non-root. "remoteUser": "vscode" } diff --git a/.devcontainer/scripts/configure-proxies.sh b/.devcontainer/scripts/configure-proxies.sh index 6dd94aae..a74bb7a6 100755 --- a/.devcontainer/scripts/configure-proxies.sh +++ b/.devcontainer/scripts/configure-proxies.sh @@ -1,4 +1,5 @@ #!/bin/bash +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2022-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the diff --git a/.dapr/components/pubsub.yaml b/.devcontainer/scripts/container-set.sh old mode 100644 new mode 100755 similarity index 62% rename from .dapr/components/pubsub.yaml rename to .devcontainer/scripts/container-set.sh index 6ad5c302..2bdbf633 --- a/.dapr/components/pubsub.yaml +++ b/.devcontainer/scripts/container-set.sh @@ -1,3 +1,5 @@ +#!/bin/bash +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2022-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the @@ -12,20 +14,8 @@ # # SPDX-License-Identifier: Apache-2.0 -apiVersion: dapr.io/v1alpha1 -kind: Component -metadata: - name: mqtt-pubsub - namespace: default -spec: - type: pubsub.mqtt - version: v1 - metadata: - - name: url - value: "mqtt://localhost:1883" - - name: qos - value: 1 - - name: retain - value: "false" - - name: cleanSession - value: "false" +echo "#######################################################" +echo "### Checking container creation ###" +echo "#######################################################" +useradd vscode --password vscode -m +usermod -aG sudo vscode diff --git a/.devcontainer/scripts/post-create.sh b/.devcontainer/scripts/onCreateCommand.sh similarity index 89% rename from .devcontainer/scripts/post-create.sh rename to .devcontainer/scripts/onCreateCommand.sh index e60978d6..432ebbcc 100755 --- a/.devcontainer/scripts/post-create.sh +++ b/.devcontainer/scripts/onCreateCommand.sh @@ -1,4 +1,5 @@ -#!/usr/bin/env bash +#!/bin/bash +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2022-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the @@ -67,6 +68,12 @@ if [ "${CODESPACES}" = "true" ]; then git config --global credential.helper '!f() { sleep 1; echo "username=${GITHUB_USER}"; echo "password=${MY_GH_TOKEN}"; }; f' fi +echo "#######################################################" +echo "### Init submodules ###" +echo "#######################################################" +git config --global --add safe.directory "*" +git submodule update --init + echo "#######################################################" echo "### Install Dependencies ###" echo "#######################################################" diff --git a/.devcontainer/scripts/postStartCommand.sh b/.devcontainer/scripts/postStartCommand.sh new file mode 100755 index 00000000..c090c911 --- /dev/null +++ b/.devcontainer/scripts/postStartCommand.sh @@ -0,0 +1,81 @@ +#!/bin/bash +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json +# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation +# +# 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. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 + +echo "#######################################################" +echo "### Auto-Upgrade CLI ###" +echo "#######################################################" + +ROOT_DIRECTORY=$( realpath "$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )/../.." ) +DESIRED_VERSION=$(cat $ROOT_DIRECTORY/.velocitas.json | jq .cliVersion | tr -d '"') + +# Get installed CLI version +INSTALLED_VERSION=v$(velocitas --version | sed -E 's/velocitas-cli\/(\w+.\w+.\w+).*/\1/') + +if [ "$DESIRED_VERSION" = "$INSTALLED_VERSION" ]; then + echo "> Already up to date!" + exit 0 +else + echo "> Checking upgrade to $DESIRED_VERSION" +fi + +AUTHORIZATION_HEADER="" +if [ "${GITHUB_API_TOKEN}" != "" ]; then + AUTHORIZATION_HEADER="-H \"Authorization: Bearer ${GITHUB_API_TOKEN}\"" +fi + +if [ "$DESIRED_VERSION" = "latest" ]; then + CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/latest +else + CLI_RELEASES_URL=https://api.github.com/repos/eclipse-velocitas/cli/releases/tags/${DESIRED_VERSION} +fi + +CLI_RELEASES=$(curl -s -L \ +-H "Accept: application/vnd.github+json" \ +-H "X-GitHub-Api-Version: 2022-11-28" \ +${AUTHORIZATION_HEADER} \ +${CLI_RELEASES_URL}) + +res=$? +if test "$res" != "0"; then + echo "the curl command failed with exit code: $res" + exit 0 +fi + +DESIRED_VERSION_TAG=$(echo ${CLI_RELEASES} | jq -r .name) + +if [ "$DESIRED_VERSION_TAG" = "null" ] || [ "$DESIRED_VERSION_TAG" = "" ]; then + echo "> Can't find desired Velocitas CLI version: $DESIRED_VERSION. Skipping Auto-Upgrade." + exit 0 +fi + +if [ "$DESIRED_VERSION_TAG" != "$INSTALLED_VERSION" ]; then + echo "> Upgrading CLI..." + if [[ $(arch) == "aarch64" ]]; then + CLI_ASSET_NAME=velocitas-linux-arm64 + else + CLI_ASSET_NAME=velocitas-linux-x64 + fi + CLI_INSTALL_PATH=/usr/bin/velocitas + CLI_DOWNLOAD_URL="https://github.com/eclipse-velocitas/cli/releases/download/${DESIRED_VERSION_TAG}/${CLI_ASSET_NAME}" + + echo "> Downloading Velocitas CLI from ${CLI_DOWNLOAD_URL}" + sudo curl -s -L ${CLI_DOWNLOAD_URL} -o "${CLI_INSTALL_PATH}" + sudo chmod +x "${CLI_INSTALL_PATH}" +else + echo "> Up to date!" +fi + +echo "> Using CLI: $(velocitas --version)" diff --git a/.devcontainer/scripts/reinstall-cmake.sh b/.devcontainer/scripts/reinstall-cmake.sh index c8332538..99d5d9a6 100755 --- a/.devcontainer/scripts/reinstall-cmake.sh +++ b/.devcontainer/scripts/reinstall-cmake.sh @@ -1,4 +1,19 @@ -#!/usr/bin/env bash +#!/bin/bash +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json +# Copyright (c) 2023-2024 Contributors to the Eclipse Foundation +# +# 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. +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT +# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the +# License for the specific language governing permissions and limitations +# under the License. +# +# SPDX-License-Identifier: Apache-2.0 + #------------------------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information. diff --git a/.github/ISSUE_TEMPLATE/bug-report.yml b/.github/ISSUE_TEMPLATE/bug-report.yml index 91813013..8664be49 100644 --- a/.github/ISSUE_TEMPLATE/bug-report.yml +++ b/.github/ISSUE_TEMPLATE/bug-report.yml @@ -1,3 +1,4 @@ +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the diff --git a/.github/ISSUE_TEMPLATE/feature-request.yml b/.github/ISSUE_TEMPLATE/feature-request.yml index 6ec9558e..4582ff91 100644 --- a/.github/ISSUE_TEMPLATE/feature-request.yml +++ b/.github/ISSUE_TEMPLATE/feature-request.yml @@ -1,3 +1,4 @@ +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the diff --git a/.github/ISSUE_TEMPLATE/question.yml b/.github/ISSUE_TEMPLATE/question.yml index 063db90c..c58b90af 100644 --- a/.github/ISSUE_TEMPLATE/question.yml +++ b/.github/ISSUE_TEMPLATE/question.yml @@ -1,3 +1,4 @@ +# This file is maintained by velocitas CLI, do not modify manually. Change settings in .velocitas.json # Copyright (c) 2023-2024 Contributors to the Eclipse Foundation # # This program and the accompanying materials are made available under the diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 0e890b8b..c4cf7513 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -1,3 +1,4 @@ + ## Describe your changes