dkist-processing-common 11.8.1rc3__py3-none-any.whl → 11.9.0__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.
- dkist_processing_common/config.py +28 -6
- dkist_processing_common/tasks/mixin/globus.py +23 -26
- {dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/METADATA +14 -10
- {dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/RECORD +6 -8
- changelog/271.misc.2.rst +0 -1
- changelog/271.misc.rst +0 -1
- {dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/WHEEL +0 -0
- {dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/top_level.txt +0 -0
|
@@ -3,12 +3,20 @@
|
|
|
3
3
|
from dkist_processing_core.config import DKISTProcessingCoreConfiguration
|
|
4
4
|
from dkist_service_configuration.settings import DEFAULT_MESH_SERVICE
|
|
5
5
|
from dkist_service_configuration.settings import MeshService
|
|
6
|
+
from pydantic import BaseModel
|
|
6
7
|
from pydantic import Field
|
|
7
8
|
from talus import ConnectionRetryerFactory
|
|
8
9
|
from talus import ConsumerConnectionParameterFactory
|
|
9
10
|
from talus import ProducerConnectionParameterFactory
|
|
10
11
|
|
|
11
12
|
|
|
13
|
+
class GlobusClientCredential(BaseModel):
|
|
14
|
+
"""Globus client credential."""
|
|
15
|
+
|
|
16
|
+
client_id: str = Field(..., description="Globus client ID for transfers.")
|
|
17
|
+
client_secret: str = Field(..., description="Globus client secret for transfers.")
|
|
18
|
+
|
|
19
|
+
|
|
12
20
|
class DKISTProcessingCommonConfiguration(DKISTProcessingCoreConfiguration):
|
|
13
21
|
"""Common configurations."""
|
|
14
22
|
|
|
@@ -40,14 +48,28 @@ class DKISTProcessingCommonConfiguration(DKISTProcessingCoreConfiguration):
|
|
|
40
48
|
default=None, description="S3 download configuration for the object store."
|
|
41
49
|
)
|
|
42
50
|
# globus
|
|
43
|
-
|
|
44
|
-
|
|
51
|
+
globus_max_retries: int = Field(
|
|
52
|
+
default=5, description="Max retries for transient errors on calls to the globus api."
|
|
45
53
|
)
|
|
46
|
-
|
|
47
|
-
|
|
54
|
+
globus_inbound_client_credentials: list[GlobusClientCredential] = Field(
|
|
55
|
+
default_factory=list,
|
|
56
|
+
description="Globus client credentials for inbound transfers.",
|
|
57
|
+
examples=[
|
|
58
|
+
[
|
|
59
|
+
{"client_id": "id1", "client_secret": "secret1"},
|
|
60
|
+
{"client_id": "id2", "client_secret": "secret2"},
|
|
61
|
+
],
|
|
62
|
+
],
|
|
48
63
|
)
|
|
49
|
-
|
|
50
|
-
|
|
64
|
+
globus_outbound_client_credentials: list[GlobusClientCredential] = Field(
|
|
65
|
+
default_factory=list,
|
|
66
|
+
description="Globus client credentials for outbound transfers.",
|
|
67
|
+
examples=[
|
|
68
|
+
[
|
|
69
|
+
{"client_id": "id3", "client_secret": "secret3"},
|
|
70
|
+
{"client_id": "id4", "client_secret": "secret4"},
|
|
71
|
+
],
|
|
72
|
+
],
|
|
51
73
|
)
|
|
52
74
|
object_store_endpoint: str | None = Field(
|
|
53
75
|
default=None, description="Object store Globus Endpoint ID."
|
|
@@ -9,6 +9,8 @@ from globus_sdk import ConfidentialAppAuthClient
|
|
|
9
9
|
from globus_sdk import GlobusError
|
|
10
10
|
from globus_sdk import TransferClient
|
|
11
11
|
from globus_sdk import TransferData
|
|
12
|
+
from globus_sdk.scopes import TransferScopes
|
|
13
|
+
from globus_sdk.transport import RetryConfig
|
|
12
14
|
|
|
13
15
|
from dkist_processing_common.config import common_configurations
|
|
14
16
|
|
|
@@ -31,27 +33,32 @@ class GlobusTransferItem:
|
|
|
31
33
|
class GlobusMixin:
|
|
32
34
|
"""Mixin to add methods to a Task to support globus transfers."""
|
|
33
35
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
36
|
+
def globus_transfer_client_factory(self, transfer_data: TransferData) -> TransferClient:
|
|
37
|
+
"""Create a globus transfer client based on the direction of transfer and round-robin the available application credentials."""
|
|
38
|
+
if (
|
|
39
|
+
transfer_data["source_endpoint"] == common_configurations.object_store_endpoint
|
|
40
|
+
): # inbound
|
|
41
|
+
client_credentials = common_configurations.globus_inbound_client_credentials
|
|
42
|
+
else: # outbound
|
|
43
|
+
client_credentials = common_configurations.globus_outbound_client_credentials
|
|
44
|
+
|
|
45
|
+
# Round-robin the client credentials based on the recipe run id
|
|
46
|
+
index = self.recipe_run_id % len(client_credentials)
|
|
47
|
+
selected_credential = client_credentials[index]
|
|
48
|
+
|
|
39
49
|
confidential_client = ConfidentialAppAuthClient(
|
|
40
|
-
client_id=
|
|
41
|
-
client_secret=
|
|
42
|
-
transport_params=common_configurations.globus_transport_params,
|
|
50
|
+
client_id=selected_credential.client_id,
|
|
51
|
+
client_secret=selected_credential.client_secret,
|
|
43
52
|
)
|
|
44
|
-
authorizer = ClientCredentialsAuthorizer(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
return self._globus_transfer_client
|
|
53
|
+
authorizer = ClientCredentialsAuthorizer(confidential_client, scopes=TransferScopes)
|
|
54
|
+
retry_config = RetryConfig(max_retries=common_configurations.globus_max_retries)
|
|
55
|
+
|
|
56
|
+
return TransferClient(authorizer=authorizer, retry_config=retry_config)
|
|
49
57
|
|
|
50
58
|
def globus_transfer_scratch_to_object_store(
|
|
51
59
|
self,
|
|
52
60
|
transfer_items: list[GlobusTransferItem],
|
|
53
61
|
label: str = None,
|
|
54
|
-
sync_level: str = None,
|
|
55
62
|
verify_checksum: bool = True,
|
|
56
63
|
) -> None:
|
|
57
64
|
"""Transfer data from scratch to the object store."""
|
|
@@ -60,7 +67,6 @@ class GlobusMixin:
|
|
|
60
67
|
destination_endpoint=common_configurations.object_store_endpoint,
|
|
61
68
|
transfer_items=transfer_items,
|
|
62
69
|
label=label,
|
|
63
|
-
sync_level=sync_level,
|
|
64
70
|
verify_checksum=verify_checksum,
|
|
65
71
|
)
|
|
66
72
|
|
|
@@ -68,7 +74,6 @@ class GlobusMixin:
|
|
|
68
74
|
self,
|
|
69
75
|
transfer_items: list[GlobusTransferItem],
|
|
70
76
|
label: str = None,
|
|
71
|
-
sync_level: str = None,
|
|
72
77
|
verify_checksum: bool = True,
|
|
73
78
|
) -> None:
|
|
74
79
|
"""Transfer data from the object store to scratch."""
|
|
@@ -77,7 +82,6 @@ class GlobusMixin:
|
|
|
77
82
|
destination_endpoint=common_configurations.scratch_endpoint,
|
|
78
83
|
transfer_items=transfer_items,
|
|
79
84
|
label=label,
|
|
80
|
-
sync_level=sync_level,
|
|
81
85
|
verify_checksum=verify_checksum,
|
|
82
86
|
)
|
|
83
87
|
|
|
@@ -87,7 +91,6 @@ class GlobusMixin:
|
|
|
87
91
|
destination_endpoint: str,
|
|
88
92
|
transfer_items: list[GlobusTransferItem],
|
|
89
93
|
label: str = None,
|
|
90
|
-
sync_level: str = None,
|
|
91
94
|
verify_checksum: bool = True,
|
|
92
95
|
) -> TransferData:
|
|
93
96
|
"""Format a globus TransferData instance."""
|
|
@@ -95,7 +98,6 @@ class GlobusMixin:
|
|
|
95
98
|
source_endpoint=source_endpoint,
|
|
96
99
|
destination_endpoint=destination_endpoint,
|
|
97
100
|
label=label,
|
|
98
|
-
sync_level=sync_level,
|
|
99
101
|
verify_checksum=verify_checksum,
|
|
100
102
|
)
|
|
101
103
|
for item in transfer_items:
|
|
@@ -112,7 +114,6 @@ class GlobusMixin:
|
|
|
112
114
|
destination_endpoint: str,
|
|
113
115
|
transfer_items: list[GlobusTransferItem],
|
|
114
116
|
label: str = None,
|
|
115
|
-
sync_level: str = None,
|
|
116
117
|
verify_checksum: bool = True,
|
|
117
118
|
) -> None:
|
|
118
119
|
"""Perform a transfer of data using globus."""
|
|
@@ -121,7 +122,6 @@ class GlobusMixin:
|
|
|
121
122
|
destination_endpoint=destination_endpoint,
|
|
122
123
|
transfer_items=transfer_items,
|
|
123
124
|
label=label,
|
|
124
|
-
sync_level=sync_level,
|
|
125
125
|
verify_checksum=verify_checksum,
|
|
126
126
|
)
|
|
127
127
|
self._blocking_globus_transfer(transfer_data=transfer_data)
|
|
@@ -131,24 +131,21 @@ class GlobusMixin:
|
|
|
131
131
|
source_endpoint: str,
|
|
132
132
|
destination_endpoint: str,
|
|
133
133
|
label: str = None,
|
|
134
|
-
sync_level: str = None,
|
|
135
134
|
verify_checksum: bool = True,
|
|
136
135
|
) -> TransferData:
|
|
137
136
|
label = label or "Data Processing Transfer"
|
|
138
137
|
return TransferData(
|
|
139
|
-
transfer_client=self.globus_transfer_client,
|
|
140
138
|
source_endpoint=source_endpoint,
|
|
141
139
|
destination_endpoint=destination_endpoint,
|
|
142
140
|
label=label,
|
|
143
|
-
sync_level=sync_level,
|
|
144
141
|
verify_checksum=verify_checksum,
|
|
145
142
|
)
|
|
146
143
|
|
|
147
144
|
def _blocking_globus_transfer(self, transfer_data: TransferData) -> None:
|
|
148
|
-
tc = self.
|
|
149
|
-
logger.info(f"Starting globus transfer: label={transfer_data.get('label')}")
|
|
145
|
+
tc = self.globus_transfer_client_factory(transfer_data=transfer_data)
|
|
150
146
|
transfer_result = tc.submit_transfer(transfer_data)
|
|
151
147
|
task_id = transfer_result["task_id"]
|
|
148
|
+
logger.info(f"Starting globus transfer: label={transfer_data.get('label')}, {task_id=}, ")
|
|
152
149
|
polling_interval = 60
|
|
153
150
|
while not tc.task_wait(
|
|
154
151
|
task_id=task_id, timeout=polling_interval, polling_interval=polling_interval
|
{dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dkist-processing-common
|
|
3
|
-
Version: 11.
|
|
3
|
+
Version: 11.9.0
|
|
4
4
|
Summary: Common task classes used by the DKIST science data processing pipelines
|
|
5
5
|
Author-email: NSO / AURA <dkistdc@nso.edu>
|
|
6
6
|
License: BSD-3-Clause
|
|
@@ -17,12 +17,12 @@ Requires-Dist: asdf<4.0.0,>=3.5.0
|
|
|
17
17
|
Requires-Dist: astropy>=7.0.0
|
|
18
18
|
Requires-Dist: dkist-fits-specifications<5.0,>=4.0.0
|
|
19
19
|
Requires-Dist: dkist-header-validator<6.0,>=5.0.0
|
|
20
|
-
Requires-Dist: dkist-processing-core==6.0.
|
|
20
|
+
Requires-Dist: dkist-processing-core==6.0.1
|
|
21
21
|
Requires-Dist: dkist-processing-pac<4.0,>=3.1
|
|
22
22
|
Requires-Dist: dkist-service-configuration<5.0,>=4.1.7
|
|
23
23
|
Requires-Dist: dkist-spectral-lines<4.0,>=3.0.0
|
|
24
|
-
Requires-Dist: solar-wavelength-calibration<3.0,>=2.0.
|
|
25
|
-
Requires-Dist: globus-sdk<
|
|
24
|
+
Requires-Dist: solar-wavelength-calibration<3.0,>=2.0.0
|
|
25
|
+
Requires-Dist: globus-sdk<5.0.0,>=4.0.0
|
|
26
26
|
Requires-Dist: gqlclient[pydantic]==1.2.3
|
|
27
27
|
Requires-Dist: sqids==0.5.1
|
|
28
28
|
Requires-Dist: matplotlib>=3.4
|
|
@@ -118,6 +118,10 @@ Environment Variables
|
|
|
118
118
|
- annotation=str required=False default='unknown-service-version' alias_priority=2 validation_alias='DKIST_SERVICE_VERSION' description='Service version for OpenTelemetry'
|
|
119
119
|
* - NOMAD_ALLOC_ID
|
|
120
120
|
- annotation=str required=False default='unknown-allocation-id' alias_priority=2 validation_alias='NOMAD_ALLOC_ID' description='Nomad allocation ID for OpenTelemetry'
|
|
121
|
+
* - NOMAD_ALLOC_NAME
|
|
122
|
+
- annotation=str required=False default='unknown-allocation-name' alias='NOMAD_ALLOC_NAME' alias_priority=2 description='Allocation name for the deployed container the task is running on.'
|
|
123
|
+
* - NOMAD_GROUP_NAME
|
|
124
|
+
- annotation=str required=False default='unknown-allocation-group' alias='NOMAD_GROUP_NAME' alias_priority=2 description='Allocation group for the deployed container the task is running on'
|
|
121
125
|
* - OTEL_EXPORTER_OTLP_TRACES_INSECURE
|
|
122
126
|
- annotation=bool required=False default=True description='Use insecure connection for OTLP traces'
|
|
123
127
|
* - OTEL_EXPORTER_OTLP_METRICS_INSECURE
|
|
@@ -158,12 +162,12 @@ Environment Variables
|
|
|
158
162
|
- annotation=Union[dict, NoneType] required=False default=None description='S3 upload configuration for the object store.'
|
|
159
163
|
* - S3_DOWNLOAD_CONFIG
|
|
160
164
|
- annotation=Union[dict, NoneType] required=False default=None description='S3 download configuration for the object store.'
|
|
161
|
-
* -
|
|
162
|
-
- annotation=
|
|
163
|
-
* -
|
|
164
|
-
- annotation=
|
|
165
|
-
* -
|
|
166
|
-
- annotation=
|
|
165
|
+
* - GLOBUS_MAX_RETRIES
|
|
166
|
+
- annotation=int required=False default=5 description='Max retries for transient errors on calls to the globus api.'
|
|
167
|
+
* - GLOBUS_INBOUND_CLIENT_CREDENTIALS
|
|
168
|
+
- annotation=list[GlobusClientCredential] required=False default_factory=list description='Globus client credentials for inbound transfers.' examples=[[{'client_id': 'id1', 'client_secret': 'secret1'}, {'client_id': 'id2', 'client_secret': 'secret2'}]]
|
|
169
|
+
* - GLOBUS_OUTBOUND_CLIENT_CREDENTIALS
|
|
170
|
+
- annotation=list[GlobusClientCredential] required=False default_factory=list description='Globus client credentials for outbound transfers.' examples=[[{'client_id': 'id3', 'client_secret': 'secret3'}, {'client_id': 'id4', 'client_secret': 'secret4'}]]
|
|
167
171
|
* - OBJECT_STORE_ENDPOINT
|
|
168
172
|
- annotation=Union[str, NoneType] required=False default=None description='Object store Globus Endpoint ID.'
|
|
169
173
|
* - SCRATCH_ENDPOINT
|
{dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/RECORD
RENAMED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
changelog/.gitempty,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
changelog/271.misc.2.rst,sha256=-nI7LQ8B_O6ZxNa0iBnfSbjIpo9uCvCMiGmKnwTigrA,99
|
|
3
|
-
changelog/271.misc.rst,sha256=YxeCttyTuraW8dlIRP99Pf9XHQrjQMPdSO9bm8r2Kk0,104
|
|
4
2
|
dkist_processing_common/__init__.py,sha256=GQ9EBnYhkOnt-qODclAoLS_g5YVhurxfg1tjVtI9rDI,320
|
|
5
|
-
dkist_processing_common/config.py,sha256=
|
|
3
|
+
dkist_processing_common/config.py,sha256=f511KVpK24sQO4dDr4L6PMj5dz0jmWgnx2Y-3DpV0cw,5991
|
|
6
4
|
dkist_processing_common/manual.py,sha256=bIVVyLsbXMh-g_2L3kGROL-1TtJe0_XviHsp7Br31x8,7023
|
|
7
5
|
dkist_processing_common/_util/__init__.py,sha256=xf6JNpMKQgbhE2Jivymt-WO0WF6PpGt9rl604YpuTWk,92
|
|
8
6
|
dkist_processing_common/_util/constants.py,sha256=0_bWLsvusHD8GrTx4B6V7AieKAaFbN9crcAALaS8x5Q,3245
|
|
@@ -70,7 +68,7 @@ dkist_processing_common/tasks/trial_catalog.py,sha256=43XN4Hz4uNBGEps3O5RLfFHRfy
|
|
|
70
68
|
dkist_processing_common/tasks/trial_output_data.py,sha256=CPMXXODvN5RTcu9bTF8v6AXciCl212EWP6qTiARvUNk,6837
|
|
71
69
|
dkist_processing_common/tasks/write_l1.py,sha256=Xy834RTp3F95kLcW4ba5gfHMUocfZd82ZQQKnvQcP2M,23204
|
|
72
70
|
dkist_processing_common/tasks/mixin/__init__.py,sha256=-g-DQbU7m1bclJYuFe3Yh757V-35GIDTbstardKQ7nU,68
|
|
73
|
-
dkist_processing_common/tasks/mixin/globus.py,sha256=
|
|
71
|
+
dkist_processing_common/tasks/mixin/globus.py,sha256=ugejtZ_MR5LesQYuXM1uICd_yWDE7cZZr0qnWCh75R8,6732
|
|
74
72
|
dkist_processing_common/tasks/mixin/interservice_bus.py,sha256=M6R922l7gJSmmU_vswUXxy-c5DWNrIRjQu9H9CSgGfU,1081
|
|
75
73
|
dkist_processing_common/tasks/mixin/metadata_store.py,sha256=QeZV3BITUzCErUt7mbkJME5SQWi3UPp_tw3zJ2PWy-M,11715
|
|
76
74
|
dkist_processing_common/tasks/mixin/object_store.py,sha256=zGAyRR1O6EN52p7sFQtDWxa7ASx3HJSsO4d4tJr-beE,3237
|
|
@@ -121,7 +119,7 @@ docs/landing_page.rst,sha256=aPAuXFhBx73lEZ59B6E6JXxkK0LlxzD0n-HXqHrfumQ,746
|
|
|
121
119
|
docs/make.bat,sha256=mBAhtURwhQ7yc95pqwJzlhqBSvRknr1aqZ5s8NKvdKs,4513
|
|
122
120
|
docs/requirements.txt,sha256=Kbl_X4c7RQZw035YTeNB63We6I7pvXFU4T0Uflp2yDY,29
|
|
123
121
|
licenses/LICENSE.rst,sha256=piZaQplkzOMmH1NXg6QIdo9wwo9pPCoHkvm2-DmH76E,1462
|
|
124
|
-
dkist_processing_common-11.
|
|
125
|
-
dkist_processing_common-11.
|
|
126
|
-
dkist_processing_common-11.
|
|
127
|
-
dkist_processing_common-11.
|
|
122
|
+
dkist_processing_common-11.9.0.dist-info/METADATA,sha256=iiRthKyMvWyUG_Qagy9VgcOG1x1GXb8ZfjXomjUYyrk,14062
|
|
123
|
+
dkist_processing_common-11.9.0.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
124
|
+
dkist_processing_common-11.9.0.dist-info/top_level.txt,sha256=LJhd1W-Vn90K8HnQDIE4r52YDpUjjMWDnllAWHBByW0,48
|
|
125
|
+
dkist_processing_common-11.9.0.dist-info/RECORD,,
|
changelog/271.misc.2.rst
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Bump minimum version of `pydantic` to 2.7.2 to avoid install failures for python versions >= 3.12.
|
changelog/271.misc.rst
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
Move `solar-wavelength-calibration` dep to 2.0.0 and make use of new helper properties in that release.
|
{dkist_processing_common-11.8.1rc3.dist-info → dkist_processing_common-11.9.0.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|