naeural-client 2.6.20__py3-none-any.whl → 2.6.21__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.6.20"
1
+ __VER__ = "2.6.21"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -347,7 +347,9 @@ class _JSONSerializationMixin(object):
347
347
  fname,
348
348
  subfolder_path=None,
349
349
  verbose=True,
350
- locking=True):
350
+ locking=True,
351
+ indent=True,
352
+ ):
351
353
  save_dir = self._data_dir
352
354
  if subfolder_path is not None:
353
355
  save_dir = os.path.join(save_dir, subfolder_path.lstrip('/'))
@@ -356,7 +358,10 @@ class _JSONSerializationMixin(object):
356
358
  datafile = os.path.join(save_dir, fname)
357
359
  if verbose:
358
360
  self.verbose_log('Saving data json: {}'.format(datafile))
359
- self.thread_safe_save(datafile=datafile, data_json=data_json, locking=locking)
361
+ self.thread_safe_save(
362
+ datafile=datafile, data_json=data_json, locking=locking,
363
+ indent=indent,
364
+ )
360
365
  return datafile
361
366
 
362
367
  def load_output_json(self, fname, **kwargs):
@@ -409,8 +414,10 @@ class _JSONSerializationMixin(object):
409
414
  def save_json(self, dct, fname, locking=True):
410
415
  return self.thread_safe_save(datafile=fname, data_json=dct, locking=locking)
411
416
 
412
- def save_json_to_data(self, dct, fname, subfolder_path=None, locking=True):
413
- return self.save_data_json(data_json=dct, fname=fname, subfolder_path=subfolder_path, locking=locking)
417
+ def save_json_to_data(self, dct, fname, subfolder_path=None, locking=True, indent=True):
418
+ return self.save_data_json(
419
+ data_json=dct, fname=fname, subfolder_path=subfolder_path, locking=locking, indent=indent,
420
+ )
414
421
 
415
422
  def load_dict_from_data(self, fn):
416
423
  return self.load_data_json(fn)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: naeural_client
3
- Version: 2.6.20
3
+ Version: 2.6.21
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
@@ -87,25 +87,68 @@ Starting with version 2.6+, the Ratio1 SDK automatically performs self-configura
87
87
  Launch a local Ratio1 Edge Node using Docker:
88
88
 
89
89
  ```bash
90
- docker run -d --name=local_node ratio1/edge_node:develop
90
+ docker run -d --name=r1node naeural/edge_node:develop
91
91
  ```
92
92
 
93
+ if you want to have a persistent volume for the node, you can use the following command:
94
+
95
+ ```bash
96
+ docker run -d --name=r1node -v r1vol:/edge_node/_local_cache naeural/edge_node:develop
97
+ ```
98
+ This way the node will store its data in the `r1vol` volume, and you can stop and start the node without losing data you might have stored in the node via deployed jobs from your SDK.
99
+
93
100
  After a few seconds, the node will be online. Retrieve the node's address by running:
94
101
 
95
102
  ```bash
96
- docker exec local_node get_node_info
103
+ docker exec r1node get_node_info
97
104
  ```
98
105
 
99
106
  The output will resemble:
100
107
 
101
108
  ```json
102
109
  {
103
- "address": "0xai_AtMvIwaEPi5M8cnkdbaZ3tbUhCzKbGKEYuZ1xFtCjT_6",
104
- "alias": "6dd74472642e",
105
- "eth_address": "0x98FE7c0d8CeC2E97B932D2bDC1bb73B395C9Dfd7"
110
+ "address": "0xai_A2pPf0lxZSZkGONzLOmhzndncc1VvDBHfF-YLWlsrG9m",
111
+ "alias": "5ac5438a2775",
112
+ "eth_address": "0xc440cdD0BBdDb5a271de07d3378E31Cb8D9727A5",
113
+ "version_long": "v2.5.36 | core v7.4.23 | SDK 2.6.15",
114
+ "version_short": "v2.5.36",
115
+ "info": {
116
+ "whitelist": []
117
+ }
106
118
  }
107
119
  ```
108
120
 
121
+ As you can see, the node is online and NOT ready to accept workloads due to the fact that it has no whitelisted clients. To whitelist your client, you need to use the `add_allowed` command:
122
+
123
+ ```bash
124
+ docker exec r1node add_allowed <address> [<alias>]
125
+ ```
126
+
127
+ where `<address>` is the address of your client and `<alias>` is an optional alias for your client.
128
+ A example of whitelisting a client is:
129
+
130
+ ```bash
131
+ docker exec r1node add_allowed 0xai_AthDPWc_k3BKJLLYTQMw--Rjhe3B6_7w76jlRpT6nDeX some-node-alias
132
+ ```
133
+
134
+ You will then receive a response similar to:
135
+
136
+ ```json
137
+ {
138
+ "address": "0xai_A2pPf0lxZSZkGONzLOmhzndncc1VvDBHfF-YLWlsrG9m",
139
+ "alias": "5ac5438a2775",
140
+ "eth_address": "0xc440cdD0BBdDb5a271de07d3378E31Cb8D9727A5",
141
+ "version_long": "v2.5.36 | core v7.4.23 | SDK 2.6.15",
142
+ "version_short": "v2.5.36",
143
+ "info": {
144
+ "whitelist": [
145
+ "0xai_AthDPWc_k3BKJLLYTQMw--Rjhe3B6_7w76jlRpT6nDeX"
146
+ ]
147
+ }
148
+ }
149
+ ```
150
+
151
+
109
152
  ### 2. Develop and Deploy Jobs
110
153
 
111
154
  Use the SDK to develop and send workloads to the Edge Nodes. Below are examples of both local and remote execution.
@@ -1,5 +1,5 @@
1
1
  naeural_client/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
2
- naeural_client/_ver.py,sha256=WR8ZZSkBwsolx6a_VQw1H3uvQwKK3JwQR7p00eNY9fQ,331
2
+ naeural_client/_ver.py,sha256=kFGndkm_hX8gYbLO6UpvgQZERhcrl4bcCfQArhnwgBM,331
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
@@ -65,7 +65,7 @@ naeural_client/logging/logger_mixins/computer_vision_mixin.py,sha256=TrtG7ayM2ab
65
65
  naeural_client/logging/logger_mixins/datetime_mixin.py,sha256=x0l2mhhmNZ6r_SmJ5or7dxAf2e4tQL0LiBsj3RDu6pU,11288
66
66
  naeural_client/logging/logger_mixins/download_mixin.py,sha256=8eu3w-H1LI6OmC_ZwzU3WrWMENQKdEZ2HjnQsAixwM0,13500
67
67
  naeural_client/logging/logger_mixins/general_serialization_mixin.py,sha256=3glOuN6Whi_GSxb1OiFitzypOqkf_x2RJGfGaO51_WE,7440
68
- naeural_client/logging/logger_mixins/json_serialization_mixin.py,sha256=C3HtEAXV7DcWTV0g9K-sDvH4fd5Y_pimVVQylr8TO8M,14462
68
+ naeural_client/logging/logger_mixins/json_serialization_mixin.py,sha256=7usTqigM221C2llVqr-JgtqMX_XYDgjbjAhXnUNXl8M,14594
69
69
  naeural_client/logging/logger_mixins/pickle_serialization_mixin.py,sha256=9BftwBe56e94FXjyf8c8m4GEvIvzNdK_jpQPtIIJbXY,9185
70
70
  naeural_client/logging/logger_mixins/process_mixin.py,sha256=ZO7S1mvKWwH_UIqv7JG-NxizcfWMJqngNNW_K-hESdU,1904
71
71
  naeural_client/logging/logger_mixins/resource_size_mixin.py,sha256=EdCeFM8Ol8q_OTOmsj5Q2uKPvkqkoNdcXSZjw4FgAh4,2297
@@ -81,8 +81,8 @@ naeural_client/utils/__init__.py,sha256=mAnke3-MeRzz3nhQvhuHqLnpaaCSmDxicd7Ck9uw
81
81
  naeural_client/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,1072
82
82
  naeural_client/utils/config.py,sha256=v7xHikr6Z5Sbvf3opYeMhYzGWD2pe0HlRwa-aGJzUh8,6323
83
83
  naeural_client/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
84
- naeural_client-2.6.20.dist-info/METADATA,sha256=bn4N87G-ZFVOI19Qo_OvOLUw5ukRxOM6L1rx7Z-od7U,10362
85
- naeural_client-2.6.20.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
- naeural_client-2.6.20.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
- naeural_client-2.6.20.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
- naeural_client-2.6.20.dist-info/RECORD,,
84
+ naeural_client-2.6.21.dist-info/METADATA,sha256=yfpMO9ABPIG8xBgQ1jTbf_uYnHJUoE-xNjH6FCrhd6E,11764
85
+ naeural_client-2.6.21.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
86
+ naeural_client-2.6.21.dist-info/entry_points.txt,sha256=PNdyotDaQBAslZREx5luVyj0kqpQnwNACwkFNTPIHU4,55
87
+ naeural_client-2.6.21.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
88
+ naeural_client-2.6.21.dist-info/RECORD,,