ob-metaflow-extensions 1.1.53__py2.py3-none-any.whl → 1.1.54__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/auth_server.py +26 -8
- {ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/METADATA +1 -2
- {ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/RECORD +5 -5
- {ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/WHEEL +0 -0
- {ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/top_level.txt +0 -0
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
from urllib.parse import urlparse
|
|
2
2
|
|
|
3
3
|
import requests
|
|
4
|
+
import time
|
|
5
|
+
import random
|
|
6
|
+
import os
|
|
7
|
+
import sys
|
|
4
8
|
|
|
5
9
|
|
|
6
10
|
def read_mf_config():
|
|
@@ -35,12 +39,26 @@ def get_token_url_and_headers(url_path):
|
|
|
35
39
|
def get_token(url_path):
|
|
36
40
|
from metaflow.exception import MetaflowException
|
|
37
41
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
42
|
+
retry_delay = 1
|
|
43
|
+
max_retries = os.environ.get("METAFLOW_EXT_HTTP_MAX_RETRIES", "10")
|
|
44
|
+
attempt = 0
|
|
45
|
+
while attempt < int(max_retries):
|
|
46
|
+
attempt = attempt + 1
|
|
47
|
+
try:
|
|
48
|
+
url, headers = get_token_url_and_headers(url_path)
|
|
49
|
+
r = requests.get(url, headers=headers)
|
|
50
|
+
r.raise_for_status()
|
|
51
|
+
token_info = r.json()
|
|
52
|
+
return token_info
|
|
53
|
+
except requests.exceptions.HTTPError as e:
|
|
54
|
+
raise MetaflowException(repr(e))
|
|
55
|
+
except requests.exceptions.ConnectionError as e:
|
|
56
|
+
# ConnectionErrors are generally temporary errors like DNS resolution failures,
|
|
57
|
+
# timeouts etc.
|
|
58
|
+
print("received connection error. Retrying...", e, file=sys.stderr)
|
|
59
|
+
time.sleep(retry_delay)
|
|
60
|
+
retry_delay *= 2 # Double the delay for the next attempt
|
|
61
|
+
retry_delay += random.uniform(0, 1) # Add jitter
|
|
62
|
+
retry_delay = min(retry_delay, 10)
|
|
44
63
|
|
|
45
|
-
|
|
46
|
-
raise MetaflowException(repr(e))
|
|
64
|
+
raise MetaflowException("exceeded retries from get_token")
|
{ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/METADATA
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: ob-metaflow-extensions
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.54
|
|
4
4
|
Summary: Outerbounds Platform Extensions for Metaflow
|
|
5
5
|
Author: Outerbounds, Inc.
|
|
6
6
|
License: Commercial
|
|
@@ -8,7 +8,6 @@ Description-Content-Type: text/markdown
|
|
|
8
8
|
Requires-Dist: boto3
|
|
9
9
|
Requires-Dist: kubernetes
|
|
10
10
|
Requires-Dist: ob-metaflow (==2.11.10.3)
|
|
11
|
-
Requires-Dist: ob-metaflow-stubs (==2.11.10.3)
|
|
12
11
|
|
|
13
12
|
# Outerbounds platform package
|
|
14
13
|
|
|
@@ -2,7 +2,7 @@ metaflow_extensions/outerbounds/__init__.py,sha256=TRGvIUMjkfneWtYUFSWoubu_Kf2ek
|
|
|
2
2
|
metaflow_extensions/outerbounds/remote_config.py,sha256=jHNHDbWAoKOgv3IH2I-Gzwfe2tr1gO3ds_VjsXBaCh8,4045
|
|
3
3
|
metaflow_extensions/outerbounds/config/__init__.py,sha256=mYo95obHU1IE1wbPkeVz_pfTzNqlNabp1QBEMTGllbE,112
|
|
4
4
|
metaflow_extensions/outerbounds/plugins/__init__.py,sha256=rK-EPg7107su6dY-yAx1IK3wAzyvQIIg6y4um_F_BXc,9343
|
|
5
|
-
metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=
|
|
5
|
+
metaflow_extensions/outerbounds/plugins/auth_server.py,sha256=JhlMFcR7SPSfR1C9w6GlqJq-NYNhOfISmHl2PdkYUok,2212
|
|
6
6
|
metaflow_extensions/outerbounds/plugins/perimeters.py,sha256=z8tSAkWtiITB-JtSQS7fkhlBwvxSxeTgEwFjahAzv-U,2238
|
|
7
7
|
metaflow_extensions/outerbounds/plugins/kubernetes/__init__.py,sha256=5zG8gShSj8m7rgF4xgWBZFuY3GDP5n1T0ktjRpGJLHA,69
|
|
8
8
|
metaflow_extensions/outerbounds/plugins/kubernetes/kubernetes_client.py,sha256=gj6Iaz26bGbZm3aQuNS18Mqh_80iJp5PgFwFSlJRcn8,1968
|
|
@@ -13,7 +13,7 @@ metaflow_extensions/outerbounds/toplevel/global_aliases_for_metaflow_package.py,
|
|
|
13
13
|
metaflow_extensions/outerbounds/toplevel/plugins/azure/__init__.py,sha256=WUuhz2YQfI4fz7nIcipwwWq781eaoHEk7n4GAn1npDg,63
|
|
14
14
|
metaflow_extensions/outerbounds/toplevel/plugins/gcp/__init__.py,sha256=BbZiaH3uILlEZ6ntBLKeNyqn3If8nIXZFq_Apd7Dhco,70
|
|
15
15
|
metaflow_extensions/outerbounds/toplevel/plugins/kubernetes/__init__.py,sha256=5zG8gShSj8m7rgF4xgWBZFuY3GDP5n1T0ktjRpGJLHA,69
|
|
16
|
-
ob_metaflow_extensions-1.1.
|
|
17
|
-
ob_metaflow_extensions-1.1.
|
|
18
|
-
ob_metaflow_extensions-1.1.
|
|
19
|
-
ob_metaflow_extensions-1.1.
|
|
16
|
+
ob_metaflow_extensions-1.1.54.dist-info/METADATA,sha256=dGtJ8ND8Nyb7lcKSjAFbGbQN-nYBKSYod5zWwW0TviE,520
|
|
17
|
+
ob_metaflow_extensions-1.1.54.dist-info/WHEEL,sha256=bb2Ot9scclHKMOLDEHY6B2sicWOgugjFKaJsT7vwMQo,110
|
|
18
|
+
ob_metaflow_extensions-1.1.54.dist-info/top_level.txt,sha256=NwG0ukwjygtanDETyp_BUdtYtqIA_lOjzFFh1TsnxvI,20
|
|
19
|
+
ob_metaflow_extensions-1.1.54.dist-info/RECORD,,
|
|
File without changes
|
{ob_metaflow_extensions-1.1.53.dist-info → ob_metaflow_extensions-1.1.54.dist-info}/top_level.txt
RENAMED
|
File without changes
|