Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

kuscia-gen-conf 这个config map是如何产生的,什么编码? #466

Open
gxcuit opened this issue Dec 9, 2024 · 3 comments
Open
Assignees

Comments

@gxcuit
Copy link

gxcuit commented Dec 9, 2024

Hi,

我在看kuscia task 相关时,发现task-input-config 实际是这个configmap kuscia-gen-conf

但我不清楚编码格式,以及这个configmap算如何生成的

@zimu-yuxi
Copy link

‘发现task-input-config 实际是这个configmap kuscia-gen-conf ’,没太明白什么意思,这个是从哪里获得的

@zimu-yuxi zimu-yuxi self-assigned this Dec 9, 2024
@gxcuit
Copy link
Author

gxcuit commented Dec 10, 2024

‘发现task-input-config 实际是这个configmap kuscia-gen-conf ’,没太明白什么意思,这个是从哪里获得的

Hi, Thanks for your reply. @zimu-yuxi

  • 我观察到,每一个task,其实是起了一个pod。pod 里的command 是 python -m secretflow.kuscia.entry ./kuscia/task-config.conf
  • 这一个conf,其实是一个名为 config-template 的config map,如下
apiVersion: v1
data:
  task-config.conf: |
    {
      "task_id": "{{.TASK_ID}}",
      "task_input_config": "{{.TASK_INPUT_CONFIG}}",
      "task_cluster_def": "{{.TASK_CLUSTER_DEFINE}}",
      "allocated_ports": "{{.ALLOCATED_PORTS}}"
    }
kind: ConfigMap
metadata:
  annotations:
    kuscia.secretflow/initiator: node-124
    kuscia.secretflow/task-id: lwto-dqvmnrvy-node-38
  creationTimestamp: "2024-11-19T07:51:16Z"
  labels:
    kuscia.secretflow/controller: kusciatask
    kuscia.secretflow/task-uid: e54c81c3-7a5c-4712-9c5d-973059a98492
  name: lwto-dqvmnrvy-node-38-configtemplate
  namespace: node-124
  resourceVersion: "533451"
  uid: eed93694-72f9-4d83-860e-6b6000ebb866
  • 我想知道的是,task_id、task_input_config、task_cluster_def、allocated_ports 这些是怎么,以及何时产生并赋值到 task-config.conf的?
  • 我观察到,还有另一个config map:kuscia-gen-conf, 请问TASK_INPUT_CONFIG是如何编码的? 不是base64
apiVersion: v1
binaryData:
  TASK_INPUT_CONFIG: eJzsVktv4zYQvudXCDzLWdmbXQS+b9Gi2KJA0VMVEDQ5ltjwVT68dQP/94KkJMt21kik4/piyPP4ZjgcfjMvd0WB3BYz4onTwVLAVKstb9C6iLqiQEozWCxXD4OkKBBnaF0gBlsShF9E50X2RsnicFcUh7KDpiI4DxYzcPSIaoj1HBxaF38dIzyVWclgx2lWDiEVkRCDOhNQ2Qv93lwKr0EXBRrOh15qZIPyXPaHrtH6pUbGaq+pFjVa1+iPL19/Wf1ao7JGWw6CJeFPX5erxxodyhoJrp7T0bIv1UoB9diCt3scoV2N1p+r8lzFlQe7IwLLaLCsqmiysYZi2hKlQOCTNFrvTUrixKSD5FrhWIlkabQWwJKtBbpLOejguzirqsqhIuCrusOhu8OyuKh9C6/U/kT4ntpLzWLKRY1+//nLnzUqixo52oIkWWoIF4KDzZpn2GPH/0seq+rhsU+z7xlL9ngL7Lx9Y1CrncOOC42plhJvCH0GlTo4VTNe4St9G9PHEK/IEEvksXWZloSr6C7Fvbfxu8th6FGHXcPwiW4H1nGd3Jb31X3Vy4n3Fhvi21w0rkzwH9IvZu7DFogPFrADAdQ7VBbnFoJsQEQ5GE3bZCGAWMVVgy3xEAUb4mmbqhf/Od6kdonfFo7fBhQRfp8QVlhpKzOsy4ZGW4+/AW9a74aXGrM/fafcYUXQutgS4WC4eJdPR5oUCVigJLZt/NOxSM5TEEWTSauD46pJyWiSDUnKjQU7+FIiDeFN+jaM7FOqxsKO65C+/9YbvBEBFlQLQWwvAuUtGAsKwiCLEUESznqBJIo0IEH5XmLBcwuDgQOxXYA0Qu/HQpvJq//vAxtBeKCt4pTnI0VJUGMISSz3RGDGd9rSU5kk1vJTUayRAPR08WSvXsP+NYfPkeGX91X5KsSF/Rati+q+Wr7RvIOvVg9vjvCdI8QX5JeXJHXFXOiGO8/pu5x+0wouHfKxP72vSG+vUqf1NsApvdEW6LPRXHkcLI/50WfxzesF+2cnld3tF4luPz4udPAm+EWFxmSWhdE1d0B0xb1rprqPj71VlV7dNYtlJoCInImIsyPuWUoPn44pnXmlaRHfssPOAE0IR5su1hXo8Wm7lL9r0afsyUYAPuOtTprXmka4xv4bSM/QVIsg1blLVuCe8jlbonKs6Mdjx+CXnTT2Trw42XtEp5MxBhaejDCQ92SEgfMnI+RRMb0IccJM9x4G02SI4zybDNGNwen+w/ScDHExdGchnc7qWVCjET8LZ7wZzAIaFopZKGd7yEysfn2ZB9NvPbNQxsvSLKDxjjUZ6HI1mw01bHSzkbpF8A1AT3cjtNvguw2+2+C7Db7b4LsNvh9i8D3dHf4PAAD//53+hO0=
data:
  ALLOCATED_PORTS: '{"ports":[{"name":"client-server", "port":27003, "scope":"Local",
    "protocol":"GRPC"}, {"name":"inference", "port":27004, "scope":"Cluster", "protocol":"HTTP"},
    {"name":"spu", "port":27005, "scope":"Cluster", "protocol":"GRPC"}, {"name":"fed",
    "port":27006, "scope":"Cluster", "protocol":"GRPC"}, {"name":"global", "port":27007,
    "scope":"Domain", "protocol":"GRPC"}, {"name":"node-manager", "port":27008, "scope":"Local",
    "protocol":"GRPC"}, {"name":"object-manager", "port":27009, "scope":"Local", "protocol":"GRPC"}]}'
  KUSCIA_DOMAIN_ID: node-124
  TASK_CLUSTER_DEFINE: '{"parties":[{"name":"node-124", "role":"", "services":[{"portName":"inference",
    "endpoints":["lwto-dqvmnrvy-node-38-0-inference.node-124.svc"]}, {"portName":"spu",
    "endpoints":["lwto-dqvmnrvy-node-38-0-spu.node-124.svc"]}, {"portName":"fed",
    "endpoints":["lwto-dqvmnrvy-node-38-0-fed.node-124.svc"]}, {"portName":"global",
    "endpoints":["lwto-dqvmnrvy-node-38-0-global.node-124.svc:27007"]}]}], "selfPartyIdx":0,
    "selfEndpointIdx":0}'
  TASK_ID: lwto-dqvmnrvy-node-38
kind: ConfigMap
metadata:
  annotations:
    kuscia.secretflow/config-value-compress-fields-name: TASK_INPUT_CONFIG
    kuscia.secretflow/initiator: node-124
    kuscia.secretflow/task-id: lwto-dqvmnrvy-node-38
  creationTimestamp: "2024-11-19T07:51:16Z"
  labels:
    kuscia.secretflow/controller: kusciatask
    kuscia.secretflow/task-uid: e54c81c3-7a5c-4712-9c5d-973059a98492
  name: lwto-dqvmnrvy-node-38-kuscia-gen-conf
  namespace: node-124
  resourceVersion: "533457"
  uid: c38c701d-a4dd-46f1-bf69-81462ffc30d3

@zimu-yuxi
Copy link

1.是的,每一个task是通过appimage拉起pod,该command在appimage中有配置,task_id、task_input_config、task_cluster_def这些是在创建task时传给kuscia的
2. 二进制数据,包含base64 编码和压缩(使用 zlib)的配置数据

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants