ratio1 3.4.63__py3-none-any.whl → 3.4.64__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.
ratio1/_ver.py CHANGED
@@ -1,4 +1,4 @@
1
- __VER__ = "3.4.63"
1
+ __VER__ = "3.4.64"
2
2
 
3
3
  if __name__ == "__main__":
4
4
  with open("pyproject.toml", "rt") as fd:
@@ -143,7 +143,12 @@ CLI_COMMANDS = {
143
143
  },
144
144
  "oracle-rollout": {
145
145
  "func": oracle_rollout,
146
- "description": "Rollout update on all nodes in the network. The rollout order is seed nodes -> oracle nodes -> all other edge nodes. This command is needed when defining new environment variables in seed nodes, in order to make it available to all nodes in the network."
146
+ "description": "Rollout update on all nodes in the network. The rollout order is seed nodes -> oracle nodes -> all other edge nodes. This command is needed when defining new environment variables in seed nodes, in order to make it available to all nodes in the network.",
147
+ "params": {
148
+ "--skip-seeds": "Skip the seed nodes in the rollout (flag)",
149
+ "--skip-oracles": "Skip the oracle nodes in the rollout (flag)",
150
+ "--no-timeout": "Do not wait between nodes restarts (flag)",
151
+ }
147
152
  },
148
153
  "inspect": {
149
154
  "func": inspect_node,
ratio1/cli/oracles.py CHANGED
@@ -219,6 +219,13 @@ if True:
219
219
  This function is needed in order to ensure that all nodes in the network receive the new configuration defined on the seed nodes.
220
220
  """
221
221
  silent = not args.verbose
222
+ skip_seeds = args.skip_seeds
223
+ skip_oracles = args.skip_oracles
224
+ no_timeout = args.no_timeout
225
+
226
+ log_with_color("======================================================", color='b')
227
+ log_with_color("Starting Oracle Rollout...", color='g')
228
+ log_with_color("======================================================", color='b')
222
229
  session = Session(
223
230
  silent=True
224
231
  )
@@ -227,6 +234,10 @@ if True:
227
234
 
228
235
  log_with_color(f"ATTENTION! Current network: {current_network}", color='y')
229
236
  log_with_color(f"Are you sure you want to restart ALL nodes on the network {current_network}?", color='b')
237
+ if skip_seeds:
238
+ log_with_color("During this run seed nodes will be skipped...", color='b')
239
+ if skip_oracles:
240
+ log_with_color("During this run oracle nodes will be skipped...", color='b')
230
241
  user_confirmation = input(f"Write down 'RESTART ALL on {current_network}' in order to proceed...\n >")
231
242
 
232
243
  if user_confirmation != f"RESTART ALL on {current_network}":
@@ -246,15 +257,19 @@ if True:
246
257
  if node['address'] not in seed_nodes_addresses
247
258
  ]
248
259
 
249
- # 1. Send restart command to Seed Nodes.
250
- log_with_color(f"Sending restart commands to {len(seed_nodes_addresses)} seed nodes: {seed_nodes_addresses}", color='b')
251
- _send_restart_command(session=session, nodes=seed_nodes_addresses)
260
+ if not (skip_seeds or skip_oracles):
261
+ # 1. Send restart command to Seed Nodes.
262
+ log_with_color(f"Sending restart commands to {len(seed_nodes_addresses)} seed nodes: {seed_nodes_addresses}",
263
+ color='b')
264
+ _send_restart_command(session=session, nodes=seed_nodes_addresses)
252
265
 
253
- # Remove seed node addresses from all_nodes_addresses
254
- log_with_color(
255
- f"Seed nodes restarted. Waiting 30 seconds before sending restart commands to all Oracle nodes, except seed nodes.",
256
- color='g')
257
- sleep(30)
266
+ # Remove seed node addresses from all_nodes_addresses
267
+ log_with_color(
268
+ f"Seed nodes restarted. Waiting 30 seconds before sending restart commands to all Oracle nodes, except seed nodes.",
269
+ color='g')
270
+ sleep(30)
271
+ else:
272
+ log_with_color("Skipping Seed Nodes restart as per user request.", color='y')
258
273
 
259
274
  # 2. Send restart commands to all Oracle nodes, except seed nodes.
260
275
  oracle_nodes_addresses = [
@@ -263,9 +278,14 @@ if True:
263
278
  if node['oracle'] == True
264
279
  ]
265
280
 
266
- log_with_color(f"Sending restart commands to {len(oracle_nodes_addresses)} Non-Seed Oracle nodes, except seed nodes: {remaining_nodes}", color='b')
281
+ if not skip_oracles:
282
+ log_with_color(
283
+ f"Sending restart commands to {len(oracle_nodes_addresses)} Non-Seed Oracle nodes, except seed nodes: {remaining_nodes}",
284
+ color='b')
267
285
 
268
- _send_restart_command(session=session, nodes=oracle_nodes_addresses)
286
+ _send_restart_command(session=session, nodes=oracle_nodes_addresses)
287
+ else:
288
+ log_with_color("Skipping Oracle Nodes restart as per user request.", color='y')
269
289
 
270
290
  # Remove oracle node addresses from all_nodes_addresses
271
291
  remaining_nodes_addresses = [
@@ -282,10 +302,18 @@ if True:
282
302
  # 3. Send restart command to all remaining edge nodes.
283
303
  log_with_color(f"Sending restart commands to {len(remaining_nodes_addresses)} remaining edge nodes: {remaining_nodes_addresses}", color='b')
284
304
 
285
- _send_restart_command(session=session, nodes=remaining_nodes_addresses, timeout_min=5, timeout_max=25)
286
-
287
- restarted_seed_nodes_count = len(seed_nodes_addresses)
288
- restarted_oracle_nodes_count = len(oracle_nodes_addresses)
305
+ timeout_min = 0
306
+ timeout_max = 0
307
+ if not no_timeout:
308
+ timeout_min = 5
309
+ timeout_max = 25
310
+ _send_restart_command(session=session, nodes=remaining_nodes_addresses, timeout_min=timeout_min, timeout_max=timeout_max)
311
+ restarted_seed_nodes_count = 0
312
+ restarted_oracle_nodes_count = 0
313
+ if not (skip_seeds or skip_oracles):
314
+ restarted_seed_nodes_count = len(seed_nodes_addresses)
315
+ if not skip_oracles:
316
+ restarted_oracle_nodes_count = len(oracle_nodes_addresses)
289
317
  restarted_edge_nodes_count = len(remaining_nodes_addresses)
290
318
  total_restarted_nodes_count = restarted_seed_nodes_count + restarted_oracle_nodes_count + restarted_edge_nodes_count
291
319
  log_with_color(f"All nodes restarted successfully.", color='g')
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: ratio1
3
- Version: 3.4.63
3
+ Version: 3.4.64
4
4
  Summary: `ratio1` or Ration1 SDK is the Python SDK required for client app development for the Ratio1 ecosystem
5
5
  Project-URL: Homepage, https://github.com/Ratio1/ratio1_sdk
6
6
  Project-URL: Bug Tracker, https://github.com/Ratio1/ratio1_sdk/issues
@@ -1,5 +1,5 @@
1
1
  ratio1/__init__.py,sha256=YimqgDbjLuywsf8zCWE0EaUXH4MBUrqLxt0TDV558hQ,632
2
- ratio1/_ver.py,sha256=h1c9I8R1V4h2oEeauinxPlBeE67TsUImF1E3h6NseM0,331
2
+ ratio1/_ver.py,sha256=apdBRFB-bx7WR3VLm33OiAve92ZrvCeTVUbXvaQi4N4,331
3
3
  ratio1/base_decentra_object.py,sha256=iXvAAf6wPnGWzeeiRfwLojVoan-m1e_VsyPzjUQuENo,4492
4
4
  ratio1/plugins_manager_mixin.py,sha256=X1JdGLDz0gN1rPnTN_5mJXR8JmqoBFQISJXmPR9yvCo,11106
5
5
  ratio1/base/__init__.py,sha256=hACh83_cIv7-PwYMM3bQm2IBmNqiHw-3PAfDfAEKz9A,259
@@ -25,9 +25,9 @@ ratio1/certs/r9092118.ala.eu-central-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a4Pmde
25
25
  ratio1/certs/s624dbd4.ala.us-east-1.emqxsl.com.crt,sha256=y-6io0tseyx9-a4Pmde1z1gPULtJNSYUpG_YFkYaMKU,1337
26
26
  ratio1/cli/README.md,sha256=YsT23YcZBRyTKReNZPxD762YqstSWKWz4iZe_UJELPc,73
27
27
  ratio1/cli/cli.py,sha256=D8UCtdTQKi1IqB_PAi3k2FfaM-rnfxmlrOzM4OJBOsA,4352
28
- ratio1/cli/cli_commands.py,sha256=aoPnASJ3uPHWqABLCL-E6J3U0npK7kxX8U07s_aR9qA,6290
28
+ ratio1/cli/cli_commands.py,sha256=oRt9o1hKIbWDnM4TdR4j4FkygnehbW_CiiygXbfiKd0,6544
29
29
  ratio1/cli/nodes.py,sha256=EZxjw8G8Kj0PPMHtUJoefm4QootrU50GHlpaJOiHxJo,13787
30
- ratio1/cli/oracles.py,sha256=HTQAKEwe-j0E00JKKPCH1GXjelyy0IAjzLZIx8qtimU,11141
30
+ ratio1/cli/oracles.py,sha256=b6ziUerZl0hZIk6-0SKaqCu6xxB6L9Z6n4_0bpo8Nk0,12269
31
31
  ratio1/cli/package_update.py,sha256=uRMPW5XV3fBdB_eZfoQDA1SKnJzTJvyfpRJA6T3ZZlQ,4000
32
32
  ratio1/code_cheker/__init__.py,sha256=pwkdeZGVL16ZA4Qf2mRahEhoOvKhL7FyuQbMFLr1E5M,33
33
33
  ratio1/code_cheker/base.py,sha256=hMnM94xro_r0Kze2KLwr00TKZ1HgshlxXmwql_SEz5I,19066
@@ -103,8 +103,8 @@ ratio1/utils/comm_utils.py,sha256=4cS9llRr_pK_3rNgDcRMCQwYPO0kcNU7AdWy_LtMyCY,10
103
103
  ratio1/utils/config.py,sha256=Elfkl7W4aDMvB5WZLiYlPXrecBncgTxb4hcKhQedMzI,10111
104
104
  ratio1/utils/dotenv.py,sha256=_AgSo35n7EnQv5yDyu7C7i0kHragLJoCGydHjvOkrYY,2008
105
105
  ratio1/utils/oracle_sync/oracle_tester.py,sha256=aJOPcZhtbw1XPqsFG4qYpfv2Taj5-qRXbwJzrPyeXDE,27465
106
- ratio1-3.4.63.dist-info/METADATA,sha256=xBir5wLNq-5yftwaF5rwxbfcDUSfV6wPYwi1W5jSwdY,12255
107
- ratio1-3.4.63.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
- ratio1-3.4.63.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
- ratio1-3.4.63.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
- ratio1-3.4.63.dist-info/RECORD,,
106
+ ratio1-3.4.64.dist-info/METADATA,sha256=N6gYsCG3RTsG5-iV20G-ScPTZRsnKBn0iTRH7YVeAV4,12255
107
+ ratio1-3.4.64.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
108
+ ratio1-3.4.64.dist-info/entry_points.txt,sha256=DR_olREzU1egwmgek3s4GfQslBi-KR7lXsd4ap0TFxE,46
109
+ ratio1-3.4.64.dist-info/licenses/LICENSE,sha256=cvOsJVslde4oIaTCadabXnPqZmzcBO2f2zwXZRmJEbE,11311
110
+ ratio1-3.4.64.dist-info/RECORD,,