Giter VIP home page Giter VIP logo

s2i-nodered's Introduction

Build Status

Node-red S2I container image

This container image includes Node-red for OpenShift and general usage.

Image is built is as follows:

s2i-nodejs-10-git-centos7 - Original nodejs-10-centos7 builder image updated to include GIT v.2.X so that project feature could be enabled
s2i-nodered-base-centos7 - S2I build from Node-red package.json using s2i-nodejs-10-git
s2i-nodered-centos7 - Enabling S2I over s2i-nodered-base image

Note: while the examples in this README are calling podman, you can replace any such calls by docker with the same arguments

Description

Node-RED is a programming tool for wiring together hardware devices, APIs and online services in new and interesting ways.

It provides a browser-based editor that makes it easy to wire together flows using the wide range of nodes in the palette that can be deployed to its runtime in a single-click.

Usage

The structure of example-app can look like this:

.
├── projects
│   └── main
│       ├── flows.json        # Project flows file
│       └── package.json      # Project package file
└── settings.js               # Optional Nodered settings file

A file containing Node-red flows. Which will be set as an active project. Currently only "main" is supported

Example content of Project package file:

{
    "name": "main",
    "description": "A Node-RED Project",
    "version": "0.0.1",
    "dependencies": {},
    "node-red": {
        "settings": {
            "flowFile": "flows.json",
            "credentialsFile": "flows_cred.json"
        }
    }
}

Building on OpenShift

If you want to create a new container layered image, you can use the Source build feature of Openshift. To create a new Node-red application in Openshift, while using data available in test-app on the host, execute the following command:

git clone https://github.com/tomasliumparas/s2i-nodered.git
cd s2i-nodered
oc new-app getais/s2i-nodered-centos7:latest~. --context-dir example-app --name nodered-example-app

Or without locally cloning the repository:

oc new-app getais/s2i-nodered-centos7:latest~https://github.com/tomasliumparas/s2i-nodered.git --context-dir example-app --name nodered-example-app

Checking if example application is working (from within the OpenShift cluster):

curl nodered-test-app.<openshift-project>.svc:1880/hello
Hello OpenShift!

Creating OpenShift route:

oc expose

Building using standalone S2i

The same application can also be built using the standalone S2I application on systems that have it available

$ s2i build example-app/ getais/s2i-nodered-centos7 nodered-example-app

Environment variables and volumes

The Apache HTTP Server container image supports the following configuration variables:

TBD

Default user

By default, Node-red container runs as UID 1001. That means the volume mounted directories for the files (if mounted using -v option) need to be prepared properly, so the UID 1001 can read them.

s2i-nodered's People

Watchers

 avatar  avatar

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.