kalavai-client 0.5.21__py3-none-any.whl → 0.5.23__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- kalavai_client/__init__.py +1 -1
- kalavai_client/assets/apps.yaml +1 -1
- kalavai_client/assets/docker-compose-template.yaml +3 -3
- kalavai_client/bridge_api.py +2 -1
- kalavai_client/bridge_models.py +1 -0
- kalavai_client/cli.py +11 -3
- kalavai_client/core.py +11 -3
- {kalavai_client-0.5.21.dist-info → kalavai_client-0.5.23.dist-info}/METADATA +1 -1
- {kalavai_client-0.5.21.dist-info → kalavai_client-0.5.23.dist-info}/RECORD +12 -12
- {kalavai_client-0.5.21.dist-info → kalavai_client-0.5.23.dist-info}/LICENSE +0 -0
- {kalavai_client-0.5.21.dist-info → kalavai_client-0.5.23.dist-info}/WHEEL +0 -0
- {kalavai_client-0.5.21.dist-info → kalavai_client-0.5.23.dist-info}/entry_points.txt +0 -0
kalavai_client/__init__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
|
2
|
-
__version__ = "0.5.
|
2
|
+
__version__ = "0.5.23"
|
kalavai_client/assets/apps.yaml
CHANGED
kalavai_client/bridge_api.py
CHANGED
kalavai_client/bridge_models.py
CHANGED
kalavai_client/cli.py
CHANGED
@@ -420,7 +420,7 @@ def pool__start(cluster_name, *others, only_registered_users: bool=False, ip_ad
|
|
420
420
|
|
421
421
|
console.log(f"[green]Creating {cluster_name} pool, this may take a few minutes...")
|
422
422
|
|
423
|
-
create_pool(
|
423
|
+
result = create_pool(
|
424
424
|
cluster_name=cluster_name,
|
425
425
|
ip_address=ip_address,
|
426
426
|
app_values=app_values,
|
@@ -430,6 +430,9 @@ def pool__start(cluster_name, *others, only_registered_users: bool=False, ip_ad
|
|
430
430
|
location=location
|
431
431
|
)
|
432
432
|
|
433
|
+
if "error" in result:
|
434
|
+
console.log(f"[red]{result}")
|
435
|
+
|
433
436
|
return None
|
434
437
|
|
435
438
|
@arguably.command
|
@@ -511,11 +514,16 @@ def pool__join(token, *others, node_name=None):
|
|
511
514
|
console.log("[red]Installation aborted")
|
512
515
|
return
|
513
516
|
|
517
|
+
# select IP address (for external discovery)
|
518
|
+
console.log(f"Scanning for valid IPs")
|
519
|
+
ip_address = select_ip_address()
|
520
|
+
|
514
521
|
console.log("Connecting worker to the pool...")
|
515
522
|
result = join_pool(
|
516
523
|
token=token,
|
517
524
|
node_name=node_name,
|
518
|
-
num_gpus=num_gpus
|
525
|
+
num_gpus=num_gpus,
|
526
|
+
ip_address=ip_address
|
519
527
|
)
|
520
528
|
if "error" in result:
|
521
529
|
console.log(f"[red]Error when connecting: {result}")
|
@@ -1046,7 +1054,7 @@ def job__run(template_name, *others, values: str=None, force_namespace: str=None
|
|
1046
1054
|
)
|
1047
1055
|
|
1048
1056
|
if "error" in result:
|
1049
|
-
console.log(f"[red]Error when deploying job: {str(
|
1057
|
+
console.log(f"[red]Error when deploying job: {str(result['error'])}")
|
1050
1058
|
else:
|
1051
1059
|
console.log(f"[green]{template_name} job deployed")
|
1052
1060
|
|
kalavai_client/core.py
CHANGED
@@ -267,6 +267,8 @@ def fetch_job_details(jobs: list[Job]):
|
|
267
267
|
if ns != namespace: # same job name, different namespace
|
268
268
|
continue
|
269
269
|
for _, values in ss.items():
|
270
|
+
# TODO get 'restart_count' from values['conditions'][-1]["restart_count"]
|
271
|
+
# TODO: get nodes involved in deployment (needs kubewatcher)
|
270
272
|
workers_status[values["status"]] += 1
|
271
273
|
workers = "\n".join([f"{k}: {v}" for k, v in workers_status.items()])
|
272
274
|
# get URL details
|
@@ -287,10 +289,12 @@ def fetch_job_details(jobs: list[Job]):
|
|
287
289
|
urls = [f"http://{load_server_info(data_key=SERVER_IP_KEY, file=USER_LOCAL_SERVER_FILE)}:{node_port}" for node_port in node_ports]
|
288
290
|
if "Ready" in workers_status and len(workers_status) == 1:
|
289
291
|
status = "running"
|
290
|
-
elif any([st in workers_status for st in ["Failed"
|
292
|
+
elif any([st in workers_status for st in ["Failed"]]):
|
291
293
|
status = "error"
|
292
|
-
elif any([st in workers_status for st in ["Pending"]]):
|
294
|
+
elif any([st in workers_status for st in ["Pending"]]) or len(workers_status) == 0:
|
293
295
|
status = "pending"
|
296
|
+
elif any([st in workers_status for st in ["Succeeded", "Completed"]]):
|
297
|
+
status = "completed"
|
294
298
|
else:
|
295
299
|
status = "working"
|
296
300
|
job_details.append(
|
@@ -569,7 +573,7 @@ def get_max_gpus():
|
|
569
573
|
except:
|
570
574
|
return 0
|
571
575
|
|
572
|
-
def join_pool(token, num_gpus=None, node_name=None):
|
576
|
+
def join_pool(token, num_gpus=None, node_name=None, ip_address=None):
|
573
577
|
compatibility = check_worker_compatibility()
|
574
578
|
if len(compatibility["issues"]) > 0:
|
575
579
|
return {"error": compatibility["issues"]}
|
@@ -626,6 +630,7 @@ def join_pool(token, num_gpus=None, node_name=None):
|
|
626
630
|
# Generate docker compose recipe
|
627
631
|
generate_compose_config(
|
628
632
|
role="agent",
|
633
|
+
node_ip_address=ip_address,
|
629
634
|
pool_ip=f"https://{kalavai_seed_ip}:6443",
|
630
635
|
pool_token=kalavai_token,
|
631
636
|
num_gpus=num_gpus,
|
@@ -701,6 +706,9 @@ def create_pool(cluster_name: str, ip_address: str, app_values: str=None, pool_c
|
|
701
706
|
node_labels[USER_NODE_LABEL] = user["username"]
|
702
707
|
except Exception as e:
|
703
708
|
return {"error": f"[red]Error when joining network: {str(e)}"}
|
709
|
+
|
710
|
+
if num_gpus is None:
|
711
|
+
num_gpus = get_max_gpus()
|
704
712
|
|
705
713
|
# Generate docker compose recipe
|
706
714
|
generate_compose_config(
|
@@ -1,25 +1,25 @@
|
|
1
|
-
kalavai_client/__init__.py,sha256=
|
1
|
+
kalavai_client/__init__.py,sha256=dvpDhTkmNamlNO7OXBsIRPkPtiJwYmu6MDBdqY8X8Q4,23
|
2
2
|
kalavai_client/__main__.py,sha256=WQUfxvRsBJH5gsCJg8pLz95QnZIj7Ol8psTO77m0QE0,73
|
3
3
|
kalavai_client/assets/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
4
|
-
kalavai_client/assets/apps.yaml,sha256=
|
4
|
+
kalavai_client/assets/apps.yaml,sha256=bMHyCrvdqmBvkoEm0uJDKZj7UziIopeqf7wqDBDSzao,5982
|
5
5
|
kalavai_client/assets/apps_values.yaml,sha256=CjKVelPQHd-hm-DTMEuya92feKiphU9mh3HrosLYYPE,1676
|
6
6
|
kalavai_client/assets/docker-compose-gui.yaml,sha256=oE-neG3HC2PhdH-mIxrZdQlhqnycrSP_p8fRxjaxDFE,192
|
7
|
-
kalavai_client/assets/docker-compose-template.yaml,sha256=
|
7
|
+
kalavai_client/assets/docker-compose-template.yaml,sha256=ii24Nn-dM5cZk9lxFgrzxnmK7yv_6kIIw7KUlWhvYeI,2831
|
8
8
|
kalavai_client/assets/nginx.conf,sha256=drVVCg8GHucz7hmt_BI6giAhK92OV71257NTs3LthwM,225
|
9
9
|
kalavai_client/assets/pool_config_template.yaml,sha256=fFz4w2-fMKD5KvyzFdfcWD_jSneRlmnjLc8hCctweX0,576
|
10
10
|
kalavai_client/assets/pool_config_values.yaml,sha256=VrM3XHQfQo6QLZ68qvagooUptaYgl1pszniY_JUtemk,233
|
11
11
|
kalavai_client/assets/user_workspace.yaml,sha256=wDvlMYknOPABAEo0dsQwU7bac8iubjAG9tdkFbJZ5Go,476
|
12
12
|
kalavai_client/assets/user_workspace_values.yaml,sha256=G0HOzQUxrDMCwuW9kbWUZaKMzDDPVwDwzBHCL2Xi2ZM,542
|
13
13
|
kalavai_client/auth.py,sha256=QsBh28L2LwjBBK6pTUE4Xu36lLDTyetyU1YfS1Hbb6g,1717
|
14
|
-
kalavai_client/bridge_api.py,sha256=
|
15
|
-
kalavai_client/bridge_models.py,sha256=
|
16
|
-
kalavai_client/cli.py,sha256=
|
14
|
+
kalavai_client/bridge_api.py,sha256=lFS1fvH7UQxZ24vrHGeea5z8bnGWhOZhgU_zKIrnlHI,4891
|
15
|
+
kalavai_client/bridge_models.py,sha256=hWxEODqHwc8Sj21zkIZoZmU9W3PvNdK-CA1tH6yMQ4s,798
|
16
|
+
kalavai_client/cli.py,sha256=cLP7Vbh_eSJb8i8VuCTpCpXB4mMeESrYMBfH7XbIqJM,48098
|
17
17
|
kalavai_client/cluster.py,sha256=gwjmdsd--YrffT0BmZDOEpbrdm3lPskUuN5jdgcrOR0,12947
|
18
|
-
kalavai_client/core.py,sha256=
|
18
|
+
kalavai_client/core.py,sha256=c9UI_RJ7QmvWPfB9VQpc5QtNCbExOcPtGc-zed1ZgzI,30187
|
19
19
|
kalavai_client/env.py,sha256=Zg2pP-xGJpQumo56KMBxBLgIsBmcNN0S9R-ZP2-s630,2604
|
20
20
|
kalavai_client/utils.py,sha256=rz5W9PRZrTpgdmOs6yeqUi4f_q_L-3BJ5g1o7Asgnyo,13386
|
21
|
-
kalavai_client-0.5.
|
22
|
-
kalavai_client-0.5.
|
23
|
-
kalavai_client-0.5.
|
24
|
-
kalavai_client-0.5.
|
25
|
-
kalavai_client-0.5.
|
21
|
+
kalavai_client-0.5.23.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
22
|
+
kalavai_client-0.5.23.dist-info/METADATA,sha256=m9SsgUBy3ynOMkhPBWQycPlDXdVUnOa2USgclKyp6eM,14443
|
23
|
+
kalavai_client-0.5.23.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
24
|
+
kalavai_client-0.5.23.dist-info/entry_points.txt,sha256=9T6D45gxwzfVbglMm1r6XPdXuuZdHfy_7fCeu2jUphc,50
|
25
|
+
kalavai_client-0.5.23.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|