isar 1.16.15__py3-none-any.whl → 1.16.17__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.

Potentially problematic release.


This version of isar might be problematic. Click here for more details.

isar/config/settings.py CHANGED
@@ -66,10 +66,10 @@ class Settings(BaseSettings):
66
66
  UPLOAD_FAILURE_MAX_WAIT: int = Field(default=60)
67
67
 
68
68
  # ISAR telemetry intervals
69
- ROBOT_STATUS_PUBLISH_INTERVAL: int = Field(default=1)
70
- ROBOT_HEARTBEAT_PUBLISH_INTERVAL: int = Field(default=1)
71
- ROBOT_INFO_PUBLISH_INTERVAL: int = Field(default=5)
72
- ROBOT_API_STATUS_POLL_INTERVAL: int = Field(default=5)
69
+ ROBOT_STATUS_PUBLISH_INTERVAL: float = Field(default=1)
70
+ ROBOT_HEARTBEAT_PUBLISH_INTERVAL: float = Field(default=1)
71
+ ROBOT_INFO_PUBLISH_INTERVAL: float = Field(default=5)
72
+ ROBOT_API_STATUS_POLL_INTERVAL: float = Field(default=5)
73
73
 
74
74
  # FastAPI host
75
75
  API_HOST_VIEWED_EXTERNALLY: str = Field(default="0.0.0.0")
@@ -1,5 +1,6 @@
1
1
  import logging
2
2
  from pathlib import Path
3
+ from typing import Union
3
4
 
4
5
  from azure.core.exceptions import ResourceExistsError
5
6
  from azure.storage.blob import BlobClient, BlobServiceClient, ContainerClient
@@ -7,10 +8,10 @@ from injector import inject
7
8
 
8
9
  from isar.config.keyvault.keyvault_service import Keyvault
9
10
  from isar.config.settings import settings
10
- from robot_interface.models.mission.mission import Mission
11
11
  from isar.storage.storage_interface import StorageException, StorageInterface
12
12
  from isar.storage.utilities import construct_metadata_file, construct_paths
13
13
  from robot_interface.models.inspection.inspection import Inspection
14
+ from robot_interface.models.mission.mission import Mission
14
15
 
15
16
 
16
17
  class BlobStorage(StorageInterface):
@@ -31,7 +32,7 @@ class BlobStorage(StorageInterface):
31
32
 
32
33
  self.logger = logging.getLogger("uploader")
33
34
 
34
- def store(self, inspection: Inspection, mission: Mission) -> str:
35
+ def store(self, inspection: Inspection, mission: Mission) -> Union[str, dict]:
35
36
  data_path, metadata_path = construct_paths(
36
37
  inspection=inspection, mission=mission
37
38
  )
@@ -43,7 +44,7 @@ class BlobStorage(StorageInterface):
43
44
  self._upload_file(path=metadata_path, data=metadata_bytes)
44
45
  return self._upload_file(path=data_path, data=inspection.data)
45
46
 
46
- def _upload_file(self, path: Path, data: bytes) -> str:
47
+ def _upload_file(self, path: Path, data: bytes) -> Union[str, dict]:
47
48
  blob_client = self._get_blob_client(path)
48
49
  try:
49
50
  blob_properties = blob_client.upload_blob(data=data)
@@ -55,7 +56,14 @@ class BlobStorage(StorageInterface):
55
56
  except Exception as e:
56
57
  self.logger.error("An unexpected error occurred while uploading blob")
57
58
  raise StorageException from e
58
- return blob_properties["etag"]
59
+
60
+ absolute_inspection_path = {
61
+ "source": "blob",
62
+ "blob_storage_account_url": settings.BLOB_STORAGE_ACCOUNT_URL,
63
+ "blob_container": settings.BLOB_CONTAINER,
64
+ "blob_name": blob_client.blob_name,
65
+ }
66
+ return absolute_inspection_path
59
67
 
60
68
  def _get_blob_service_client(self) -> BlobServiceClient:
61
69
  try:
@@ -1,12 +1,13 @@
1
1
  from abc import ABCMeta, abstractmethod
2
+ from typing import Union
2
3
 
3
- from robot_interface.models.mission.mission import Mission
4
4
  from robot_interface.models.inspection.inspection import Inspection
5
+ from robot_interface.models.mission.mission import Mission
5
6
 
6
7
 
7
8
  class StorageInterface(metaclass=ABCMeta):
8
9
  @abstractmethod
9
- def store(self, inspection: Inspection, mission: Mission) -> str:
10
+ def store(self, inspection: Inspection, mission: Mission) -> Union[str, dict]:
10
11
  """
11
12
  Parameters
12
13
  ----------
isar/storage/uploader.py CHANGED
@@ -3,7 +3,7 @@ import logging
3
3
  from dataclasses import dataclass
4
4
  from datetime import datetime, timedelta
5
5
  from queue import Empty, Queue
6
- from typing import List
6
+ from typing import List, Union
7
7
 
8
8
  from injector import inject
9
9
 
@@ -100,8 +100,8 @@ class Uploader:
100
100
  except Empty:
101
101
  continue
102
102
 
103
- def _upload(self, upload_item: UploaderQueueItem) -> str:
104
- inspection_path = ""
103
+ def _upload(self, upload_item: UploaderQueueItem) -> Union[str, dict]:
104
+ inspection_path: Union[str, dict] = ""
105
105
  try:
106
106
  inspection_path = upload_item.storage_handler.store(
107
107
  inspection=upload_item.inspection, mission=upload_item.mission
@@ -140,7 +140,7 @@ class Uploader:
140
140
  )
141
141
 
142
142
  def _publish_inspection_result(
143
- self, inspection: Inspection, inspection_path: str
143
+ self, inspection: Inspection, inspection_path: Union[str, dict]
144
144
  ) -> None:
145
145
  """Publishes the reference of the inspection result to the MQTT Broker
146
146
  along with the analysis type
isar/storage/utilities.py CHANGED
@@ -79,4 +79,5 @@ def get_filename(
79
79
 
80
80
 
81
81
  def get_foldername(mission: Mission) -> str:
82
- return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission.name}__{mission.id}"
82
+ mission_name: str = mission.name.replace(" ", "-")
83
+ return f"{datetime.utcnow().date()}__{settings.PLANT_SHORT_NAME}__{mission_name}__{mission.id}"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isar
3
- Version: 1.16.15
3
+ Version: 1.16.17
4
4
  Summary: Integration and Supervisory control of Autonomous Robots
5
5
  Home-page: https://github.com/equinor/isar
6
6
  Author: Equinor ASA
@@ -14,7 +14,7 @@ isar/config/configuration_error.py,sha256=rO6WOhafX6xvVib8WxV-eY483Z0PpN-9PxGsq5
14
14
  isar/config/log.py,sha256=39G_Cue0qvw0Uv-1NYXvQ83yivPIKcAv-bGNNREFw5o,2251
15
15
  isar/config/logging.conf,sha256=mYO1xf27gAopEMHhGzY7-mwyfN16rwRLkPNMvy3zn2g,1127
16
16
  isar/config/settings.env,sha256=-RCBJiVRWBLky7FKuQX1qYXy8rCzTNLM4LDuyp12EbY,535
17
- isar/config/settings.py,sha256=bWIhbs0xVSyQgNss7fbPXq1gXVN5QP2sXRF_C0hJd_4,13048
17
+ isar/config/settings.py,sha256=ZECul4dywwZb-hJeWi-4XfjrUjthqMs42bNfsyI7feA,13056
18
18
  isar/config/certs/ca-cert.pem,sha256=gSBTyY0tKSFnssyvrvbFvHpQwii0kEkBryklVmevdtc,2029
19
19
  isar/config/keyvault/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
20
20
  isar/config/keyvault/keyvault_error.py,sha256=zvPCsZLjboxsxthYkxpRERCTFxYV8R5WmACewAUQLwk,41
@@ -78,12 +78,12 @@ isar/state_machine/states/off.py,sha256=jjqN_oJMpBtWuY7hP-c9f0w3p2CYCfe-NpmYHHPn
78
78
  isar/state_machine/states/paused.py,sha256=xVZM9WMt90FTiP5forSlA3eJ5Vt9LzZYCFDQDPIocKA,1004
79
79
  isar/state_machine/states/stop.py,sha256=Sxdo4FGhxc2Pj91jidYtVIjpSNklbEf1sJYJ6x51HgE,3348
80
80
  isar/storage/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
81
- isar/storage/blob_storage.py,sha256=8i23s_4d3_REKYxH1DzXF_Lc04pofOlrtDYML_t7BDc,2922
81
+ isar/storage/blob_storage.py,sha256=oKdml1VVN8iTr-d_5H4Lz5E7zrhJRknCzOxHD-tO7m8,3230
82
82
  isar/storage/local_storage.py,sha256=fLzVuwvdEk9l8z7od1qX2p5MeWzcsx-vN4yWvelZeFM,1836
83
83
  isar/storage/slimm_storage.py,sha256=Hp7ZIgZgIR4KAFjzxDKfgMZjPZwP2kmdc1gG8zVcsMk,8966
84
- isar/storage/storage_interface.py,sha256=v7QiYGz79dqw9jbgNoLYD1QOvXFoMrqfVT1TJX7rCsw,790
85
- isar/storage/uploader.py,sha256=QyviG27Km6a2hBXE8Ka_qX2GInCjs3u84RiUloG3DJ0,6294
86
- isar/storage/utilities.py,sha256=dqh60eJ00rKNNmNLBkV-oNcNToxXLS7oAJpisJZZ90c,3053
84
+ isar/storage/storage_interface.py,sha256=DYDry4I7aZpDHJhsBF6s8zrgokFAc7fdKJKfA8AvL7o,828
85
+ isar/storage/uploader.py,sha256=Jpjml4fwPOeApHWfYWEO4gCfIxJKotujUTz2-5TTCt0,6345
86
+ isar/storage/utilities.py,sha256=xnJHT_lu985k0Jlq7_Seu_nWVlocOCVAR8yz2zLkv5Q,3108
87
87
  robot_interface/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  robot_interface/robot_interface.py,sha256=i2qw1V9mLO-ljtS7LiRliQ7XNmmBJIwD4NG8mDfwMEI,8317
89
89
  robot_interface/test_robot_interface.py,sha256=FV1urn7SbsMyWBIcTKjsBwAG4IsXeZ6pLHE0mA9EGGs,692
@@ -107,8 +107,8 @@ robot_interface/telemetry/payloads.py,sha256=9EshERifjD1u8CwjSiV3NGuj0KuXnwblQNB
107
107
  robot_interface/utilities/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
108
108
  robot_interface/utilities/json_service.py,sha256=nU2Q_3P9Fq9hs6F_wtUjWtHfl_g1Siy-yDhXXSKwHwg,1018
109
109
  robot_interface/utilities/uuid_string_factory.py,sha256=_NQIbBQ56w0qqO0MUDP6aPpHbxW7ATRhK8HnQiBSLkc,76
110
- isar-1.16.15.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
111
- isar-1.16.15.dist-info/METADATA,sha256=NkH84d_GU99_mj4ZZFrt24twEXCXKmlCsDuvLd3umPU,14752
112
- isar-1.16.15.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
113
- isar-1.16.15.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
114
- isar-1.16.15.dist-info/RECORD,,
110
+ isar-1.16.17.dist-info/LICENSE,sha256=3fc2-ebLwHWwzfQbulGNRdcNob3SBQeCfEVUDYxsuqw,14058
111
+ isar-1.16.17.dist-info/METADATA,sha256=50txXV96ijDaWa6NcBmtj4tsfH3WohQJfoUPuv0F9PQ,14752
112
+ isar-1.16.17.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
113
+ isar-1.16.17.dist-info/top_level.txt,sha256=UwIML2RtuQKCyJJkatcSnyp6-ldDjboB9k9JgKipO-U,21
114
+ isar-1.16.17.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: bdist_wheel (0.42.0)
2
+ Generator: bdist_wheel (0.43.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5