aap-utils 0.1.2__py3-none-any.whl → 0.1.3__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.
aap_utils/register.py CHANGED
@@ -2,6 +2,8 @@ import socket
2
2
  import requests
3
3
  import time
4
4
  import os
5
+ from hydra import initialize, compose
6
+ from omegaconf import OmegaConf, DictConfig
5
7
 
6
8
  def register_demo(debug=False):
7
9
  for attempt in range(10):
@@ -13,7 +15,11 @@ def register_demo(debug=False):
13
15
  headers={"Content-Type": "application/json"}
14
16
  )
15
17
  if response.ok:
16
- url, namespace = create_url()
18
+ response_json = response.json()
19
+ argo_host = response_json.get('ARGOWORKFLOW_HOST', 'http://argowf.aiplatform.vcntt.tech')
20
+ domain_name = argo_host.split("argowf.")[-1]
21
+ url, namespace = create_url(domain_name=domain_name)
22
+
17
23
  # print(f"The demo service is at {namespace}.your_custorm_domain/demo/. Eg: {url}")
18
24
  print(f"The demo service is at {url}")
19
25
  if debug:
@@ -51,5 +57,24 @@ def create_url(domain_name = "aiplatform.vcntt.tech"):
51
57
  raise ValueError(f"The KERNEL_NAMESPACE '{kernel_namespace}' does not follow the expected format.")
52
58
 
53
59
  # Create the final URL
54
- url = f"https://{transformed_namespace}.{domain_name}/demo/"
60
+ url = f"https://{transformed_namespace}.{domain_name}"
55
61
  return url, transformed_namespace
62
+
63
+
64
+ def get_args():
65
+ kcn_params = "config.yaml"
66
+ config_path="configs/config.yaml"
67
+ overrides = []
68
+
69
+ if os.environ.get('KCN_PARAMS') and os.environ.get('KCN_PARAMS') != '':
70
+ full_path = os.getenv('KCN_PARAMS')
71
+ config_path = os.path.join(config_path, kcn_params)
72
+ kcn_params = os.path.basename(full_path) # Extract the filename
73
+
74
+ if os.environ.get('KCN_OVERRIDES') and os.environ.get('KCN_OVERRIDES') != '':
75
+ overrides_env = os.getenv("KCN_OVERRIDES")
76
+ overrides = overrides_env.split('|') if overrides_env else []
77
+
78
+ with initialize(version_base=None, config_path=config_path):
79
+ args = compose(config_name=kcn_params)
80
+ return args
@@ -1,16 +1,11 @@
1
1
  Metadata-Version: 2.1
2
- Name: aap-utils
3
- Version: 0.1.2
2
+ Name: aap_utils
3
+ Version: 0.1.3
4
4
  Summary: A Python library for registering an IP address for AAP
5
- Home-page: UNKNOWN
6
5
  Author: Minh Dang
7
6
  Author-email: danghoangminh86@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
7
  Classifier: Programming Language :: Python :: 3
11
8
  Classifier: License :: OSI Approved :: MIT License
12
9
  Classifier: Operating System :: OS Independent
13
10
  Requires-Dist: requests
14
11
 
15
- UNKNOWN
16
-
@@ -0,0 +1,6 @@
1
+ aap_utils/__init__.py,sha256=OALCpHMgWzr-3Lu7eKwalsw5GNCwWWkETUPHOqfGXsg,36
2
+ aap_utils/register.py,sha256=YDUvUtoICYVMuuzYAueb34ZtGcYI8SJ6YxoNB3POyyQ,3069
3
+ aap_utils-0.1.3.dist-info/METADATA,sha256=8RqkF_j5hIRzy2czLQ8a5Kt_kjjnaEvZResid-aDL2g,346
4
+ aap_utils-0.1.3.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
5
+ aap_utils-0.1.3.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
6
+ aap_utils-0.1.3.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.37.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5
 
@@ -1,6 +0,0 @@
1
- aap_utils/__init__.py,sha256=OALCpHMgWzr-3Lu7eKwalsw5GNCwWWkETUPHOqfGXsg,36
2
- aap_utils/register.py,sha256=aOVv1EhCqUfvIpmLgbWCCMcr-Sk-do3CkhZeVtjdEG0,2046
3
- aap_utils-0.1.2.dist-info/METADATA,sha256=SB1Dci5aG5JfEEbOnUKCD8EhYCKMfPIf9shIZH6VvKg,409
4
- aap_utils-0.1.2.dist-info/WHEEL,sha256=ewwEueio1C2XeHTvT17n8dZUJgOvyCWCt0WVNLClP9o,92
5
- aap_utils-0.1.2.dist-info/top_level.txt,sha256=Qt5xmL8_0_jhMl9uA3lg-xnvs4nCEyVj1tBE4vnp36M,10
6
- aap_utils-0.1.2.dist-info/RECORD,,