-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4 from eclipse-leda/node-red
add Node-RED example container
- Loading branch information
Showing
8 changed files
with
5,624 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
# /******************************************************************************** | ||
# * Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# * | ||
# * See the NOTICE file(s) distributed with this work for additional | ||
# * information regarding copyright ownership. | ||
# * | ||
# * This program and the accompanying materials are made available under the | ||
# * terms of the Apache License 2.0 which is available at | ||
# * http://www.apache.org/licenses/LICENSE-2.0 | ||
# * | ||
# * SPDX-License-Identifier: Apache-2.0 | ||
# ********************************************************************************/ | ||
|
||
name: Node-RED | ||
|
||
on: | ||
workflow_dispatch: | ||
workflow_call: | ||
pull_request: | ||
paths: | ||
- ".github/workflows/docker-build-publish-node-red.yml" | ||
- "node-red/**" | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/leda-example-node-red | ||
|
||
jobs: | ||
build: | ||
name: "Build multi-arch image" | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup QEMU buildx | ||
uses: docker/setup-qemu-action@v2 | ||
|
||
- name: Setup Docker buildx | ||
uses: docker/setup-buildx-action@v2 | ||
|
||
- name: Log into registry ${{ env.REGISTRY }} | ||
uses: docker/login-action@v2 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract Docker metadata | ||
id: meta | ||
uses: docker/metadata-action@v4 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
id: build-and-push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
push: true | ||
context: ./node-red/ | ||
file: ./node-red/Dockerfile | ||
platforms: linux/amd64,linux/arm64 | ||
tags: ${{ steps.meta.outputs.tags }} | ||
labels: ${{ steps.meta.outputs.labels }} | ||
cache-from: type=gha | ||
cache-to: type=gha,mode=max |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
# /******************************************************************************** | ||
# * Copyright (c) 2023 Contributors to the Eclipse Foundation | ||
# * | ||
# * See the NOTICE file(s) distributed with this work for additional | ||
# * information regarding copyright ownership. | ||
# * | ||
# * This program and the accompanying materials are made available under the | ||
# * terms of the Apache License 2.0 which is available at | ||
# * https://www.apache.org/licenses/LICENSE-2.0 | ||
# * | ||
# * SPDX-License-Identifier: Apache-2.0 | ||
# ********************************************************************************/ | ||
|
||
|
||
FROM nodered/node-red | ||
# FROM nodered/node-red:latest-debian | ||
|
||
LABEL org.opencontainers.image.authors="[email protected]" | ||
LABEL org.opencontainers.image.url="https://github.com/eclipse-leda/leda-example-applications" | ||
LABEL org.opencontainers.image.documentation="https://eclipse-leda.github.io/leda/docs/app-deployment/node-red/" | ||
LABEL org.opencontainers.image.source="https://github.com/eclipse-leda/leda-example-applications/node-red" | ||
LABEL org.opencontainers.image.licenses="Apache-2.0" | ||
LABEL org.opencontainers.image.vendor="Eclipse Foundation" | ||
LABEL org.opencontainers.image.title="Eclipse Leda Node-RED Example" | ||
LABEL org.opencontainers.image.description="A Node-RED example with preconfigured nodes, flows and dashboard for the Eclipse Leda distribution." | ||
|
||
COPY package.json . | ||
RUN npm install --unsafe-perm --no-update-notifier --no-fund --omit=dev | ||
|
||
ENV MQTT_ADDR="mosquitto" | ||
ENV MQTT_PORT="1883" | ||
ENV BROKER_ADDR="databroker" | ||
ENV BROKER_PORT="55555" | ||
|
||
# Copy _your_ Node-RED project files into place | ||
# NOTE: This will only work if you DO NOT later mount /data as an external volume. | ||
# If you need to use an external volume for persistence then | ||
# copy your settings and flows files to that volume instead. | ||
COPY settings.js /data/settings.js | ||
# COPY flows_cred.json /data/flows_cred.json | ||
COPY flows.json /data/flows.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
# Node-RED example application | ||
|
||
## Overview | ||
|
||
The Node-RED setup requires: | ||
|
||
- Eclipse Mosquitto | ||
- Eclipse Kuksa.VAL Databroker | ||
- Eclipse Kuksa.VAL Seat Service example | ||
- Eclipse Velocitas Seat Adjuster example | ||
- Eclipse Kanto Container Management | ||
- Eclipse Leda Quickstart image | ||
|
||
## Integration | ||
|
||
The containers are integrated with deployment descriptors in the Leda Quickstart image. | ||
Please see [meta-leda/meta-leda-components/recipes-sdv/eclipse-leda/kanto-containers/example](https://github.com/eclipse-leda/meta-leda/tree/main/meta-leda-components/recipes-sdv/eclipse-leda/kanto-containers/example) for details. | ||
|
||
## Usage | ||
|
||
You can access the graphical user interface with any web browser on the port 1881, e.g. http://leda-host:1881/. | ||
The generated dashboard is available on http://leda-host:1881/ui/. | ||
|
||
Describing how to use the UI is out of the scope of this document. Please consult the excellent [Node-RED documentation](https://nodered.org/docs/). | ||
|
||
## Data sources | ||
|
||
To make full use of the dashboard example you have to feed some data into the system. | ||
If you don't have real data, some possible sources could be: | ||
|
||
- [Kuksa CarSim](../kuksa-carsim/) | ||
- [FeederGPS](https://eclipse-leda.github.io/leda/docs/general-usage/gps-configuration/) |
Oops, something went wrong.