Skip to content

Commit

Permalink
Initial commit for uprotocol package (#1)
Browse files Browse the repository at this point in the history
* Initial commit for uprotocol package

Signed-off-by: Dennis Meister <[email protected]>

* Update README.md

Co-authored-by: Dominic Sudy <[email protected]>

---------

Signed-off-by: Dennis Meister <[email protected]>
Co-authored-by: Dominic Sudy <[email protected]>
  • Loading branch information
dennismeister93 and doosuu authored Feb 21, 2024
1 parent 5cdb340 commit b276575
Show file tree
Hide file tree
Showing 24 changed files with 1,017 additions and 1 deletion.
50 changes: 50 additions & 0 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:21-bullseye",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"jdkDistro": "ms",
"version": "21",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts/Hydrogen"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"version": "3.5.0"
},
"ghcr.io/devcontainers/features/common-utils:2.3.2": {}
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"maven.view": "hierarchical",
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "disabled",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
}
},
"extensions": [
// add necessary extentions
]
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
target/
.DS_Store
.cli/
.velocitas/
.vscode/settings.json
.attach*
10 changes: 10 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
10 changes: 10 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"configurations": [
{
"type": "java",
"name": "Launch Java Program",
"request": "launch",
"mainClass": "org.eclipse.vehicle_app.Main"
}
]
}
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# pkg-velocitas-uprotocol
# Velocitas uProtocol Support package

This repository is supposed to be used as a self-contained [Velocitas toolchain package](https://github.com/eclipse-velocitas/cli/blob/main/docs/features/PACKAGES.md) which enables
the development of uProtocol applications and services (uApps and uServices). No further Velocitas packages are needed to develop uApps and uServices.


## Setting up your local developoment environment

Testing of the package shall be done in the `testbench` folder, where a `run_cli.sh` script is provided. This script will download and run the correct branch of the Velocitas CLI for the uProtocol integration using this repository as the package contents. This allows you to instantly test your package without further copying to other repos.


## Structure

The package is structured as follows, please follow the links for a detailed description of the component:

* $root/
* 📁 components/
* 📁 cores/
* [project-creation-java](./components/cores/project-creation-java/README.md)/
* 📁 scripts/
* 📄 create.py
* 📁 templates/
* 📁 extensions/
* 📁 [devcontainer-setup-java](./components/extensions/devcontainer-setup-java/README.md)/
* 📁 [github-workflows](./components/extensions/github-workflows/README.md)/
* 📁 [service-catalogue-support](./components/extensions/service-catalogue-support/README.md)/ (?)
* 📁 [tool-manager](./components/extensions/tool-manager/README.md)/ (?)
* 📄 manager.py
* 📄 tools.yaml
* 📁 [testbench](./testbench/README.md)
* 📄 manifest.json
24 changes: 24 additions & 0 deletions components/cores/project-creation-java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Project Creation

The core Velocitas toolchain component enables the project creation for uProtocol based projects. It contains scripts for creation of uApps/uServices, supporting all of uProtocols languages.

## Supported project types

* Empty skeleton
* From example
* Horn activator

## Interfaces

### Service catalogue

When creating a project based on the empty skeleton it is possible to specify a functional dependency on a catalogue of services to be used by the project. This catalogue consists of a file tree containing one or more protobuf service definitions.

## Supported languages

| Language | Status |
|:--------:|:-------:|
| Java | &check; |
| C++ | &cross; |
| Rust | &cross; |
| Kotlin | &cross; |
9 changes: 9 additions & 0 deletions components/extensions/devcontainer-setup-java/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# devContainer Setup Java

Provides [devContainer](https://containers.dev/) configuration for Java based uApp/uService projects.
This includes:

* Basic tooling
* Basic IDE configuration
* Used extensions
* Velocitas CLI
11 changes: 11 additions & 0 deletions components/extensions/github-workflows/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Github Workflows

Provides Github CI/CD workflows for uApps/uServices.

## Provided workflows:

* CI for the uApps/uServices
* Build
* Unit tests
* Integration tests
* SCA
21 changes: 21 additions & 0 deletions components/extensions/service-catalogue-support/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Service Catalgoue Support

Adds support for functional interfaces of a uApp/uService towards a service defined within a service catalogue (e.g. [COVESA uServices](https://github.com/COVESA/uservices/)). **Format below is not finalized and needs to be discussed once this toolchain component is developed.**

**CONCEPT SHOULD BE ALIGNED WITH gRPC**


## Usage in AppManifest.json

```json
{
"type": "service-catalogue-consumer",
"config": {
"src": "https://github.com/COVESA/uservices.git",
"services": [
"Chassis",
"Horn"
]
}
}
```
28 changes: 28 additions & 0 deletions components/extensions/tool-manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Tool Manager

A tool manager for uProtocol tools. At the moment the following are supported:

* [uProtocol Simulator](https://github.com/eclipse-uprotocol/up-simulator)
* [uP Client Android](https://github.com/eclipse-uprotocol/up-client-android-java)

## Requirements

The tool manager shall meet the following requirements:

* it shall download the respective tools to the `$VELOCITAS_HOME` and make them available to the velocitas project via exposed programs. (e.g. `velocitas exec up-simulator`)

* it shall read used tool versions from a configuration file stored in the project directory. (Could be stored in the `.velocitas.json`)

e.g. (`.velocitas.json`)
```json
{
...
"variables": {
"uprotocolSimulatorVersion": "0.0.1",
"ulinkAndroidBinderVersion": "0.1.0"
}
}
```

* it shall provide a UI (could be terminal prompts) which shows upgradeable tools and allow updates
easily
1 change: 1 addition & 0 deletions components/project-creation/integration/run.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
print("Create a new uProtocol project from scratch or template!")
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/java
{
"name": "Java",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/java:11-bullseye",
"features": {
"ghcr.io/devcontainers/features/java:1": {
"jdkDistro": "ms",
"version": "11",
"installMaven": "true",
"installGradle": "false"
},
"ghcr.io/devcontainers/features/node:1": {
"version": "lts/Hydrogen"
},
"ghcr.io/devcontainers/features/python:1": {
"version": "3.10"
},
"ghcr.io/devcontainers-contrib/features/pre-commit:2": {
"version": "3.5.0"
},
"ghcr.io/devcontainers/features/common-utils:2.3.2": {},
},
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
// Use 'postCreateCommand' to run commands after the container is created.
"postCreateCommand": "",
// Configure tool-specific properties.
"customizations": {
"vscode": {
"settings": {
"maven.view": "hierarchical",
"java.compile.nullAnalysis.mode": "automatic",
"java.configuration.updateBuildConfiguration": "disabled",
"terminal.integrated.defaultProfile.linux": "zsh",
"terminal.integrated.profiles.linux": {
"zsh": {
"path": "/usr/bin/zsh"
}
}
},
"extensions": [
// add necessary extentions
]
}
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
10 changes: 10 additions & 0 deletions components/project-creation/template/.velocitas.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"packages": [
{
"name": "velocitas-uprotocol-core",
"version": "latest"
}
],
"variables": {},
"cliVersion": "v0.6.3"
}
Loading

0 comments on commit b276575

Please sign in to comment.