dagster-cloud 1.11.9__py3-none-any.whl → 1.11.10__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.
- dagster_cloud/storage/defs_state/base_storage.py +90 -0
- dagster_cloud/storage/defs_state/storage.py +17 -52
- dagster_cloud/version.py +1 -1
- dagster_cloud/workspace/user_code_launcher/user_code_launcher.py +1 -0
- {dagster_cloud-1.11.9.dist-info → dagster_cloud-1.11.10.dist-info}/METADATA +7 -7
- {dagster_cloud-1.11.9.dist-info → dagster_cloud-1.11.10.dist-info}/RECORD +8 -7
- {dagster_cloud-1.11.9.dist-info → dagster_cloud-1.11.10.dist-info}/WHEEL +0 -0
- {dagster_cloud-1.11.9.dist-info → dagster_cloud-1.11.10.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
from abc import ABC, abstractmethod
|
|
2
|
+
from pathlib import Path
|
|
3
|
+
from typing import Any, Generic, Optional
|
|
4
|
+
|
|
5
|
+
from dagster._core.instance.types import T_DagsterInstance
|
|
6
|
+
from dagster._core.storage.defs_state.base import DefsStateStorage
|
|
7
|
+
from dagster_cloud_cli.core.artifacts import download_artifact, upload_artifact
|
|
8
|
+
from dagster_cloud_cli.core.headers.auth import DagsterCloudInstanceScope
|
|
9
|
+
from dagster_shared.serdes import deserialize_value
|
|
10
|
+
from dagster_shared.serdes.objects.models.defs_state_info import DefsStateInfo
|
|
11
|
+
|
|
12
|
+
GET_LATEST_DEFS_STATE_INFO_QUERY = """
|
|
13
|
+
query getLatestDefsStateInfo {
|
|
14
|
+
latestDefsStateInfo
|
|
15
|
+
}
|
|
16
|
+
"""
|
|
17
|
+
|
|
18
|
+
SET_LATEST_VERSION_MUTATION = """
|
|
19
|
+
mutation setLatestDefsStateVersion($key: String!, $version: String!) {
|
|
20
|
+
defsState {
|
|
21
|
+
setLatestDefsStateVersion(key: $key, version: $version) {
|
|
22
|
+
ok
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
"""
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
class BaseGraphQLDefsStateStorage(
|
|
30
|
+
DefsStateStorage[T_DagsterInstance], ABC, Generic[T_DagsterInstance]
|
|
31
|
+
):
|
|
32
|
+
"""Base implementation of a DefsStateStorage that uses a GraphQL client to
|
|
33
|
+
interact with the Dagster+ API.
|
|
34
|
+
"""
|
|
35
|
+
|
|
36
|
+
@property
|
|
37
|
+
@abstractmethod
|
|
38
|
+
def url(self) -> str: ...
|
|
39
|
+
|
|
40
|
+
@property
|
|
41
|
+
@abstractmethod
|
|
42
|
+
def api_token(self) -> str: ...
|
|
43
|
+
|
|
44
|
+
@property
|
|
45
|
+
@abstractmethod
|
|
46
|
+
def deployment(self) -> str: ...
|
|
47
|
+
|
|
48
|
+
@property
|
|
49
|
+
@abstractmethod
|
|
50
|
+
def graphql_client(self) -> Any: ...
|
|
51
|
+
|
|
52
|
+
def _execute_query(self, query, variables=None, idempotent_mutation=False):
|
|
53
|
+
return self.graphql_client.execute(
|
|
54
|
+
query, variable_values=variables, idempotent_mutation=idempotent_mutation
|
|
55
|
+
)
|
|
56
|
+
|
|
57
|
+
def _get_artifact_key(self, key: str, version: str) -> str:
|
|
58
|
+
return f"__state__/{key}/{version}"
|
|
59
|
+
|
|
60
|
+
def download_state_to_path(self, key: str, version: str, path: Path) -> None:
|
|
61
|
+
download_artifact(
|
|
62
|
+
url=self.url,
|
|
63
|
+
scope=DagsterCloudInstanceScope.DEPLOYMENT,
|
|
64
|
+
api_token=self.api_token,
|
|
65
|
+
key=self._get_artifact_key(key, version),
|
|
66
|
+
path=path,
|
|
67
|
+
deployment=self.deployment,
|
|
68
|
+
)
|
|
69
|
+
|
|
70
|
+
def upload_state_from_path(self, key: str, version: str, path: Path) -> None:
|
|
71
|
+
upload_artifact(
|
|
72
|
+
url=self.url,
|
|
73
|
+
scope=DagsterCloudInstanceScope.DEPLOYMENT,
|
|
74
|
+
api_token=self.api_token,
|
|
75
|
+
key=self._get_artifact_key(key, version),
|
|
76
|
+
path=path,
|
|
77
|
+
deployment=self.deployment,
|
|
78
|
+
)
|
|
79
|
+
self.set_latest_version(key, version)
|
|
80
|
+
|
|
81
|
+
def get_latest_defs_state_info(self) -> Optional[DefsStateInfo]:
|
|
82
|
+
res = self._execute_query(GET_LATEST_DEFS_STATE_INFO_QUERY)
|
|
83
|
+
result = res["data"]["latestDefsStateInfo"]
|
|
84
|
+
if result is not None:
|
|
85
|
+
return deserialize_value(result, DefsStateInfo)
|
|
86
|
+
else:
|
|
87
|
+
return None
|
|
88
|
+
|
|
89
|
+
def set_latest_version(self, key: str, version: str) -> None:
|
|
90
|
+
self._execute_query(SET_LATEST_VERSION_MUTATION, variables={"key": key, "version": version})
|
|
@@ -1,23 +1,18 @@
|
|
|
1
|
-
from pathlib import Path
|
|
2
1
|
from typing import TYPE_CHECKING, Any, Optional
|
|
3
2
|
|
|
4
3
|
import dagster._check as check
|
|
5
|
-
from dagster._core.storage.defs_state.base import DefsStateStorage
|
|
6
4
|
from dagster._serdes import ConfigurableClass, ConfigurableClassData
|
|
7
|
-
from dagster_cloud_cli.core.artifacts import download_artifact, upload_artifact
|
|
8
|
-
from dagster_shared.serdes import deserialize_value
|
|
9
|
-
from dagster_shared.serdes.objects import DefsStateInfo
|
|
10
5
|
from typing_extensions import Self
|
|
11
6
|
|
|
12
|
-
from dagster_cloud.
|
|
13
|
-
|
|
14
|
-
from .queries import GET_LATEST_DEFS_STATE_INFO_QUERY, SET_LATEST_VERSION_MUTATION
|
|
7
|
+
from dagster_cloud.storage.defs_state.base_storage import BaseGraphQLDefsStateStorage
|
|
15
8
|
|
|
16
9
|
if TYPE_CHECKING:
|
|
17
10
|
from dagster_cloud.instance import DagsterCloudAgentInstance # noqa: F401
|
|
18
11
|
|
|
19
12
|
|
|
20
|
-
class GraphQLDefsStateStorage(
|
|
13
|
+
class GraphQLDefsStateStorage(
|
|
14
|
+
BaseGraphQLDefsStateStorage["DagsterCloudAgentInstance"], ConfigurableClass
|
|
15
|
+
):
|
|
21
16
|
def __init__(
|
|
22
17
|
self, inst_data: Optional[ConfigurableClassData] = None, override_graphql_client=None
|
|
23
18
|
):
|
|
@@ -40,51 +35,21 @@ class GraphQLDefsStateStorage(DefsStateStorage["DagsterCloudAgentInstance"], Con
|
|
|
40
35
|
return cls(inst_data=inst_data)
|
|
41
36
|
|
|
42
37
|
@property
|
|
43
|
-
def
|
|
44
|
-
return
|
|
45
|
-
self._override_graphql_client
|
|
46
|
-
if self._override_graphql_client
|
|
47
|
-
else self._instance.graphql_client # pyright: ignore[reportAttributeAccessIssue]
|
|
48
|
-
)
|
|
38
|
+
def url(self) -> str:
|
|
39
|
+
return self._instance.dagster_cloud_url
|
|
49
40
|
|
|
50
41
|
@property
|
|
51
|
-
def
|
|
52
|
-
return
|
|
53
|
-
|
|
54
|
-
def _execute_query(self, query, variables=None, idempotent_mutation=False):
|
|
55
|
-
return self._graphql_client.execute(
|
|
56
|
-
query, variable_values=variables, idempotent_mutation=idempotent_mutation
|
|
57
|
-
)
|
|
58
|
-
|
|
59
|
-
def _get_artifact_key(self, key: str, version: str) -> str:
|
|
60
|
-
return f"__state__/{key}/{version}"
|
|
42
|
+
def api_token(self) -> str:
|
|
43
|
+
return check.not_none(self._instance.dagster_cloud_agent_token)
|
|
61
44
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
scope=DagsterCloudInstanceScope.DEPLOYMENT,
|
|
66
|
-
api_token=check.not_none(self._instance.dagster_cloud_agent_token),
|
|
67
|
-
key=self._get_artifact_key(key, version),
|
|
68
|
-
path=path,
|
|
69
|
-
)
|
|
45
|
+
@property
|
|
46
|
+
def deployment(self) -> str:
|
|
47
|
+
return check.not_none(self._instance.deployment_name)
|
|
70
48
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
path=path,
|
|
49
|
+
@property
|
|
50
|
+
def graphql_client(self):
|
|
51
|
+
return (
|
|
52
|
+
self._override_graphql_client
|
|
53
|
+
if self._override_graphql_client
|
|
54
|
+
else self._instance.graphql_client # pyright: ignore[reportAttributeAccessIssue]
|
|
78
55
|
)
|
|
79
|
-
self.set_latest_version(key, version)
|
|
80
|
-
|
|
81
|
-
def get_latest_defs_state_info(self) -> Optional[DefsStateInfo]:
|
|
82
|
-
res = self._execute_query(GET_LATEST_DEFS_STATE_INFO_QUERY)
|
|
83
|
-
result = res["data"]["latestDefsStateInfo"]
|
|
84
|
-
if result is not None:
|
|
85
|
-
return deserialize_value(result, DefsStateInfo)
|
|
86
|
-
else:
|
|
87
|
-
return None
|
|
88
|
-
|
|
89
|
-
def set_latest_version(self, key: str, version: str) -> None:
|
|
90
|
-
self._execute_query(SET_LATEST_VERSION_MUTATION, variables={"key": key, "version": version})
|
dagster_cloud/version.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "1.11.
|
|
1
|
+
__version__ = "1.11.10"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: dagster-cloud
|
|
3
|
-
Version: 1.11.
|
|
3
|
+
Version: 1.11.10
|
|
4
4
|
Author-email: Elementl <support@elementl.com>
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Project-URL: Homepage, https://dagster.io/cloud
|
|
@@ -28,9 +28,9 @@ Classifier: Topic :: Software Development :: Libraries :: Application Frameworks
|
|
|
28
28
|
Classifier: Operating System :: OS Independent
|
|
29
29
|
Requires-Python: <3.14,>=3.9
|
|
30
30
|
Description-Content-Type: text/markdown
|
|
31
|
-
Requires-Dist: dagster==1.11.
|
|
32
|
-
Requires-Dist: dagster-shared==1.11.
|
|
33
|
-
Requires-Dist: dagster-cloud-cli==1.11.
|
|
31
|
+
Requires-Dist: dagster==1.11.10
|
|
32
|
+
Requires-Dist: dagster-shared==1.11.10
|
|
33
|
+
Requires-Dist: dagster-cloud-cli==1.11.10
|
|
34
34
|
Requires-Dist: opentelemetry-api<2,>=1.27.0
|
|
35
35
|
Requires-Dist: opentelemetry-sdk<2,>=1.27.0
|
|
36
36
|
Requires-Dist: opentelemetry-exporter-otlp-proto-grpc<2,>=1.27.0
|
|
@@ -65,12 +65,12 @@ Provides-Extra: insights
|
|
|
65
65
|
Requires-Dist: pyarrow; extra == "insights"
|
|
66
66
|
Provides-Extra: docker
|
|
67
67
|
Requires-Dist: docker; extra == "docker"
|
|
68
|
-
Requires-Dist: dagster-docker==0.27.
|
|
68
|
+
Requires-Dist: dagster-docker==0.27.10; extra == "docker"
|
|
69
69
|
Provides-Extra: kubernetes
|
|
70
70
|
Requires-Dist: kubernetes; extra == "kubernetes"
|
|
71
|
-
Requires-Dist: dagster-k8s==0.27.
|
|
71
|
+
Requires-Dist: dagster-k8s==0.27.10; extra == "kubernetes"
|
|
72
72
|
Provides-Extra: ecs
|
|
73
|
-
Requires-Dist: dagster-aws==0.27.
|
|
73
|
+
Requires-Dist: dagster-aws==0.27.10; extra == "ecs"
|
|
74
74
|
Requires-Dist: boto3; extra == "ecs"
|
|
75
75
|
Provides-Extra: sandbox
|
|
76
76
|
Requires-Dist: supervisor; extra == "sandbox"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
dagster_cloud/__init__.py,sha256=q3UY5eTfCSqZrr35mmn1b1B_AD1VbfR4Alj8cZ49Xg4,316
|
|
2
2
|
dagster_cloud/constants.py,sha256=CPAqXJ99SWGMviksdIA2A9894FEvHChNk8UcP4TluYM,455
|
|
3
3
|
dagster_cloud/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
4
|
-
dagster_cloud/version.py,sha256
|
|
4
|
+
dagster_cloud/version.py,sha256=-6noRcK_QpKJbYZJtuiOgAP4ZN45BdUcldnV7ljGK3A,24
|
|
5
5
|
dagster_cloud/agent/__init__.py,sha256=_erVyIrxuHUiyNerwX8vNZcKZN8NAloTEkPq8vPZ3MI,811
|
|
6
6
|
dagster_cloud/agent/dagster_cloud_agent.py,sha256=C72rumzRFFX41L2y7j-pJFrTAnvW60ZiS_AQRTUjExg,57013
|
|
7
7
|
dagster_cloud/agent/queries.py,sha256=iI84GQ1Zxt5ryo6M1ELIaIae-gwUY14QPPMUeiFK97o,1837
|
|
@@ -93,8 +93,9 @@ dagster_cloud/storage/tags.py,sha256=YeWSWgpguqvpndFGMM0W7gORn0F8P3CDcanElE7n2Vo
|
|
|
93
93
|
dagster_cloud/storage/compute_logs/__init__.py,sha256=6O5IqKYrNZ6Yz0cataEa2_8u6kYAIP6PXOoeqh5jvjo,82
|
|
94
94
|
dagster_cloud/storage/compute_logs/compute_log_manager.py,sha256=tGwHou-Qsa25XMwX6ULLE18PTjZiN9Pqx7bRs6Oym3Q,4878
|
|
95
95
|
dagster_cloud/storage/defs_state/__init__.py,sha256=MCt72laA0K6t7dtZfqxlS9I7MYtFzI6lTR2NN40A9e8,72
|
|
96
|
+
dagster_cloud/storage/defs_state/base_storage.py,sha256=_OtLfplIG5yVCZOjCZbdmEfCKm5yrgBdKXt6Wi8DMZ0,2976
|
|
96
97
|
dagster_cloud/storage/defs_state/queries.py,sha256=UICxqqWH1gCpE_YR7TedxanES2gZ_7dR00y6KR8HWQA,365
|
|
97
|
-
dagster_cloud/storage/defs_state/storage.py,sha256=
|
|
98
|
+
dagster_cloud/storage/defs_state/storage.py,sha256=OoikV-ptZtXr-t2izPkvrR-d94UdCV4lw4aXxAWZMkM,1792
|
|
98
99
|
dagster_cloud/storage/event_logs/__init__.py,sha256=N45uxmVOvMtOSYJFktLE32sJ6Ju9EFcwMH4b8L2DDFk,70
|
|
99
100
|
dagster_cloud/storage/event_logs/queries.py,sha256=sgkHhHX-0Vr9WukcRjbuGSH8vjC9razSNnwqXBrihX8,19924
|
|
100
101
|
dagster_cloud/storage/event_logs/storage.py,sha256=bu3GOrPu_RkCr29xic78-rRfI4h_ZTMOVZGWQj8jtSc,56438
|
|
@@ -126,9 +127,9 @@ dagster_cloud/workspace/kubernetes/launcher.py,sha256=fz53VgKZUYihDyA_ffz8W1wNjA
|
|
|
126
127
|
dagster_cloud/workspace/kubernetes/utils.py,sha256=quOuufFp-Og2k-DEyserkrWd6Vj157OvRZJwLuMQYaY,12213
|
|
127
128
|
dagster_cloud/workspace/user_code_launcher/__init__.py,sha256=6ib1U47aqB4R9BbzJVKR8cAy16RVg5VHRxsUoON1_FQ,745
|
|
128
129
|
dagster_cloud/workspace/user_code_launcher/process.py,sha256=VZMfBf4OmXNwP0H0ckUMpqD-glqsBgACXS-xO6Pn6nM,14274
|
|
129
|
-
dagster_cloud/workspace/user_code_launcher/user_code_launcher.py,sha256=
|
|
130
|
+
dagster_cloud/workspace/user_code_launcher/user_code_launcher.py,sha256=DqWeZ_w-h4tP2ceLyvOHWeSPM6dUnr7gY_VmuSKsEYA,102911
|
|
130
131
|
dagster_cloud/workspace/user_code_launcher/utils.py,sha256=t8Epee9MrXtRhWL-b_3avXxgMGrjLScUNWtBUUGpMCg,5285
|
|
131
|
-
dagster_cloud-1.11.
|
|
132
|
-
dagster_cloud-1.11.
|
|
133
|
-
dagster_cloud-1.11.
|
|
134
|
-
dagster_cloud-1.11.
|
|
132
|
+
dagster_cloud-1.11.10.dist-info/METADATA,sha256=B1Akcb1W5inKpaInl8LMl6KhboqpA8i7kKa_9OL4Nr4,6584
|
|
133
|
+
dagster_cloud-1.11.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
134
|
+
dagster_cloud-1.11.10.dist-info/top_level.txt,sha256=2hMt-U33jyCgnywNrDB9Ih0EpaVmiO6dFkYcJ7Iwx4I,14
|
|
135
|
+
dagster_cloud-1.11.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|