diff --git a/controlplane/orchestrator.py b/controlplane/orchestrator.py index e21e97d..4d9e4aa 100644 --- a/controlplane/orchestrator.py +++ b/controlplane/orchestrator.py @@ -89,13 +89,14 @@ def handle_parallel(queue,redis,action_properties_mapping,parallel_action_list): for thread in thread_list: thread.join() # results = [] - action_properties_mapping[next_action]["arguments"] = responses + if(next_action!=""): + action_properties_mapping[next_action[0]]["arguments"] = responses # result=responses # responses=[] return responses def create_redis_instance(): - r = redis.Redis(host="127.0.0.1", port=6379, db=2) + r = redis.Redis(host="127.0.0.1", port=6380, db=2) return r diff --git a/function_modules/noop/Dockerfile b/function_modules/noop/Dockerfile index d225f0f..cb5356a 100644 --- a/function_modules/noop/Dockerfile +++ b/function_modules/noop/Dockerfile @@ -7,7 +7,7 @@ RUN apk update && apk add --no-cache gcc musl-dev ADD . /action # 编译 C 程序为 exec -RUN gcc /action/noop.c /action/cJSON.c -o /action/exec -lm +RUN gcc /action/noop.c -o /action/exec -lm # 使用 CMD 指令执行编译好的 C 程序 CMD ["/bin/bash", "-c", "cd /actionProxy && python -u actionproxy.py"] diff --git a/function_modules/noop/noop.c b/function_modules/noop/noop.c index dfd29b2..9b90225 100644 --- a/function_modules/noop/noop.c +++ b/function_modules/noop/noop.c @@ -1,8 +1,9 @@ #include +#include int main() { - - printf("{ \"message\": \" hello world!\" }\n"); + const char *env_var = getenv("__OW_ACTIVATION_ID"); + printf("{ \"activation_id\":\"%s\",\"message\": \" hello world!\" }\n",env_var); return 0; // 返回 0 表示程序成功 } diff --git a/function_modules/noop/test1.json b/function_modules/noop/test1.json index 988f6c3..88b200f 100644 --- a/function_modules/noop/test1.json +++ b/function_modules/noop/test1.json @@ -6,13 +6,13 @@ "properties": { "label": "noop 1", - "primitive": "parallet", + "primitive": "parallel", "condition":{}, "next": ["noop2","noop3"], "branch_1": "", "branch_2": "", "arguments": {}, - "outputs_from":[] + "outputs_from":"" } }, {