hestia-earth-utils 0.16.17__py3-none-any.whl → 0.16.19__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.
@@ -1,3 +1,4 @@
1
+ import os
1
2
  from os.path import join
2
3
  import json
3
4
  import numpy as np
@@ -375,3 +376,29 @@ def get_related_nodes_data(
375
376
  }
376
377
  for node in related_nodes
377
378
  ]
379
+
380
+
381
+ def start_instances(multiple_instances: bool = False):
382
+ import boto3
383
+
384
+ client = boto3.client("ec2")
385
+ instance_ids = os.getenv("START_INSTANCE_ID").split(",")
386
+ ids = instance_ids if multiple_instances else [instance_ids[0]]
387
+ try:
388
+ for instance_id in ids:
389
+ response = client.describe_instances(InstanceIds=[instance_id])
390
+ state = response["Reservations"][0]["Instances"][0]["State"]["Name"]
391
+ print(f"Checking {instance_id}: Current state is '{state}'")
392
+
393
+ if state in ["pending", "running"]:
394
+ print(f" -> Instance {instance_id} is already active. Skipping.")
395
+ continue
396
+
397
+ elif state == "stopped":
398
+ print(f" -> Instance {instance_id} is stopped. Starting it now...")
399
+ client.start_instances(InstanceIds=[instance_id])
400
+ break
401
+ except client.exceptions.ClientError as e:
402
+ print(f"Error starting instances: {str(e)}")
403
+
404
+ print("Could not start any instance")
@@ -1 +1 @@
1
- VERSION = "0.16.17"
1
+ VERSION = "0.16.19"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: hestia_earth_utils
3
- Version: 0.16.17
3
+ Version: 0.16.19
4
4
  Summary: HESTIA's utils library
5
5
  Home-page: https://gitlab.com/hestia-earth/hestia-utils
6
6
  Author: HESTIA Team
@@ -9,13 +9,13 @@ hestia_earth/utils/emission.py,sha256=rHHf5vwe-RxTOaOJ9N0MuyJOLpDnPjjxv6MHYSpPgc
9
9
  hestia_earth/utils/lookup.py,sha256=SArKqjqs_Yt5cC6TIk12WVQNToun2spZ_iNUm4fX9FA,8274
10
10
  hestia_earth/utils/lookup_utils.py,sha256=cjYIFSQpcdSCoHqCoz3f5Odkpv_2j5aGn0COOIdz3hg,6948
11
11
  hestia_earth/utils/model.py,sha256=YzQ4Cs3HBlhLGNDvrfv2pM_FrNZhZkg9h7JKIH3CHFE,4626
12
- hestia_earth/utils/pipeline.py,sha256=LYxPXhuSWTwmsLRz_nl_JscFgGYhUAbNQx4Zla5_REM,10292
12
+ hestia_earth/utils/pipeline.py,sha256=EvZKSCle3bFNfy1slD24-4dcziiFuW-e_3Re2liaYao,11319
13
13
  hestia_earth/utils/request.py,sha256=EfitmS13abPxfl5gSAOyHRUYhk4R2Rfv94fF9lvOT00,723
14
14
  hestia_earth/utils/stats.py,sha256=vTNyKcMKmX0DoodM9QEG7HF8qm2Wf-4ckMWQFWZ1VgE,34729
15
15
  hestia_earth/utils/table.py,sha256=MOJDo5fQPRDogAty_UXbO9-EXFwz97m0f7--mOM17lQ,2363
16
16
  hestia_earth/utils/term.py,sha256=aBVYuYv55nPqJPyt5mN4Fz652s_1hwUPckNUZX0pMP8,1064
17
17
  hestia_earth/utils/tools.py,sha256=WMx05cBtBR8mYQnLLBA2cgF1x2tI41514diFDeX4gLQ,7533
18
- hestia_earth/utils/version.py,sha256=yrNYFc1di1CmrRU185XXHiVyfsBROM9GnBuni4puan0,20
18
+ hestia_earth/utils/version.py,sha256=VrVRtGVK4TfmQVWoTS2zNr-zBiDPB4PR-cr4ZXh_o4o,20
19
19
  hestia_earth/utils/pivot/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  hestia_earth/utils/pivot/_shared.py,sha256=ZBmZRLbDN2JHODvQAh9jH_61Koh7Ts0C52xmiw_Bhpo,2827
21
21
  hestia_earth/utils/pivot/pivot_csv.py,sha256=1zGYuC_xlrLoX5FYSG3mt5HSc03CO-0p8J0oAmyI1VI,11778
@@ -25,9 +25,9 @@ hestia_earth/utils/storage/_azure_client.py,sha256=mseexhzjteRDzzoFe2fEXe9MYLmvj
25
25
  hestia_earth/utils/storage/_local_client.py,sha256=KbYqTfniIU5R5J1m_unCQip9kOz9EGIGI0OH0QvD8eo,551
26
26
  hestia_earth/utils/storage/_s3_client.py,sha256=8TCxiHfxE7G8kdp3CnEFrxgmPwfPyci3-blsowE2T7o,3146
27
27
  hestia_earth/utils/storage/_sns_client.py,sha256=pvtXYw-sQ8ns3mlDz7ld9iZp3FYSm0xSXSXMJ5IPnBc,380
28
- hestia_earth_utils-0.16.17.data/scripts/hestia-format-upload,sha256=IhLAHHPJqRgUcht-M_EUEsRMbRbMfshig07o488zscM,703
29
- hestia_earth_utils-0.16.17.data/scripts/hestia-pivot-csv,sha256=0YBuGuyPO8rytod6iwWEKiQdSlr9JLuD001k6U5t6no,1163
30
- hestia_earth_utils-0.16.17.dist-info/METADATA,sha256=MaXvegUxz6wKFMNMEW7Uem0FdST2U0vX5mEL8z0FqU8,1873
31
- hestia_earth_utils-0.16.17.dist-info/WHEEL,sha256=qELbo2s1Yzl39ZmrAibXA2jjPLUYfnVhUNTlyF1rq0Y,92
32
- hestia_earth_utils-0.16.17.dist-info/top_level.txt,sha256=q0QxKEYx9uLpAD5ZtC7Ypq29smEPfOzEAn7Xv8XHGOQ,13
33
- hestia_earth_utils-0.16.17.dist-info/RECORD,,
28
+ hestia_earth_utils-0.16.19.data/scripts/hestia-format-upload,sha256=IhLAHHPJqRgUcht-M_EUEsRMbRbMfshig07o488zscM,703
29
+ hestia_earth_utils-0.16.19.data/scripts/hestia-pivot-csv,sha256=0YBuGuyPO8rytod6iwWEKiQdSlr9JLuD001k6U5t6no,1163
30
+ hestia_earth_utils-0.16.19.dist-info/METADATA,sha256=CTOVT2Ig18F0U0thue8mp6YZs1od2lNzN7pf8vNsvT4,1873
31
+ hestia_earth_utils-0.16.19.dist-info/WHEEL,sha256=wUyA8OaulRlbfwMtmQsvNngGrxQHAvkKcvRmdizlJi0,92
32
+ hestia_earth_utils-0.16.19.dist-info/top_level.txt,sha256=q0QxKEYx9uLpAD5ZtC7Ypq29smEPfOzEAn7Xv8XHGOQ,13
33
+ hestia_earth_utils-0.16.19.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (80.10.1)
2
+ Generator: setuptools (80.10.2)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5