From dd8eb592917d1c4cbc97941c59a22d47b8347cfc Mon Sep 17 00:00:00 2001 From: Ye Cao Date: Tue, 11 Jun 2024 19:08:18 +0800 Subject: [PATCH] fix(python): Decode the k8s node selector and convert it as a dict. (#3477) ## What do these changes do? As titled. During test, I find not all pods are scheduled to the same node. ```yaml NAME READY STATUS RESTARTS AGE IP NODE NOMINATED NODE READINESS GATES coordinator-ozgjbb-6c57549cf7-hhwqt 1/1 Running 0 4m2s 10.244.1.85 kind-worker gs-engine-ozgjbb-0 3/3 Running 0 3m58s 10.244.1.86 kind-worker gs-engine-ozgjbb-1 3/3 Running 0 114s 10.244.1.87 kind-worker gs-engine-ozgjbb-2 3/3 Running 0 108s 10.244.1.88 kind-worker gs-engine-ozgjbb-ozgjbb-vineyard-etcd-0 1/1 Running 0 3m58s 10.244.3.71 kind-worker2 gs-interactive-frontend-ozgjbb-8d996bc8b-ctn6x 1/1 Running 0 3m58s 10.244.3.72 kind-worker2 ``` We should support to add the node selector to the frontend and vineyard etcd. ## Related issue number Fixes #3476 --------- Signed-off-by: Ye Cao --- python/graphscope/deploy/kubernetes/resource_builder.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/python/graphscope/deploy/kubernetes/resource_builder.py b/python/graphscope/deploy/kubernetes/resource_builder.py index 429aecf3e2c1..72a8a39a09c9 100644 --- a/python/graphscope/deploy/kubernetes/resource_builder.py +++ b/python/graphscope/deploy/kubernetes/resource_builder.py @@ -126,7 +126,13 @@ def get_image_pull_secrets(image_pull_secrets): @staticmethod def get_node_selector(node_selector): - return node_selector + import base64 + import json + + decoded_node_selector = base64.b64decode(node_selector).decode( + "utf-8", errors="ignore" + ) + return json.loads(decoded_node_selector) @staticmethod def get_user_defined_volumes(udf_volumes):