Skip to content

Commit

Permalink
fix(python): Decode the k8s node selector and convert it as a dict. (#…
Browse files Browse the repository at this point in the history
…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    <none>           <none>
gs-engine-ozgjbb-0                               3/3     Running   0          3m58s   10.244.1.86   kind-worker    <none>           <none>
gs-engine-ozgjbb-1                               3/3     Running   0          114s    10.244.1.87   kind-worker    <none>           <none>
gs-engine-ozgjbb-2                               3/3     Running   0          108s    10.244.1.88   kind-worker    <none>           <none>
gs-engine-ozgjbb-ozgjbb-vineyard-etcd-0          1/1     Running   0          3m58s   10.244.3.71   kind-worker2   <none>           <none>
gs-interactive-frontend-ozgjbb-8d996bc8b-ctn6x   1/1     Running   0          3m58s   10.244.3.72   kind-worker2   <none>           <none>
```

We should support to add the node selector to the frontend and vineyard
etcd.

## Related issue number

Fixes #3476

---------

Signed-off-by: Ye Cao <caoye.cao@alibaba-inc.com>
  • Loading branch information
dashanji committed Jun 11, 2024
1 parent f5b42c5 commit dd8eb59
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion python/graphscope/deploy/kubernetes/resource_builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit dd8eb59

Please sign in to comment.