Skip to content

sefgsefg/Qnn-on-kubeflow-with-Node-red

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 

Repository files navigation

Qnn-on-kubeflow-with-Node-red

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

Implementation

Use WSL to implement

git clone https://github.com/sefgsefg/Qnn-on-kubeflow-with-Node-red.git
cd Qnn-on-kubeflow-with-Node-red/Qnn/examples
./run.sh main

Problem solve: -bash: ./run.sh: Permission denied

chmod +x run.sh
cd scripts
chmod +x entrypoint.sh
cd ..

Run ./run.sh main again

./run.sh main

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>

Implementation

63c41888-c9cd-4a63-ae52-6a6f91dba8f4.mp4

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

https://github.com/justin0322/Node-RED-Kubeflow-Pipeline-Extension

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published