Skip to content

sefgsefg/Kube-node-red-spread-flow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 

Repository files navigation

Kube-node-red-spread-flow

hackmd-github-sync-badge

Kube-node-red is aiming to integrate Kubeflow/Kubebeters with node-red, leveraging node-red's low-code modules, and using Kubeflow resources (e.g. Kubeflow pipeline, Kserve) to enhance its AI/ML ability.

Table of Contents

Architecture

image

Self-defined Node

Prerequisites

  • snippet.js Record the machine learning task code written in Python to modify the task process based on front-end input
  • <example>.js Node back-end logic and front-end input processing
  • <example>.html Node front-end logic and user configuration logic and user configuration

snippet.js

1.Machine learning tasks written in python are executed in kubeflow, and js strings are stored in constants for node calls and modifications.

const EXAMPLE =
`
    data = pd.DataFrame(data, columns=col_names[:])
    data.fillna(value=0, inplace=True)
    data = data.values  
`;
  1. The user-modified part will need to be replaced with the template literal value "%s"
`   data.fillna(value=%s, inplace=True)
`
  1. Output this constant
module.exports = {
    
    EXAMPLE,
    
};

example.js

  1. Import the "util" module and import the prepared snippet.js according to the file structure
const util = require('util');
const snippets = require('../snippets');
  1. Replace the user's front-end configuration with the target code
example = util.format(snippets.EXAMPLE,config.userinput)
  1. Store the modified code as a variable in the msg object attribute
node.on('input', function(msg) {
            
            msg.payload += example
            node.send(msg);
    
});

example.html

  1. Set relevant configurations according to machine learning task requirements
defaults: {
            userinput: { value: {} }                    
        },

2.Write corresponding html template

<div class="form-row">
        <label for="node-input-userinput>UserInput</label>
        <input type="text" id="node-input-userinput" />
</div>

Reference

https://github.com/NightLightTw/kube-nodered

https://github.com/kubeflow/pipelines/tree/1.8.21/backend/api/python_http_client

Kubeflow implementation:add Random Forest algorithm

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published