要提交的变更:

修改:     controlplane/orchestrator.py
	修改:     function_modules/noop/Dockerfile
	修改:     function_modules/noop/noop.c
	修改:     function_modules/noop/test1.json
anubhav
njl 3 months ago
parent bfa4e7c57a
commit 0eacbfaafc

@ -89,13 +89,14 @@ def handle_parallel(queue,redis,action_properties_mapping,parallel_action_list):
for thread in thread_list: for thread in thread_list:
thread.join() thread.join()
# results = [] # results = []
action_properties_mapping[next_action]["arguments"] = responses if(next_action!=""):
action_properties_mapping[next_action[0]]["arguments"] = responses
# result=responses # result=responses
# responses=[] # responses=[]
return responses return responses
def create_redis_instance(): 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 return r

@ -7,7 +7,7 @@ RUN apk update && apk add --no-cache gcc musl-dev
ADD . /action ADD . /action
# 编译 C 程序为 exec # 编译 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 指令执行编译好的 C 程序
CMD ["/bin/bash", "-c", "cd /actionProxy && python -u actionproxy.py"] CMD ["/bin/bash", "-c", "cd /actionProxy && python -u actionproxy.py"]

@ -1,8 +1,9 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h>
int main() { int main() {
const char *env_var = getenv("__OW_ACTIVATION_ID");
printf("{ \"message\": \" hello world!\" }\n"); printf("{ \"activation_id\":\"%s\",\"message\": \" hello world!\" }\n",env_var);
return 0; // 返回 0 表示程序成功 return 0; // 返回 0 表示程序成功
} }

@ -6,13 +6,13 @@
"properties": "properties":
{ {
"label": "noop 1", "label": "noop 1",
"primitive": "parallet", "primitive": "parallel",
"condition":{}, "condition":{},
"next": ["noop2","noop3"], "next": ["noop2","noop3"],
"branch_1": "", "branch_1": "",
"branch_2": "", "branch_2": "",
"arguments": {}, "arguments": {},
"outputs_from":[] "outputs_from":""
} }
}, },
{ {

Loading…
Cancel
Save