naeural-client 2.5.1__py3-none-any.whl → 2.5.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.
naeural_client/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "2.5.1"
1
+ __VER__ = "2.5.3"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -222,7 +222,7 @@ class GenericSession(BaseDecentrAIObject):
222
222
 
223
223
  if local_cache_base_folder is None or use_home_folder:
224
224
  # use_home_folder allows us to use the home folder as the base folder
225
- local_cache_base_folder = get_user_folder()
225
+ local_cache_base_folder = str(get_user_folder())
226
226
  # end if
227
227
 
228
228
 
@@ -1838,6 +1838,84 @@ class GenericSession(BaseDecentrAIObject):
1838
1838
 
1839
1839
  return pipeline, instance
1840
1840
 
1841
+
1842
+ def create_and_deploy_balanced_web_app(
1843
+ self,
1844
+ *,
1845
+ nodes,
1846
+ name,
1847
+ signature,
1848
+ ngrok_edge_label,
1849
+ endpoints=None,
1850
+ extra_debug=False,
1851
+ **kwargs
1852
+ ):
1853
+ """
1854
+ Create a new web app on a list of nodes.
1855
+
1856
+ Parameters
1857
+ ----------
1858
+
1859
+ nodes : list
1860
+ List of addresses or Names of the Naeural Edge Protocol edge nodes that will handle this web app.
1861
+
1862
+ name : str
1863
+ Name of the web app.
1864
+
1865
+ signature : str
1866
+ The signature of the plugin that will be used. Defaults to PLUGIN_SIGNATURES.CUSTOM_WEBAPI_01.
1867
+
1868
+ ngrok_edge_label : str
1869
+ The label of the edge node that will be used to expose the web app. This is mandatory due to the fact
1870
+ that the web app will be exposed using ngrok from multiple nodes that all will share the same edge label.
1871
+
1872
+ endpoints : list[dict], optional
1873
+ A list of dictionaries defining the endpoint configuration. Defaults to None.
1874
+
1875
+
1876
+
1877
+ """
1878
+
1879
+ ngrok_use_api = True
1880
+ use_ngrok=True,
1881
+
1882
+ # if isinstance(signature, str):
1883
+
1884
+ pipelines, instances = [], []
1885
+
1886
+ for node in nodes:
1887
+ self.P("Creating web app on node {}...".format(node), color='y')
1888
+ pipeline: WebappPipeline = self.create_pipeline(
1889
+ node=nodes[0],
1890
+ name=name,
1891
+ pipeline_type=WebappPipeline,
1892
+ extra_debug=extra_debug,
1893
+ # default TYPE is "Void"
1894
+ )
1895
+
1896
+ instance = pipeline.create_plugin_instance(
1897
+ signature=signature,
1898
+ instance_id=self.log.get_unique_id(),
1899
+ use_ngrok=use_ngrok,
1900
+ ngrok_edge_label=ngrok_edge_label,
1901
+ ngrok_use_api=ngrok_use_api,
1902
+ **kwargs
1903
+ )
1904
+
1905
+ if endpoints is not None:
1906
+ for endpoint in endpoints:
1907
+ assert isinstance(endpoint, dict), "Each endpoint must be a dictionary defining the endpoint configuration."
1908
+ instance.add_new_endpoint(**endpoint)
1909
+ # end for
1910
+ # end if we have endpoints defined in the call
1911
+
1912
+ pipeline.deploy()
1913
+ pipelines.append(pipeline)
1914
+ instances.append(instance)
1915
+ # end for
1916
+ return pipelines, instances
1917
+
1918
+
1841
1919
 
1842
1920
  def create_telegram_simple_bot(
1843
1921
  self,
@@ -26,7 +26,7 @@ CLI_COMMANDS = {
26
26
  "description": "Show the current configuration including the location",
27
27
  },
28
28
  "reset": {
29
- "func": reset_config,
29
+ "func": reset_config, # DONE
30
30
  "description": "Reset the configuration to default",
31
31
  },
32
32
  "addr": {
@@ -32,9 +32,9 @@ def log_with_color(s, color='n'):
32
32
  'g': '\033[32m', # Green
33
33
  'y': '\033[33m', # Yellow
34
34
  # 'b': "\x1b[1;34m", # bright blue
35
- 'b': "\x1b[1;36m", # bright cyan
35
+ 'b': "\033[36m", # bright cyan
36
36
  'w': '\033[97m', # Light white
37
- 'c': "\x1b[1;36m", # bright cyan
37
+ 'c': "\033[36m", # bright cyan
38
38
  'n': '\033[37m', # Dark white (default)
39
39
  }
40
40
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.5.1
3
+ Version: 2.5.3
4
4
  Summary: `naeural_client` is the Python SDK required for client app development for the Naeural Edge Protocol Edge Protocol framework
5
5
  Project-URL: Homepage, https://github.com/NaeuralEdgeProtocol/naeural_client
6
6
  Project-URL: Bug Tracker, https://github.com/NaeuralEdgeProtocol/naeural_client/issues
@@ -1,10 +1,10 @@
1
1
  naeural_client/__init__.py,sha256=GP8WSrn87sjTPO-QRNL2PG8JK5Mixbiea_HrtbG8RAQ,592
2
- naeural_client/_ver.py,sha256=h7_TcvTF6Uh4pwHhVPbFlbsXRsmLWHYtIth7wH7eNy0,330
2
+ naeural_client/_ver.py,sha256=r5w3HeHrtihAwIsMJxe70OCNHHJ1O-xejp5y-QJtag4,330
3
3
  naeural_client/base_decentra_object.py,sha256=C4iwZTkhKNBS4VHlJs5DfElRYLo4Q9l1V1DNVSk1fyQ,4412
4
4
  naeural_client/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  naeural_client/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
6
6
  naeural_client/base/distributed_custom_code_presets.py,sha256=cvz5R88P6Z5V61Ce1vHVVh8bOkgXd6gve_vdESDNAsg,2544
7
- naeural_client/base/generic_session.py,sha256=0DQsq3-4i61-7flElK5lx-AzK3uwrDvJGbHzbUmH3gU,82553
7
+ naeural_client/base/generic_session.py,sha256=byrjQ6J-VsDj12LZbq0wRgDwQeJuH-soHqZNET_2Wa0,84855
8
8
  naeural_client/base/instance.py,sha256=kcZJmjLBtx8Bjj_ysIOx1JmLA-qSpG7E28j5rq6IYus,20444
9
9
  naeural_client/base/pipeline.py,sha256=b4uNHrEIOlAtw4PGUx20dxwBhDck5__SrVXaHcSi8ZA,58251
10
10
  naeural_client/base/plugin_template.py,sha256=qGaXByd_JZFpjvH9GXNbT7KaitRxIJB6-1IhbKrZjq4,138123
@@ -21,7 +21,7 @@ naeural_client/certs/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hS
21
21
  naeural_client/certs/r9092118.ala.eu-central-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a4Pmde1z1gPULtJNSYUpG_YFkYaMKU,1337
22
22
  naeural_client/cli/README.md,sha256=WPdI_EjzAbUW1aPyj1sSR8rLydcJKZtoiaEtklQrjHo,74
23
23
  naeural_client/cli/cli.py,sha256=cq3upG-uc_uxEgX1O5qm2z-g3PQAp65E4KgTgAHAYZQ,2882
24
- naeural_client/cli/cli_commands.py,sha256=VK7jGCl-C5Bel6RUz5Qcf5mAT7at7bEUn52OV1xdff8,1309
24
+ naeural_client/cli/cli_commands.py,sha256=_oPGZ4nq24qNmXHknkYO8Hb2-SSCRgsR5L_Ac-7dxsM,1316
25
25
  naeural_client/cli/nodes.py,sha256=MkDFfw02iW_qNP9mPolJbGHPByL__ZHSpGODunbz80M,1953
26
26
  naeural_client/code_cheker/__init__.py,sha256=pwkdeZGVL16ZA4Qf2mRahEhoOvKhL7FyuQbMFLr1E5M,33
27
27
  naeural_client/code_cheker/base.py,sha256=lT5DRIFO5rqzsMNCmdMRfkAeevmezozehyfgmhnKpuI,19074
@@ -79,10 +79,10 @@ naeural_client/logging/tzlocal/win32.py,sha256=zBoj0vFVrGhnCm_f7xmYzGym4-fV-4Ij2
79
79
  naeural_client/logging/tzlocal/windows_tz.py,sha256=Sv9okktjZJfRGGUOOppsvQuX_eXyXUxkSKCAFmWT9Hw,34203
80
80
  naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uwpmI,77
81
81
  naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
82
- naeural_client/utils/config.py,sha256=PORcwfYdy-z9hwYzBag1RR6Lv5lWUtWVxZAyN9cjWxA,4562
82
+ naeural_client/utils/config.py,sha256=R4pH6KkpiryMpxOBNrtBK8ncLYe_dj7QvucK66zK6Lo,4558
83
83
  naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
84
- naeural_client-2.5.1.dist-info/METADATA,sha256=4CIHpXMmxsJ-MNeh52yI6y4le4uguhhiDX-z8yHkheg,14493
85
- naeural_client-2.5.1.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
- naeural_client-2.5.1.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
- naeural_client-2.5.1.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
- naeural_client-2.5.1.dist-info/RECORD,,
84
+ naeural_client-2.5.3.dist-info/METADATA,sha256=YaB0zZgxiFoDhpUC1X0IozniAwud4Z26fkdHJM-GFPk,14493
85
+ naeural_client-2.5.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
+ naeural_client-2.5.3.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
+ naeural_client-2.5.3.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
+ naeural_client-2.5.3.dist-info/RECORD,,