ob-metaflow-extensions 1.4.5__py2.py3-none-any.whl → 1.4.7__py2.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 ob-metaflow-extensions might be problematic. Click here for more details.
- metaflow_extensions/outerbounds/plugins/__init__.py +1 -1
- metaflow_extensions/outerbounds/plugins/apps/core/capsule.py +33 -3
- metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py +1 -1
- metaflow_extensions/outerbounds/plugins/optuna/__init__.py +48 -0
- metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py +3 -0
- metaflow_extensions/outerbounds/toplevel/plugins/optuna/__init__.py +1 -0
- {ob_metaflow_extensions-1.4.5.dist-info → ob_metaflow_extensions-1.4.7.dist-info}/METADATA +1 -1
- {ob_metaflow_extensions-1.4.5.dist-info → ob_metaflow_extensions-1.4.7.dist-info}/RECORD +10 -8
- {ob_metaflow_extensions-1.4.5.dist-info → ob_metaflow_extensions-1.4.7.dist-info}/WHEEL +0 -0
- {ob_metaflow_extensions-1.4.5.dist-info → ob_metaflow_extensions-1.4.7.dist-info}/top_level.txt +0 -0
|
@@ -361,4 +361,4 @@ SECRETS_PROVIDERS_DESC = [
|
|
|
361
361
|
("outerbounds", ".secrets.secrets.OuterboundsSecretsProvider"),
|
|
362
362
|
]
|
|
363
363
|
# Adding an override here so the library can be imported at the metaflow.plugins level
|
|
364
|
-
__mf_promote_submodules__ = ["snowflake", "ollama", "torchtune"]
|
|
364
|
+
__mf_promote_submodules__ = ["snowflake", "ollama", "torchtune", "optuna"]
|
|
@@ -446,6 +446,34 @@ class CapsuleApi:
|
|
|
446
446
|
message="Capsule JSON decode failed",
|
|
447
447
|
)
|
|
448
448
|
|
|
449
|
+
def get_by_name(self, name: str, most_recent_only: bool = True):
|
|
450
|
+
_url = os.path.join(self._base_url, f"?displayName={name}")
|
|
451
|
+
response = self._wrapped_api_caller(
|
|
452
|
+
requests.get,
|
|
453
|
+
_url,
|
|
454
|
+
retryable_status_codes=[409], # todo : verify me
|
|
455
|
+
conn_error_retries=3,
|
|
456
|
+
)
|
|
457
|
+
try:
|
|
458
|
+
if most_recent_only:
|
|
459
|
+
result = response.json()
|
|
460
|
+
candidates = result["capsules"]
|
|
461
|
+
if not candidates:
|
|
462
|
+
return None
|
|
463
|
+
return sorted(
|
|
464
|
+
candidates, key=lambda x: x["metadata"]["createdAt"], reverse=True
|
|
465
|
+
)[0]
|
|
466
|
+
else:
|
|
467
|
+
return response.json()
|
|
468
|
+
except json.JSONDecodeError as e:
|
|
469
|
+
raise CapsuleApiException(
|
|
470
|
+
_url,
|
|
471
|
+
"get",
|
|
472
|
+
response.status_code,
|
|
473
|
+
response.text,
|
|
474
|
+
message="Capsule JSON decode failed",
|
|
475
|
+
)
|
|
476
|
+
|
|
449
477
|
def list(self):
|
|
450
478
|
response = self._wrapped_api_caller(
|
|
451
479
|
requests.get,
|
|
@@ -793,9 +821,11 @@ class CapsuleDeployer:
|
|
|
793
821
|
"💊 %s deployment status: %s "
|
|
794
822
|
% (
|
|
795
823
|
self.capsule_type.title(),
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
824
|
+
(
|
|
825
|
+
"in progress"
|
|
826
|
+
if state_machine.update_in_progress
|
|
827
|
+
else "completed"
|
|
828
|
+
),
|
|
799
829
|
)
|
|
800
830
|
)
|
|
801
831
|
_further_readiness_check_failed = False
|
|
@@ -40,7 +40,7 @@ class PerimeterExtractor:
|
|
|
40
40
|
return perimeter, api_server # type: ignore
|
|
41
41
|
|
|
42
42
|
@classmethod
|
|
43
|
-
def during_metaflow_execution(cls) -> str:
|
|
43
|
+
def during_metaflow_execution(cls) -> Union[Tuple[str, str], Tuple[None, None]]:
|
|
44
44
|
from metaflow.metaflow_config_funcs import init_config
|
|
45
45
|
|
|
46
46
|
clean_url = (
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import json
|
|
3
|
+
|
|
4
|
+
__mf_promote_submodules__ = ["plugins.optuna"]
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def auth():
|
|
8
|
+
from metaflow.metaflow_config_funcs import init_config
|
|
9
|
+
|
|
10
|
+
conf = init_config()
|
|
11
|
+
if conf:
|
|
12
|
+
headers = {"x-api-key": conf["METAFLOW_SERVICE_AUTH_KEY"]}
|
|
13
|
+
else:
|
|
14
|
+
headers = json.loads(os.environ["METAFLOW_SERVICE_HEADERS"])
|
|
15
|
+
return headers
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
def get_deployment_db_access_endpoint(name: str):
|
|
19
|
+
from ..apps.core.perimeters import PerimeterExtractor
|
|
20
|
+
from ..apps.core.capsule import CapsuleApi
|
|
21
|
+
|
|
22
|
+
perimeter, cap_url = PerimeterExtractor.during_metaflow_execution()
|
|
23
|
+
deployment = CapsuleApi(cap_url, perimeter).get_by_name(name)
|
|
24
|
+
if not deployment:
|
|
25
|
+
raise Exception(f"No app deployment found with name `{name}`")
|
|
26
|
+
|
|
27
|
+
if (
|
|
28
|
+
"status" in deployment
|
|
29
|
+
and "accessInfo" in deployment["status"]
|
|
30
|
+
and "extraAccessUrls" in deployment["status"]["accessInfo"]
|
|
31
|
+
):
|
|
32
|
+
for extra_url in deployment["status"]["accessInfo"]["extraAccessUrls"]:
|
|
33
|
+
if extra_url["name"] == "in_cluster_db_access":
|
|
34
|
+
db_url = extra_url["url"].replace("http://", "")
|
|
35
|
+
return db_url
|
|
36
|
+
|
|
37
|
+
raise Exception(f"No db access endpoint found for deployment `{name}`")
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
def get_db_url(app_name: str):
|
|
41
|
+
"""
|
|
42
|
+
Example usage:
|
|
43
|
+
>>> from metaflow.plugins.optuna import get_db_url
|
|
44
|
+
>>> s = optuna.create_study(..., storage=get_db_url("optuna-dashboard"))
|
|
45
|
+
"""
|
|
46
|
+
mf_token = auth()["x-api-key"]
|
|
47
|
+
app_url = get_deployment_db_access_endpoint(app_name)
|
|
48
|
+
return f"postgresql://userspace_default:{mf_token}@{app_url}/userspace_default?sslmode=disable"
|
|
@@ -109,3 +109,6 @@ from ..plugins.checkpoint_datastores import nebius_checkpoints, coreweave_checkp
|
|
|
109
109
|
from ..plugins.aws import assume_role
|
|
110
110
|
from . import ob_internal
|
|
111
111
|
from .ob_internal import AppDeployer
|
|
112
|
+
|
|
113
|
+
from obproject import ProjectFlow, ProjectEvent, project_trigger
|
|
114
|
+
from highlight_card import highlight
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__mf_promote_submodules__ = ["plugins.optuna"]
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
metaflow_extensions/outerbounds/__init__.py,sha256=Gb8u06s9ClQsA_vzxmkCzuMnigPy7kKcDnLfb7eB-64,514
|
|
2
2
|
metaflow_extensions/outerbounds/remote_config.py,sha256=NIKiq-hrThOll7RLw2JfSN7K5Wz0QtjtRb5AVlHZ1vA,4787
|
|
3
3
|
metaflow_extensions/outerbounds/config/__init__.py,sha256=JsQGRuGFz28fQWjUvxUgR8EKBLGRdLUIk_buPLJplJY,1225
|
|
4
|
-
metaflow_extensions/outerbounds/plugins/__init__.py,sha256=
|
|
4
|
+
metaflow_extensions/outerbounds/plugins/__init__.py,sha256=nrsobix6XPIn5Uyg6yTSOtNwr6yaV2-gGbU83hjnbIM,14038
|
|
5
5
|
metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=_Q9_2EL0Xy77bCRphkwT1aSu8gQXRDOH-Z-RxTUO8N4,2202
|
|
6
6
|
metaflow_extensions/outerbounds/plugins/perimeters.py,sha256=QXh3SFP7GQbS-RAIxUOPbhPzQ7KDFVxZkTdKqFKgXjI,2697
|
|
7
7
|
metaflow_extensions/outerbounds/plugins/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -16,12 +16,12 @@ metaflow_extensions/outerbounds/plugins/apps/core/_state_machine.py,sha256=al907
|
|
|
16
16
|
metaflow_extensions/outerbounds/plugins/apps/core/app_cli.py,sha256=s1dZb4iyG5OVmieHO-yDcB3Qzx6OsdOowXFWFT-UjhU,42586
|
|
17
17
|
metaflow_extensions/outerbounds/plugins/apps/core/app_config.py,sha256=PHt-HdNfTHIuhY-eB5vkRMp1RKQNWJ4DKdgZWyYgUuc,4167
|
|
18
18
|
metaflow_extensions/outerbounds/plugins/apps/core/artifacts.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
|
-
metaflow_extensions/outerbounds/plugins/apps/core/capsule.py,sha256=
|
|
19
|
+
metaflow_extensions/outerbounds/plugins/apps/core/capsule.py,sha256=KSHznoyWTrDyuOIUyn-iB2IMFt8uwXgoAjOe1TFdZSA,35790
|
|
20
20
|
metaflow_extensions/outerbounds/plugins/apps/core/click_importer.py,sha256=kgoPQmK_-8PSSTc3QMSaynCLQ5VWTkKFOC69FPURyXA,998
|
|
21
21
|
metaflow_extensions/outerbounds/plugins/apps/core/config_schema.yaml,sha256=POxm1S9lZB6tO_g9w9gbvna133H5iGYvpVHe247gISY,9697
|
|
22
22
|
metaflow_extensions/outerbounds/plugins/apps/core/dependencies.py,sha256=JlWT9f27yzZeJPlqTQk134WDfQgOdyxC5iaw3pLlhqY,4006
|
|
23
23
|
metaflow_extensions/outerbounds/plugins/apps/core/deployer.py,sha256=dNKlDu6n8SufEd5NKmsErl1RYhQXuEe_DgtA0mk7awg,9472
|
|
24
|
-
metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py,sha256=
|
|
24
|
+
metaflow_extensions/outerbounds/plugins/apps/core/perimeters.py,sha256=ETlqTkHDvVaWusrbNncFf7pcGJarj0r-5qodC4gZWQM,3068
|
|
25
25
|
metaflow_extensions/outerbounds/plugins/apps/core/secrets.py,sha256=sgDiAmpSC8Y5xjlaOEp79F6m0S3x4RONf_vJ5PUAfu8,6127
|
|
26
26
|
metaflow_extensions/outerbounds/plugins/apps/core/utils.py,sha256=2M2zU8DhbAlJee8P0xKXINAku81PcUylS3sVCSb0TUs,7896
|
|
27
27
|
metaflow_extensions/outerbounds/plugins/apps/core/validations.py,sha256=Inr9AJDe-L3PMMMxcJPH1zulh9_SynqITb2BzGseLh4,471
|
|
@@ -83,6 +83,7 @@ metaflow_extensions/outerbounds/plugins/ollama/constants.py,sha256=hxkTpWEJp1pKH
|
|
|
83
83
|
metaflow_extensions/outerbounds/plugins/ollama/exceptions.py,sha256=8Ss296_MGZl1wXAoDNwpH-hsPe6iYLe90Ji1pczNocU,668
|
|
84
84
|
metaflow_extensions/outerbounds/plugins/ollama/ollama.py,sha256=C-6Hz8OxsJiB14AAxmunq3P4k7DrmVHsSOxE0xsP-nY,79780
|
|
85
85
|
metaflow_extensions/outerbounds/plugins/ollama/status_card.py,sha256=F5e4McDl28lhtjeUyInkl03bqjr1lgLxWoau8Q9xwBE,10994
|
|
86
|
+
metaflow_extensions/outerbounds/plugins/optuna/__init__.py,sha256=iFNDFNtWOfqwXi8bhMoItM8it-bATETbx8PGK66UbHI,1615
|
|
86
87
|
metaflow_extensions/outerbounds/plugins/profilers/deco_injector.py,sha256=oI_C3c64XBm7n88FILqHwn-Nnc5DeT_68I67lM9rXaI,2434
|
|
87
88
|
metaflow_extensions/outerbounds/plugins/profilers/gpu_profile_decorator.py,sha256=gDHQ2sMIp4NuZSzUspbSd8RGdFAoO5mgZAyFcZ2a51Y,2619
|
|
88
89
|
metaflow_extensions/outerbounds/plugins/profilers/simple_card_decorator.py,sha256=4W9tLGCmkFx-4XYLa1xF6qMiaWOBYYFx_RclZDKej30,3259
|
|
@@ -114,17 +115,18 @@ metaflow_extensions/outerbounds/plugins/vllm/vllm_manager.py,sha256=sp_TX2SrImJG
|
|
|
114
115
|
metaflow_extensions/outerbounds/profilers/__init__.py,sha256=wa_jhnCBr82TBxoS0e8b6_6sLyZX0fdHicuGJZNTqKw,29
|
|
115
116
|
metaflow_extensions/outerbounds/profilers/gpu.py,sha256=3Er8uKQzfm_082uadg4yn_D4Y-iSCgzUfFmguYxZsz4,27485
|
|
116
117
|
metaflow_extensions/outerbounds/toplevel/__init__.py,sha256=qWUJSv_r5hXJ7jV_On4nEasKIfUCm6_UjkjXWA_A1Ts,90
|
|
117
|
-
metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,sha256=
|
|
118
|
+
metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,sha256=M5riICGn1Jh2sp1fjEdcgO7equDIZAxwvKk1XgkOTHs,3926
|
|
118
119
|
metaflow_extensions/outerbounds/toplevel/ob_internal.py,sha256=DXCaAtLzlE-bFIiVWEv-iV2JKIWsoSGaUeH4jIQZ9gs,193
|
|
119
120
|
metaflow_extensions/outerbounds/toplevel/s3_proxy.py,sha256=zdqG7Z12cGuoYYCi2P4kqC3WsgL3xfdJGIb7ejecHH4,2862
|
|
120
121
|
metaflow_extensions/outerbounds/toplevel/plugins/azure/__init__.py,sha256=WUuhz2YQfI4fz7nIcipwwWq781eaoHEk7n4GAn1npDg,63
|
|
121
122
|
metaflow_extensions/outerbounds/toplevel/plugins/gcp/__init__.py,sha256=BbZiaH3uILlEZ6ntBLKeNyqn3If8nIXZFq_Apd7Dhco,70
|
|
122
123
|
metaflow_extensions/outerbounds/toplevel/plugins/kubernetes/__init__.py,sha256=5zG8gShSj8m7rgF4xgWBZFuY3GDP5n1T0ktjRpGJLHA,69
|
|
123
124
|
metaflow_extensions/outerbounds/toplevel/plugins/ollama/__init__.py,sha256=GRSz2zwqkvlmFS6bcfYD_CX6CMko9DHQokMaH1iBshA,47
|
|
125
|
+
metaflow_extensions/outerbounds/toplevel/plugins/optuna/__init__.py,sha256=6D1wLVSHvwEC_ed1r3VcvNGqOhKgyBt22AoDjVTkiFY,47
|
|
124
126
|
metaflow_extensions/outerbounds/toplevel/plugins/snowflake/__init__.py,sha256=LptpH-ziXHrednMYUjIaosS1SXD3sOtF_9_eRqd8SJw,50
|
|
125
127
|
metaflow_extensions/outerbounds/toplevel/plugins/torchtune/__init__.py,sha256=uTVkdSk3xZ7hEKYfdlyVteWj5KeDwaM1hU9WT-_YKfI,50
|
|
126
128
|
metaflow_extensions/outerbounds/toplevel/plugins/vllm/__init__.py,sha256=ekcgD3KVydf-a0xMI60P4uy6ePkSEoFHiGnDq1JM940,45
|
|
127
|
-
ob_metaflow_extensions-1.4.
|
|
128
|
-
ob_metaflow_extensions-1.4.
|
|
129
|
-
ob_metaflow_extensions-1.4.
|
|
130
|
-
ob_metaflow_extensions-1.4.
|
|
129
|
+
ob_metaflow_extensions-1.4.7.dist-info/METADATA,sha256=LqM4N4qF7ua1pKIOnPBPdi3HSsOZ9W28S7r0x8psobk,518
|
|
130
|
+
ob_metaflow_extensions-1.4.7.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
|
|
131
|
+
ob_metaflow_extensions-1.4.7.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
|
|
132
|
+
ob_metaflow_extensions-1.4.7.dist-info/RECORD,,
|
|
File without changes
|
{ob_metaflow_extensions-1.4.5.dist-info → ob_metaflow_extensions-1.4.7.dist-info}/top_level.txt
RENAMED
|
File without changes
|