Combining the power of ACE and NodeRED

#!/bin/bash## Change the project and credentials as needed
#### Create a new project namespace
echo “Create Project”
oc new-project ${PROJECT} \
— display-name=”ACE NodeRed” \
— description=”Add a Node-RED sidecard that can be called from ACE”
## Set up Serice Account to allow ACE to run as any UID
oc create serviceaccount ace-runasanyuid
oc adm policy add-scc-to-user anyuid -z ace-runasanyuid — as system:admin
#### Create the secret that will allow the builder to access github
echo “Create secret”
oc create secret generic tonyhickman-github \
— from-file=ssh-privatekey=ocp-access \
#### Build the new Node-RED component
echo “Create NodeRED new build”
ssh-agent bash -c ‘ssh-add ocp-access; /
oc new-build \
— source-secret=tonyhickman-github \
— name ace-nr’
echo “Sleep for a while”
sleep 120
#### build the app as a POD with TWO containers in it
# NB: No builder needed for ACE as pulling Image from Docker Hub. This may change going forward if want to insert BAR’s
echo “Create App”
oc new-app ibmcom/ace:latest+ace-nr:latest \
— env=LICENSE=”accept” \
— name ace-app
# Stop OCP from restarting the pod
oc set triggers dc ace — manual
## Patch app to run as any
echo “Patch”
oc patch dc/ace — patch ‘{“spec”:{“template”:{“spec”:{“serviceAccountName”: “ace-runasanyuid”}}}}’
# Allow OCP to restart the pod when changes are made
oc set triggers dc ace — auto
echo “Expose LoadBalancer Ingress”
oc expose dc ace — type=LoadBalancer — name ace-loadbalancer
### create a secure route
echo “Create Routes….”
echo “Expose NodeRED on HTTPS”
oc create route edge ace-node-red — service=ace — port=1880 — insecure-policy=Redirect
echo “Expose svc”
oc expose svc ace — name=ace-admin — port=7600 — protocol=”TCP”
exit 0
OpenShift configuration

Calling NodeRED from ACE Flow

REST API wizard
Add resource
API with new resource
Model Creation
New Model
Update body schema
Create sub flow
postCall sub flow
Route node properties
Set Compute Mode
ACE management interface
ACE Management console
NodeRED flow
ACETest Template
ACETest2 Templace
“name”: “Some”,
“surname” : “OneElse”
“name”: “Tony”,
“surname” : “Hickman”




Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store