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.
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
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
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
`;
- The user-modified part will need to be replaced with the template literal value "%s"
` data.fillna(value=%s, inplace=True)
`
- Output this constant
module.exports = {
EXAMPLE,
};
- Import the "util" module and import the prepared snippet.js according to the file structure
const util = require('util');
const snippets = require('../snippets');
- Replace the user's front-end configuration with the target code
example = util.format(snippets.EXAMPLE,config.userinput)
- Store the modified code as a variable in the msg object attribute
node.on('input', function(msg) {
msg.payload += example
node.send(msg);
});
- 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>
63c41888-c9cd-4a63-ae52-6a6f91dba8f4.mp4
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