kube-HPC / hkube

🐟 High Performance Computing over Kubernetes - Core Repo 🎣
http://hkube.io
MIT License
304 stars 20 forks source link

when algorithm input is a key in a dictionary and the value is None the algorithm get the entire dictionary as input #1024

Closed tamir321 closed 3 years ago

tamir321 commented 3 years ago

HKube micro-service worker

Describe the bug when algorithm input is a key in a dictionary and the value is None the algorithm get the all dictionary as input

"algorithmName": "null" - code is

import time
import os
def start(args, hkubeapi):
    print(args)
    input=args['input'][0]  
    return {"base":"this is base","bundel":None}

a1 algorithm code is

import time
import os
def start(args, hkubeapi):
    print(args)
    input=args['input'][0]  
    nodeName = args["nodeName"]
    return "I am: "+ nodeName +" and My input was: "+ str(input)

execute the following pipeline a2 node should receive None as input

{
    "name": "python-with-null",
    "description": "",
    "nodes": [
        {
            "algorithmName": "null",
            "input": [
                "123456"
            ],
            "nodeName": "first"
        },
        {
            "algorithmName": "a1",
            "input": [
                "@first.base",
                "@first.bundel"
            ],
            "nodeName": "a1"
        },
        {
            "algorithmName": "a1",
            "input": [
                "@first.bundel"
            ],
            "nodeName": "a2"
        }
    ],
    "flowInput": {},
    "triggers": {
        "cron": {
            "pattern": "0 * * * *",
            "enabled": false
        },
        "pipelines": []
    },
    "options": {
        "batchTolerance": 100,
        "concurrentPipelines": {
            "amount": 10,
            "rejectOnFailure": true
        },
        "progressVerbosityLevel": "info",
        "ttl": 3600
    },
    "priority": 3,
    "experimentName": "main"
}

the a2 node output is {"base":"this is base","bundel":null}

tamir321 commented 3 years ago

tested on "systemVersion": "v2.0.55", "fullSystemVersion": "v2.0.55-1610028130079",