bluer-objects 6.167.1__py3-none-any.whl → 6.172.1__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 bluer-objects might be problematic. Click here for more details.
- bluer_objects/.abcli/mlflow/deploy.sh +19 -6
- bluer_objects/.abcli/tests/help.sh +1 -0
- bluer_objects/__init__.py +1 -1
- bluer_objects/help/mlflow/__init__.py +21 -2
- bluer_objects/storage/s3.py +98 -0
- {bluer_objects-6.167.1.dist-info → bluer_objects-6.172.1.dist-info}/METADATA +2 -2
- {bluer_objects-6.167.1.dist-info → bluer_objects-6.172.1.dist-info}/RECORD +10 -10
- {bluer_objects-6.167.1.dist-info → bluer_objects-6.172.1.dist-info}/WHEEL +0 -0
- {bluer_objects-6.167.1.dist-info → bluer_objects-6.172.1.dist-info}/licenses/LICENSE +0 -0
- {bluer_objects-6.167.1.dist-info → bluer_objects-6.172.1.dist-info}/top_level.txt +0 -0
|
@@ -2,15 +2,28 @@
|
|
|
2
2
|
|
|
3
3
|
function bluer_objects_mlflow_deploy() {
|
|
4
4
|
local options=$1
|
|
5
|
-
local
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
local do_set=$(bluer_ai_option_int "$options" set 0)
|
|
6
|
+
|
|
7
|
+
if [[ "$do_set" == 1 ]]; then
|
|
8
|
+
local url=$2
|
|
9
|
+
if [[ -z "$url" ]]; then
|
|
10
|
+
bluer_ai_log_error "url not found."
|
|
11
|
+
return 1
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
pushd $abcli_path_git/bluer-objects >/dev/null
|
|
15
|
+
dotenv set \
|
|
16
|
+
MLFLOW_DEPLOYMENT \
|
|
17
|
+
$url
|
|
18
|
+
popd >/dev/null
|
|
8
19
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return 1
|
|
20
|
+
bluer_objects init
|
|
21
|
+
return
|
|
12
22
|
fi
|
|
13
23
|
|
|
24
|
+
local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
|
|
25
|
+
local port=$(bluer_ai_option "$options" port 5001)
|
|
26
|
+
|
|
14
27
|
[[ "$MLFLOW_DEPLOYMENT" != "local" ]] &&
|
|
15
28
|
bluer_ai_log_warning "MLFLOW_DEPLOYMENT is not local".
|
|
16
29
|
|
bluer_objects/__init__.py
CHANGED
|
@@ -30,7 +30,7 @@ def help_deploy(
|
|
|
30
30
|
tokens: List[str],
|
|
31
31
|
mono: bool,
|
|
32
32
|
) -> str:
|
|
33
|
-
options = xtra("dryrun
|
|
33
|
+
options = xtra("dryrun,port=<5001>", mono=mono)
|
|
34
34
|
|
|
35
35
|
return show_usage(
|
|
36
36
|
[
|
|
@@ -43,6 +43,22 @@ def help_deploy(
|
|
|
43
43
|
)
|
|
44
44
|
|
|
45
45
|
|
|
46
|
+
def help_deploy_set(
|
|
47
|
+
tokens: List[str],
|
|
48
|
+
mono: bool,
|
|
49
|
+
) -> str:
|
|
50
|
+
return show_usage(
|
|
51
|
+
[
|
|
52
|
+
"@mlflow",
|
|
53
|
+
"deploy",
|
|
54
|
+
"set",
|
|
55
|
+
"<url>",
|
|
56
|
+
],
|
|
57
|
+
"set mlflow deployment.",
|
|
58
|
+
mono=mono,
|
|
59
|
+
)
|
|
60
|
+
|
|
61
|
+
|
|
46
62
|
def help_get_id(
|
|
47
63
|
tokens: List[str],
|
|
48
64
|
mono: bool,
|
|
@@ -199,7 +215,10 @@ def help_transition(
|
|
|
199
215
|
help_functions = {
|
|
200
216
|
"browse": help_browse,
|
|
201
217
|
"cache": help_cache,
|
|
202
|
-
"deploy":
|
|
218
|
+
"deploy": {
|
|
219
|
+
"": help_deploy,
|
|
220
|
+
"set": help_deploy_set,
|
|
221
|
+
},
|
|
203
222
|
"get_id": help_get_id,
|
|
204
223
|
"get_run_id": help_get_run_id,
|
|
205
224
|
"list_registered_models": help_list_registered_models,
|
bluer_objects/storage/s3.py
CHANGED
|
@@ -16,6 +16,104 @@ from bluer_objects.logger import logger
|
|
|
16
16
|
class S3Interface(StorageInterface):
|
|
17
17
|
name = "s3"
|
|
18
18
|
|
|
19
|
+
def clear(
|
|
20
|
+
self,
|
|
21
|
+
do_dryrun: bool = True,
|
|
22
|
+
log: bool = True,
|
|
23
|
+
) -> bool:
|
|
24
|
+
logger.info(
|
|
25
|
+
"{}.clear({})".format(
|
|
26
|
+
self.__class__.__name__,
|
|
27
|
+
"dryrun" if do_dryrun else "",
|
|
28
|
+
)
|
|
29
|
+
)
|
|
30
|
+
|
|
31
|
+
try:
|
|
32
|
+
s3 = boto3.client(
|
|
33
|
+
"s3",
|
|
34
|
+
endpoint_url=env.S3_STORAGE_ENDPOINT_URL,
|
|
35
|
+
aws_access_key_id=env.S3_STORAGE_AWS_ACCESS_KEY_ID,
|
|
36
|
+
aws_secret_access_key=env.S3_STORAGE_AWS_SECRET_ACCESS_KEY,
|
|
37
|
+
)
|
|
38
|
+
|
|
39
|
+
paginator = s3.get_paginator("list_objects_v2")
|
|
40
|
+
pages = paginator.paginate(
|
|
41
|
+
Bucket=env.S3_STORAGE_BUCKET,
|
|
42
|
+
Prefix="test",
|
|
43
|
+
)
|
|
44
|
+
except Exception as e:
|
|
45
|
+
logger.error(e)
|
|
46
|
+
return False
|
|
47
|
+
|
|
48
|
+
list_of_objects = sorted(
|
|
49
|
+
list(
|
|
50
|
+
set(
|
|
51
|
+
reduce(
|
|
52
|
+
lambda x, y: x + y,
|
|
53
|
+
[
|
|
54
|
+
[
|
|
55
|
+
obj["Key"].split("/", 1)[0]
|
|
56
|
+
for obj in page.get("Contents", [])
|
|
57
|
+
]
|
|
58
|
+
for page in pages
|
|
59
|
+
],
|
|
60
|
+
[],
|
|
61
|
+
)
|
|
62
|
+
)
|
|
63
|
+
)
|
|
64
|
+
)
|
|
65
|
+
|
|
66
|
+
logger.info(f"{len(list_of_objects)} object(s) to delete.")
|
|
67
|
+
|
|
68
|
+
for object_name in tqdm(list_of_objects):
|
|
69
|
+
if not self.delete(
|
|
70
|
+
object_name=object_name,
|
|
71
|
+
do_dryrun=do_dryrun,
|
|
72
|
+
):
|
|
73
|
+
return False
|
|
74
|
+
|
|
75
|
+
return True
|
|
76
|
+
|
|
77
|
+
def delete(
|
|
78
|
+
self,
|
|
79
|
+
object_name: str,
|
|
80
|
+
do_dryrun: bool = True,
|
|
81
|
+
log: bool = True,
|
|
82
|
+
) -> bool:
|
|
83
|
+
if log:
|
|
84
|
+
logger.info(
|
|
85
|
+
"{}.delete({}){}".format(
|
|
86
|
+
self.__class__.__name__,
|
|
87
|
+
object_name,
|
|
88
|
+
" dryrun" if do_dryrun else "",
|
|
89
|
+
)
|
|
90
|
+
)
|
|
91
|
+
if do_dryrun:
|
|
92
|
+
return True
|
|
93
|
+
|
|
94
|
+
try:
|
|
95
|
+
s3 = boto3.resource(
|
|
96
|
+
"s3",
|
|
97
|
+
endpoint_url=env.S3_STORAGE_ENDPOINT_URL,
|
|
98
|
+
aws_access_key_id=env.S3_STORAGE_AWS_ACCESS_KEY_ID,
|
|
99
|
+
aws_secret_access_key=env.S3_STORAGE_AWS_SECRET_ACCESS_KEY,
|
|
100
|
+
)
|
|
101
|
+
bucket = s3.Bucket(env.S3_STORAGE_BUCKET)
|
|
102
|
+
|
|
103
|
+
objects_to_delete = bucket.objects.filter(Prefix=f"{object_name}/")
|
|
104
|
+
delete_requests = [{"Key": obj.key} for obj in objects_to_delete]
|
|
105
|
+
|
|
106
|
+
if not delete_requests:
|
|
107
|
+
logger.warning(f"no files found under {object_name}.")
|
|
108
|
+
return True
|
|
109
|
+
|
|
110
|
+
bucket.delete_objects(Delete={"Objects": delete_requests})
|
|
111
|
+
except Exception as e:
|
|
112
|
+
logger.error(e)
|
|
113
|
+
return False
|
|
114
|
+
|
|
115
|
+
return True
|
|
116
|
+
|
|
19
117
|
def download(
|
|
20
118
|
self,
|
|
21
119
|
object_name: str,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: bluer_objects
|
|
3
|
-
Version: 6.
|
|
3
|
+
Version: 6.172.1
|
|
4
4
|
Summary: 🌀 Object management in Bash.
|
|
5
5
|
Home-page: https://github.com/kamangir/bluer-objects
|
|
6
6
|
Author: Arash Abadpour (Kamangir)
|
|
@@ -64,6 +64,6 @@ pip install bluer-objects
|
|
|
64
64
|
|
|
65
65
|
[](https://github.com/kamangir/bluer-objects/actions/workflows/pylint.yml) [](https://github.com/kamangir/bluer-objects/actions/workflows/pytest.yml) [](https://github.com/kamangir/bluer-objects/actions/workflows/bashtest.yml) [](https://pypi.org/project/bluer-objects/) [](https://pypistats.org/packages/bluer-objects)
|
|
66
66
|
|
|
67
|
-
built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.
|
|
67
|
+
built by 🌀 [`bluer README`](https://github.com/kamangir/bluer-objects/tree/main/bluer_objects/README), based on 🌀 [`bluer_objects-6.172.1`](https://github.com/kamangir/bluer-objects).
|
|
68
68
|
|
|
69
69
|
built by 🌀 [`blueness-3.118.1`](https://github.com/kamangir/blueness).
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
bluer_objects/__init__.py,sha256=
|
|
1
|
+
bluer_objects/__init__.py,sha256=bq2baUKC5OSP2aNRPyi_cxeJ0v0_Nf5vUYvhk514X4g,315
|
|
2
2
|
bluer_objects/__main__.py,sha256=Yqfov833_hJuRne19WrGhT5DWAPtdffpoMxeSXS7EGw,359
|
|
3
3
|
bluer_objects/config.env,sha256=cpmtTuKHIBvVjX30MpAImFgwM0g24qTHwoO-lCJRInA,175
|
|
4
4
|
bluer_objects/env.py,sha256=aImjtNh8NKaua2rpQVFXWp86QF7nY87fDuMOO14O58E,1956
|
|
@@ -29,7 +29,7 @@ bluer_objects/.abcli/metadata/get.sh,sha256=6W9x0akZwwozTyOlKCW_0MndYVUAL4v1HSUP
|
|
|
29
29
|
bluer_objects/.abcli/metadata/post.sh,sha256=UdvZNuRu6_NcyRVvDMFZ9GEwOm3K8rsNqM0FFr9LskA,570
|
|
30
30
|
bluer_objects/.abcli/mlflow/browse.sh,sha256=jPHAKLgG7yDLCdSAW5acVmCOcOltAkZQ8FrttrX401s,1166
|
|
31
31
|
bluer_objects/.abcli/mlflow/cache.sh,sha256=tpdCqL3jMFpfRmYS6UTgLiycv43_z_N_J1ux2XsDgdA,556
|
|
32
|
-
bluer_objects/.abcli/mlflow/deploy.sh,sha256=
|
|
32
|
+
bluer_objects/.abcli/mlflow/deploy.sh,sha256=O8JuyIE2NgA8YVZnAX1y9WPkz9gQcZHC2SvU-UckDRo,1012
|
|
33
33
|
bluer_objects/.abcli/mlflow/list_registered_models.sh,sha256=cZGtAzfLx-kW3-zi0mLrfhzk4B8KyUL2sq2tD7lK5q8,191
|
|
34
34
|
bluer_objects/.abcli/mlflow/lock.sh,sha256=MXq8srb4qAq5gZb0QC4Nkf6x7mME9L0cf46nGkTkbYY,340
|
|
35
35
|
bluer_objects/.abcli/mlflow/log_artifacts.sh,sha256=3sCdDHoRVFqCg_DPF8zw3HSAj8Grr-Mbwmf0iUlDmrk,243
|
|
@@ -54,7 +54,7 @@ bluer_objects/.abcli/tests/README.sh,sha256=gk2KuNLFTuV3qdVgH8BNfJmur3gZoSV8EwLb
|
|
|
54
54
|
bluer_objects/.abcli/tests/clone.sh,sha256=Rl9pHvmRJ4H-y-iMA80q11UdSZFrguNaMTez0LTtJjA,473
|
|
55
55
|
bluer_objects/.abcli/tests/create_test_asset.sh,sha256=onRGc3VjDWA7On3isxKD3J7mxA6n349AVXRj90Z3Jzc,386
|
|
56
56
|
bluer_objects/.abcli/tests/gif.sh,sha256=2FvcomiyYTzJa527a7Wk2EJt5N9_vZt8tmQD1QVetDg,461
|
|
57
|
-
bluer_objects/.abcli/tests/help.sh,sha256=
|
|
57
|
+
bluer_objects/.abcli/tests/help.sh,sha256=ViyFns-27DKGh7dOSSvOHTlbE4qLw9YzhCxmVe87vJo,1890
|
|
58
58
|
bluer_objects/.abcli/tests/host.sh,sha256=GBuTLNw1sU3fAb5jS-ew_qAfovVCQ5CLaz5ad04IkoA,144
|
|
59
59
|
bluer_objects/.abcli/tests/ls.sh,sha256=oOvcnEQZgnNlwCK4SvkdAjCBs2_z0qBOhgFLsXDBSXM,555
|
|
60
60
|
bluer_objects/.abcli/tests/metadata.sh,sha256=OP1c0h0TSlDycrv0UglKLyBtTQwqh9M0nqVAdQUzkno,1723
|
|
@@ -92,7 +92,7 @@ bluer_objects/help/host.py,sha256=4t4yrPGjTbnFtODcuBjfIzpA5pmmvc5s4QrjIqPPVsM,98
|
|
|
92
92
|
bluer_objects/help/ls.py,sha256=acvRLDxjJOzQ1a9ZQ4Mn9aBZ8Vf17IDHcAxC2O3R33Y,627
|
|
93
93
|
bluer_objects/help/metadata.py,sha256=fk22NasBcZU1ffY4fu6AxrCzMQtTI28p_ghaSVRrrPM,2811
|
|
94
94
|
bluer_objects/help/upload.py,sha256=p-nRw9d_S6PI7PcD0mBwWqQRPWQG4r3usjvOIzAbTeM,368
|
|
95
|
-
bluer_objects/help/mlflow/__init__.py,sha256=
|
|
95
|
+
bluer_objects/help/mlflow/__init__.py,sha256=8GN6TqxCLFobXyn5naiqUC-hmSTaF42-Re2feKpdIPo,4419
|
|
96
96
|
bluer_objects/help/mlflow/cache.py,sha256=O8O1oaiq1e1z2HCi8fRe4hjSNimzvCaCAIu-u2GDHkE,704
|
|
97
97
|
bluer_objects/help/mlflow/lock.py,sha256=REdB4LmlHu2_6SF1nDA50KBbYtNIKRDbYH7KduUnuEg,848
|
|
98
98
|
bluer_objects/help/mlflow/tags.py,sha256=C3FcMRe-JhelhCQkAyZ5jlxGtgYxhNjtIhxka8k_ytI,2137
|
|
@@ -124,7 +124,7 @@ bluer_objects/storage/WebDAVzip.py,sha256=Sd_rU57pJaRa05sKNQiMr85Bg3w7O5k8N1pSN1
|
|
|
124
124
|
bluer_objects/storage/__init__.py,sha256=XosPRjB20wDS-QMwQtr3zqKC9UM7U8z-PHwySGBegcQ,1646
|
|
125
125
|
bluer_objects/storage/__main__.py,sha256=vZI6rUkrekf1eYUgWOOUnFhl4qPfpByzwb-tihTOiIo,1776
|
|
126
126
|
bluer_objects/storage/base.py,sha256=72I1zvlpbQbFU20TxqcTodR4m8PYgBPXMfteek8V0_A,1949
|
|
127
|
-
bluer_objects/storage/s3.py,sha256=
|
|
127
|
+
bluer_objects/storage/s3.py,sha256=evUFpPk6PUv1KCXTMq_QCbygqNk0YNAOQr_B4gYrjBE,8342
|
|
128
128
|
bluer_objects/testing/__init__.py,sha256=DWY5ZtvCnHG_t9BDiqy_ArLOZi-nlyAtPVMLA1PPAMU,62
|
|
129
129
|
bluer_objects/testing/__main__.py,sha256=hhJV9qn0V_8FxzNDcoHCHr4A7zf9UudnNGJCAPkTBGU,750
|
|
130
130
|
bluer_objects/testing/functions.py,sha256=AXAfzWLcEPkbSYTehdahshjKJ45C4IJkRs_TgrHOntc,1355
|
|
@@ -156,8 +156,8 @@ bluer_objects/tests/test_storage_webdav_request.py,sha256=h2b8PeIx0-hQ2d6PmQcJZy
|
|
|
156
156
|
bluer_objects/tests/test_storage_webdav_zip.py,sha256=C19qxhkcHyTwVFzW35vL85SOcXJPkqXXaWUNll0Uyqc,1017
|
|
157
157
|
bluer_objects/tests/test_testing.py,sha256=d2NH435yqJBl9wmfMqGGd-f0Y0jsL2QhHUXkty9AwPA,235
|
|
158
158
|
bluer_objects/tests/test_version.py,sha256=Lyf3PMcA22e17BNRk_2VgPrtao6dWEgVoXo68Uds8SE,75
|
|
159
|
-
bluer_objects-6.
|
|
160
|
-
bluer_objects-6.
|
|
161
|
-
bluer_objects-6.
|
|
162
|
-
bluer_objects-6.
|
|
163
|
-
bluer_objects-6.
|
|
159
|
+
bluer_objects-6.172.1.dist-info/licenses/LICENSE,sha256=ogEPNDSH0_dhiv_lT3ifVIdgIzHAqNA_SemnxUfPBJk,7048
|
|
160
|
+
bluer_objects-6.172.1.dist-info/METADATA,sha256=MLqPCPloAP4BJhdCOqaXQHrx1oVOdyYVoiRCl4ExoPs,3678
|
|
161
|
+
bluer_objects-6.172.1.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
162
|
+
bluer_objects-6.172.1.dist-info/top_level.txt,sha256=RX2TpddbnRkurda3G_pAdyeTztP2IhhRPx949GlEvQo,14
|
|
163
|
+
bluer_objects-6.172.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|