Coder Social home page Coder Social logo

software-engineering-project-org / vscode-plugin-automotive-app-deployment Goto Github PK

View Code? Open in Web Editor NEW
2.0 3.0 1.0 67.44 MB

Code base for LAD (Leda App Deployer) - a Visual Studio Code Plugin simplifying deployment of Velocitas Apps on Leda-running devices

License: Apache License 2.0

TypeScript 83.54% JavaScript 5.14% Dockerfile 0.65% HTML 10.36% Shell 0.31%
deployment-tools software-defined-vehicle vscode-extension velocitas

vscode-plugin-automotive-app-deployment's Introduction

Introduction to LAD: Leda App Deployer

LAD: Leda App Deployer – an Eclipse Leda Extension for Visual Studio Code

LAD facilitates the installation of an Eclipse Velocitas App on a target device running Eclipse Leda (with Kanto). With LAD, three different deployment options called "Deployment-Variants" are selectable, to save time during Vehicle App development.

Important NOTE: The base requirement is to have one (or many) target device(s) which can be accessed from this source device via SSH. Each Deployment-Variant requires configurations on the source and/or the target system, which is described in the prerequisites of each Deployment-Variant. If you with to use the plugin for deployment on a different operating system and not use Leda, refer to "Prerequisites for Plugin Usage on different Operating Systems (without Leda)"

Install the Extension in Visual Studio Code

LAD is not published on the official Marketplace of Visual Studio Code by now. You need to manually install the Extension in Visual Studio Code by following these simple steps:

  1. Install the Visual Studio Code Command Line Interface "code" if you have not done it earlier. To check if code is already installed, open a Terminal and type in code. If code is not present, do the following to install it:

    • Open the Command Pallette In Visual Studio Code by pressing Ctrl+Shift+P on Windows or Linux or Shift+⌘+P on MacOS)
    • On the Command Pallette, type Shell Command: Install 'code' command in PATH
    • Hit enter after granting the necessary permissions for Visual Studio Code. This will add the code command to your system's PATH, allowing you to use it in the command prompt or PowerShell.
  2. Manually download the .vsix file from the latest release on this repository OR download the file for the Extension via cURL by opening a Terminal and running:

    curl -o leda-app-deployer.vsix -L https://github.com/eclipse-leda/leda-contrib-vscode-extensions/releases/latest/download/leda-app-deployer.vsix
    
  3. Install the Extension via code with the following by running:

    code --install-extension leda-app-deployer.vsix
    

After successful installation, LAD is now visible in Visual Studio Code as an Extension button that looks like a target ◎.

Three different Ways (called "Deployment-Variants") to deploy your Application

Deployment-Variant 01: The Remote Build

Description:

Use this Deployment-Variant to install Velocitas App images on a target device from a remote source. Images refer to the available images in the GitHub repositories' registry (ghcr) your application is pulled from. The target system automatically downloads the specified image from the remote GitHub Repository with the help of LAD. You can choose between the different image releases available for your Repository via dropdown.

Prerequisites:

  • Internet connection on both the source and target device.
  • If the source GitHub Repository (ghcr) is private: Authenticate ghcr on the target system by referring to "Authenticate private ghcr on the target device".

The process:

Deployment-Variant 01

Detailed steps the Extension performs for you:

  1. Connects to the target device via SSH.
  2. Checks if local-registries are set in Kanto config:
    • Checks the /etc/container-management/config.json file.
    • Examines the registry_configurations object.
  3. Generates a string and inserts it into the Kanto Manifest.
  4. Copies the Manifest to the target device via SCP.

Deployment-Variant 02: The Hybrid Build

Description:

Use this Deployment-Variant to first download the Velocitas App image from the web (or specify a local path to a .tar file) and then transfer it to the target system via a local network. The target system does not require an Internet connection. If a local path is specified, the source device does not require an internet connection as well.

Prerequisites:

  • Local registry on the target device: Allow the use beforehand by referring to the section "Add the local registry on the target device".

The process:

Deployment-Variant 02

Detailed steps the Extension performs for you:

  1. Connects to the target device via SSH.
  2. Checks if local-registries are set in Kanto Config:
    • Checks the /etc/container-management/config.json file.
    • Examines the registry_configurations object.
  3. Downloads tar source or reference from the local device.
  4. Copies the Tarball to the Leda Device via SCP.
  5. Executes the containerd imports.
  6. Generates a string and inserts it into the Manifest.
  7. Copies the Manifest to the Leda Device via SCP.

Deployment-Variant 03: The Local Build

Description:

Use this Deployment-Variant to build the Velocitas App image locally via Docker build. The deployment is completely done on a local network, so no internet connection is required, neither on the source device nor on the target device.

Prerequisites:

  • Docker: Docker must be installed on the source device where the image is built.
  • Dockerfile: A valid Dockerfile must be present in the project's structure.
  • Local registry on the target device: Allow the use beforehand by referring to the section "Add the local registry on the target device".

The process:

Deployment-Variant 03

Detailed steps the Extension performs for you:

  1. Builds Docker Image (checks included).
  2. Exports it as a Tarball (to .vscode/tmp/*.tar).
  3. Connects to the device via SSH.
  4. Checks if local-registries are set in Kanto Config:
    • Checks the /etc/container-management/config.json file.
    • Examines the registry_configurations object.
  5. Copies the Tarball to the Leda Device via SCP.
  6. Executes the containerd imports.
  7. Generates a string and inserts it into the Manifest.
  8. Copies the Manifest to the Leda Device via SCP.

Device Handling

Add, remove & edit target devices; run apps on the device

  • Add and delete target devices:

    • If no target devices have been created yet, this can be done via the "+" button.
    • To do this, the required information is entered in the prompt that opens.
    • Once a target device has been created, it can be deleted using the trash can button.
  • Change a previously created target device and do further settings:

    • Changes are possible via the pencil icon.
    • The workspace config file then opens with the existing devices. Data can be further adjusted here.
    • After saving and clicking the reload button, the changes are displayed and effective.
  • Deploy apps on devices using LAD:

    • To deploy a Velocitas App with LAD, you can choose between the three variants described above:
    • The cloud icon without an arrow executes Deployment-Variant 01 option "Deploy remote built image remote".
    • The cloud with the arrow executes Deployment-Variant 02 option "Deploy local built image remote".
    • The document icon with the arrow executes Deployment-Variant 03 option "Deploy local built image local".

Add the local registry on the target device

Edit Kanto's config.json in the Kanto container-management of the target system/device:

  1. Navigate into the directory: cd /etc/container-management.
  2. Alter Kanto config: vi config.json.
  3. Add the following section if it is not already there: "containers":{}.
  4. After that or in case there is already the "containers" section, just add into that section: "insecure-registries": ["localhost:5000"]
  5. Restart the cm-service with: sudo systemctl restart container-management.service.

Authenticate private ghcr on the target device

Edit Kanto's config.json in the Kanto container-management of the target system/device:

  1. Navigate into the directory: cd /etc/container-management.
  2. Edit Kanto config: vi config.json.
  3. Add the following section if it is not already there: "containers":{}.
  4. After that or in case there is already the "containers" section, just add into that section: "registry_configurations": { "ghcr.io": { "credentials": { "user_id": "GITHUB USERNAME", "password": "GITHUB PASSWORD" } } }

Prerequisites for Plugin Usage on different Operating Systems (without Leda)

If we install kanto-cm on top of a different Operating Systems (eg. Raspbian arm64), we have the following dependencies that need to be manually installed:

Note: The utils from Kanto environment should be installed as a system service -> resources/kanto-auto-deployer.service.

Contributing

To be part of this project, please refer to CONTRIBUTING.

vscode-plugin-automotive-app-deployment's People

Contributors

cpotter302 avatar dangelic avatar km-nerlich avatar martinh-dev avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

dangelic

vscode-plugin-automotive-app-deployment's Issues

EPIC-00: Setup Development & Test Environment

In order to get a working vehicle application, we need to set up the tooling provided by Eclipse Velocitas.
Therefore, a working DevContainer inside Visual Studio Code is needed.

The following steps should be followed:

  • Setting up and exploring the development environment
  • Creating a Vehicle App Repository
  • Starting the Development Environment and the DevContainer
  • Run the vehicle app by using the provided "Seat Adjuster" example

Notes:
Setup Eclipse Velocitas tooling
Setup Eclipse Leda environment onhardware platform

Teck Stack:

  • Container.d
  • Eclipse Kanto
  • VS Code
  • Yocto

Use local and private container registry for Kanto

Currently Kanto uses only public registries. By trying to use a private registry we got an 401/404 Error. (Kanto tried to use the public one instead, causes 404).

An other problem is, that our Sample App Repo is private. Thats why Kanto is not aouthorized to load the image. (Causes the 401)

EPIC-01: Setup Eclipse Leda environments

To deploy the Docker image that was created and release in #17 a suitable runtime stack is needed. Therefore, a working installation of Eclipse Leda should be targeted.

To achive this, the task needs to be split up.

  1. setup Leda on QEmu
  2. setup Leda on Jetson Nano

We can use the documentation around installing and running Eclipse Leda on a Raspberry Pi to get a feeling for the installation process [1].

Please consider reading the documentation of Eclipse Leda [2] to get more information.

[1] https://eclipse-leda.github.io/leda/docs/general-usage/raspberry-pi/
[2] https://eclipse-leda.github.io/leda/docs/app-deployment/velocitas/

Epic #9

Tasks:

  1. Create demo app from Velocitas
  2. Deploy to target platform

Goals:

  • Script and documentation on how-to deploy and configure container built from Velocitas application to target hardware

Tech Stack:

  • Shell Scripting
  • Python
  • Yocto
  • Leda

Collect ideas for possible demo

The Jetson nano platform provides various sensors an actuators, which can serve for an interesting demo.

To be clarified

  • which data is provided by Jetson nano
  • what actuators are available

possible ideas

  • use camera data to generate data points in VSS
  • react on camera signals and steer Jetson
  • ...

Epic: #15

Task -> Story #28: Create release artifact of Velocitas example application

Task -> Story #28:

Triggering CI Workflow

To get a release artifact in the form of a docker image, the changes made in #16 have to be pushed to the template repository. This will trigger the CI workflow and create a docker image of the application.

Releasing Vehicle App

In order to get a ready-to-deploy container image that is published in the GitHub container registry, a release must be created [1].

[1] https://websites.eclipseprojects.io/velocitas/docs/tutorials/quickstart/#releasing-vehicle-app

Epic #10

Implement Kuksa Provider for Jetson Nano

In the velocitas architecture the Kuksa data broker acts as an abstraction layer to access data of a vehicle and to control actuators. for that it requires a vehicle specific provider, which translates VSS signals to the desired actuation or vice-versa from the data source to the VSS signal. Note that the kuksa data broker differentiates between target value and current value for each signal [1].

In order to implement a demo on the Jetson Nano, such a provider is required.

example feeders can be found here: https://github.com/eclipse/kuksa.val.feeders

[1] https://github.com/eclipse/kuksa.val/blob/master/doc/quickstart.md#feedset-why-is-my-data-not-updated

Epic: #15

Task -> Story #28: Determine a CI/CD concept

Tasks:

  1. Build pipelines (with base images)
  2. responsibilites
  3. identify possible options (Jenkins, Circle CI, self hosted, GH actions)
  4. define criteria for the selection and assess those options (maintanence, performance, complexity, support of target projects)

VSCode Plugin Publishment

  • Gather information on how to package and publish a VSCode extensions
  • Are there any requirements regarding maintanence or licensing
  • Are there similar projects already in the Store

Setup Eclipse Leda on Jetson Nano (Testing)

After successfully getting Eclipse Leda running in QEmu, the next step is to build (or download if already available) an Eclipse Leda image, which runs on the Jetson nano. The created Eclipse Leda image needs to be installed on the Jetson Nano.

Depends on: #44

Tasks:

  • Try initial setup
  • Create a list of upcoming issues
    (- Meeting with DEV and Troubleshooting)

Epic: #10

Setup QEmu with Eclipse Leda image

To deploy the Docker image that was created and release in #17 a suitable runtime stack is needed. Therefore, a working installation of Eclipse Leda should be targeted.

Leda is a Linux distribution, which needs hardware or a virtual machine to run. In order to setup a test environment, QEmu is a suitable hardware emulator, which is already tested with Leda. QEmu can run locally or remote environment like GitHub code spaces.

Task is to setup a Leda test environment either locally or remotely to prepare the next development steps.

We can use the documentation around installing and running Eclipse Leda on a Raspberry Pi to get a feeling for the installation process [1].

Please consider reading the documentation of Eclipse Leda [2] to get more information.

[1] https://eclipse-leda.github.io/leda/docs/general-usage/raspberry-pi/
[2] https://eclipse-leda.github.io/leda/docs/app-deployment/velocitas/

Epic #10

Evaluate Roles and Responsibilities -> Team Canvas

TODO:

  1. It needs to be clarified which roles we need in the project in terms of management and development.
  2. It is also important what these roles do exactly or what falls within the area of ​​responsibility of the person responsible for the role.
  3. Furthermore it has to be determined who is responsible for the roles.
  4. The results should be added to a Team Model Canvas.

DoD:
The task is considered completed when a sketch of the roles and tasks of the respective role / member is available as a Team Model Canvas document.

EPIC-03: Implement deployment functionality in VSCode plugin

Tasks:

  1. Extend functionality of plugin to deploy containerto hardware platform
  2. Three stages:
  • Plugin sends message to Kanto to trigger Kanto downloading the app image from github and start
  • Plugin downloads image from github, copies image to device, and instructs kanto to start container
  • Plugin builds image, copies image to device, and instructs kanto to start container

Tech Stack:

  • Docker/container.d
  • Typescript
  • Eclipse Kanto
  • VSCode Plugin SDK

Set up Velocitas development environment

In order to get a working vehicle application, we need to set up the tooling provided by Eclipse Velocitas.
Therefore, a working DevContainer inside Visual Studio Code is needed.

The following steps should be followed:

  • Setting up and exploring the development environment
  • Creating a Vehicle App Repository
  • Starting the Development Environment and the DevContainer
  • Run the vehicle app by using the provided "Seat Adjuster" example

Epic #9

Add commit guidelines

Add guidelines on how we commit that we all agree on. This should ensure the clarity of the code base and make the repository open source ready from the start.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.