bluer-objects 6.104.1__py3-none-any.whl → 6.464.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.
- bluer_objects/.abcli/abcli.sh +6 -0
- bluer_objects/.abcli/alias.sh +13 -6
- bluer_objects/.abcli/assets/cd.sh +20 -0
- bluer_objects/.abcli/assets/mv.sh +34 -0
- bluer_objects/.abcli/assets/publish.sh +40 -0
- bluer_objects/.abcli/assets.sh +15 -0
- bluer_objects/.abcli/create_test_asset.sh +10 -0
- bluer_objects/.abcli/download.sh +3 -1
- bluer_objects/.abcli/file.sh +15 -4
- bluer_objects/.abcli/gif.sh +18 -0
- bluer_objects/.abcli/host.sh +23 -7
- bluer_objects/.abcli/ls.sh +19 -8
- bluer_objects/.abcli/metadata/download.sh +9 -0
- bluer_objects/.abcli/metadata/edit.sh +15 -0
- bluer_objects/.abcli/metadata/upload.sh +9 -0
- bluer_objects/.abcli/mlflow/browse.sh +2 -0
- bluer_objects/.abcli/mlflow/deploy.sh +21 -5
- bluer_objects/.abcli/mlflow/lock/lock.sh +11 -0
- bluer_objects/.abcli/mlflow/lock/unlock.sh +12 -0
- bluer_objects/.abcli/mlflow/lock.sh +15 -0
- bluer_objects/.abcli/mlflow/tags/search.sh +1 -5
- bluer_objects/.abcli/mlflow.sh +0 -2
- bluer_objects/.abcli/pdf/convert.sh +92 -0
- bluer_objects/.abcli/pdf.sh +15 -0
- bluer_objects/.abcli/storage/clear.sh +2 -0
- bluer_objects/.abcli/tests/clone.sh +2 -3
- bluer_objects/.abcli/tests/create_test_asset.sh +16 -0
- bluer_objects/.abcli/tests/file.sh +64 -0
- bluer_objects/.abcli/tests/gif.sh +3 -3
- bluer_objects/.abcli/tests/help.sh +23 -7
- bluer_objects/.abcli/tests/ls.sh +11 -4
- bluer_objects/.abcli/tests/metadata.sh +35 -0
- bluer_objects/.abcli/tests/mlflow_lock.sh +30 -0
- bluer_objects/.abcli/tests/mlflow_tags.sh +1 -1
- bluer_objects/.abcli/tests/open.sh +11 -0
- bluer_objects/.abcli/tests/open_gif_open.sh +14 -0
- bluer_objects/.abcli/tests/pdf.sh +39 -0
- bluer_objects/.abcli/tests/storage_clear.sh +11 -0
- bluer_objects/.abcli/tests/storage_public_upload.sh +25 -0
- bluer_objects/.abcli/tests/storage_status.sh +12 -0
- bluer_objects/.abcli/tests/{storage.sh → storage_upload_download.sh} +26 -8
- bluer_objects/.abcli/upload.sh +26 -2
- bluer_objects/README/__init__.py +7 -22
- bluer_objects/README/alias.py +67 -0
- bluer_objects/README/build/__init__.py +0 -0
- bluer_objects/README/build/aliases.py +23 -0
- bluer_objects/README/build/docs.py +23 -0
- bluer_objects/README/build/modules.py +9 -0
- bluer_objects/README/consts.py +44 -0
- bluer_objects/README/functions.py +154 -204
- bluer_objects/README/items.py +78 -6
- bluer_objects/README/process/__init__.py +0 -0
- bluer_objects/README/process/assets.py +36 -0
- bluer_objects/README/process/details.py +20 -0
- bluer_objects/README/process/envs.py +23 -0
- bluer_objects/README/process/help.py +27 -0
- bluer_objects/README/process/include.py +40 -0
- bluer_objects/README/process/legacy.py +21 -0
- bluer_objects/README/process/mermaid.py +20 -0
- bluer_objects/README/process/national_internet.py +55 -0
- bluer_objects/README/process/objects.py +32 -0
- bluer_objects/README/process/signature.py +35 -0
- bluer_objects/README/process/title.py +44 -0
- bluer_objects/README/process/variables.py +12 -0
- bluer_objects/__init__.py +1 -1
- bluer_objects/assets/__init__.py +0 -0
- bluer_objects/assets/__main__.py +57 -0
- bluer_objects/assets/functions.py +62 -0
- bluer_objects/config.env +13 -1
- bluer_objects/env.py +27 -1
- bluer_objects/file/__main__.py +52 -7
- bluer_objects/file/functions.py +21 -4
- bluer_objects/file/load.py +2 -9
- bluer_objects/file/save.py +17 -24
- bluer_objects/graphics/__main__.py +7 -0
- bluer_objects/graphics/gif.py +11 -7
- bluer_objects/graphics/screen.py +9 -8
- bluer_objects/help/assets.py +93 -0
- bluer_objects/help/create_test_asset.py +22 -0
- bluer_objects/help/download.py +17 -3
- bluer_objects/help/file.py +59 -0
- bluer_objects/help/functions.py +9 -1
- bluer_objects/help/gif.py +25 -0
- bluer_objects/help/host.py +6 -4
- bluer_objects/help/ls.py +26 -3
- bluer_objects/help/metadata.py +51 -0
- bluer_objects/help/mlflow/__init__.py +23 -2
- bluer_objects/help/mlflow/cache.py +2 -4
- bluer_objects/help/mlflow/lock.py +52 -0
- bluer_objects/help/mlflow/tags.py +34 -23
- bluer_objects/help/pdf.py +67 -0
- bluer_objects/help/upload.py +10 -3
- bluer_objects/host/functions.py +4 -1
- bluer_objects/logger/confusion_matrix.py +76 -0
- bluer_objects/logger/image.py +110 -0
- bluer_objects/logger/stitch.py +107 -0
- bluer_objects/markdown.py +8 -6
- bluer_objects/metadata/__init__.py +1 -0
- bluer_objects/metadata/flatten.py +27 -0
- bluer_objects/mlflow/__init__.py +1 -1
- bluer_objects/mlflow/__main__.py +49 -31
- bluer_objects/mlflow/lock/__init__.py +1 -0
- bluer_objects/mlflow/lock/__main__.py +58 -0
- bluer_objects/mlflow/lock/functions.py +121 -0
- bluer_objects/mlflow/logging.py +53 -41
- bluer_objects/mlflow/models.py +7 -0
- bluer_objects/mlflow/objects.py +7 -0
- bluer_objects/mlflow/runs.py +10 -1
- bluer_objects/mlflow/serverless/__init__.py +3 -0
- bluer_objects/mlflow/serverless/api.py +88 -0
- bluer_objects/mlflow/serverless/read.py +19 -0
- bluer_objects/mlflow/serverless/search.py +35 -0
- bluer_objects/mlflow/serverless/write.py +42 -0
- bluer_objects/mlflow/tags.py +59 -9
- bluer_objects/objects.py +3 -1
- bluer_objects/pdf/__init__.py +1 -0
- bluer_objects/pdf/__main__.py +78 -0
- bluer_objects/pdf/convert/__init__.py +0 -0
- bluer_objects/pdf/convert/batch.py +54 -0
- bluer_objects/pdf/convert/combination.py +32 -0
- bluer_objects/pdf/convert/convert.py +110 -0
- bluer_objects/pdf/convert/image.py +53 -0
- bluer_objects/pdf/convert/md.py +97 -0
- bluer_objects/pdf/convert/missing.py +96 -0
- bluer_objects/pdf/convert/pdf.py +37 -0
- bluer_objects/sample.env +6 -0
- bluer_objects/storage/WebDAV.py +11 -7
- bluer_objects/storage/WebDAVrequest.py +360 -0
- bluer_objects/storage/WebDAVzip.py +26 -29
- bluer_objects/storage/__init__.py +28 -1
- bluer_objects/storage/__main__.py +40 -6
- bluer_objects/storage/base.py +84 -5
- bluer_objects/storage/policies.py +7 -0
- bluer_objects/storage/s3.py +367 -0
- bluer_objects/testing/__main__.py +6 -0
- bluer_objects/tests/test_README_consts.py +71 -0
- bluer_objects/tests/test_README_items.py +128 -0
- bluer_objects/tests/test_alias.py +33 -0
- bluer_objects/tests/test_env.py +42 -7
- bluer_objects/tests/test_file_download.py +30 -0
- bluer_objects/tests/test_file_load_save.py +1 -2
- bluer_objects/tests/test_file_load_save_text.py +46 -0
- bluer_objects/tests/test_graphics_gif.py +2 -0
- bluer_objects/tests/test_log_image_grid.py +29 -0
- bluer_objects/tests/test_logger_confusion_matrix.py +18 -0
- bluer_objects/tests/test_logger_matrix.py +2 -2
- bluer_objects/tests/test_logger_stitch_images.py +47 -0
- bluer_objects/tests/test_metadata.py +12 -6
- bluer_objects/tests/test_metadata_flatten.py +109 -0
- bluer_objects/tests/test_mlflow.py +114 -5
- bluer_objects/tests/test_mlflow_lock.py +26 -0
- bluer_objects/tests/test_objects.py +2 -0
- bluer_objects/tests/test_shell.py +34 -0
- bluer_objects/tests/test_storage.py +8 -21
- bluer_objects/tests/test_storage_base.py +39 -0
- bluer_objects/tests/test_storage_s3.py +67 -0
- bluer_objects/tests/test_storage_webdav_request.py +75 -0
- bluer_objects/tests/test_storage_webdav_zip.py +42 -0
- bluer_objects/tests/test_web_is_accessible.py +11 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/METADATA +20 -11
- bluer_objects-6.464.1.dist-info/RECORD +228 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/WHEEL +1 -1
- bluer_objects/.abcli/storage/download_file.sh +0 -9
- bluer_objects/.abcli/storage/exists.sh +0 -8
- bluer_objects/.abcli/storage/list.sh +0 -8
- bluer_objects/.abcli/storage/rm.sh +0 -11
- bluer_objects/.abcli/tests/mlflow_test.sh +0 -7
- bluer_objects-6.104.1.dist-info/RECORD +0 -143
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/licenses/LICENSE +0 -0
- {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_file_asset() {
|
|
4
|
+
echo $abcli_path_git/bluer-objects/bluer_objects/.abcli/tests/file.sh
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
function test_file_replace() {
|
|
8
|
+
local options=$1
|
|
9
|
+
|
|
10
|
+
local filename=$abcli_path_git/file.sh
|
|
11
|
+
|
|
12
|
+
cp -v \
|
|
13
|
+
$(test_file_asset) \
|
|
14
|
+
$filename
|
|
15
|
+
[[ $? -ne 0 ]] && return 1
|
|
16
|
+
|
|
17
|
+
bluer_objects_file - \
|
|
18
|
+
replace \
|
|
19
|
+
$filename \
|
|
20
|
+
--this function+local \
|
|
21
|
+
--that FUNCTION+LOCAL \
|
|
22
|
+
--cat 1 \
|
|
23
|
+
"${@:2}"
|
|
24
|
+
[[ $? -ne 0 ]] && return 1
|
|
25
|
+
bluer_ai_hr
|
|
26
|
+
|
|
27
|
+
# ---
|
|
28
|
+
|
|
29
|
+
bluer_objects_file - \
|
|
30
|
+
replace \
|
|
31
|
+
$filename \
|
|
32
|
+
--this "FUNCTION test_file_asset() {+echo" \
|
|
33
|
+
--that ":)+:(" \
|
|
34
|
+
--cat 1 \
|
|
35
|
+
--whole_line 1 \
|
|
36
|
+
"${@:2}"
|
|
37
|
+
[[ $? -ne 0 ]] && return 1
|
|
38
|
+
rm -v $filename
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function test_file_size() {
|
|
42
|
+
local options=$1
|
|
43
|
+
|
|
44
|
+
local size=$(bluer_objects_file - \
|
|
45
|
+
size \
|
|
46
|
+
$(test_file_asset))
|
|
47
|
+
|
|
48
|
+
bluer_ai_assert \
|
|
49
|
+
"$size" \
|
|
50
|
+
"1.18 kB"
|
|
51
|
+
[[ $? -ne 0 ]] && return 1
|
|
52
|
+
bluer_ai_hr
|
|
53
|
+
|
|
54
|
+
# ---
|
|
55
|
+
|
|
56
|
+
local size=$(bluer_objects_file - \
|
|
57
|
+
size \
|
|
58
|
+
$(test_file_asset) \
|
|
59
|
+
--pretty 0)
|
|
60
|
+
|
|
61
|
+
bluer_ai_assert \
|
|
62
|
+
"$size" \
|
|
63
|
+
"1209"
|
|
64
|
+
}
|
|
@@ -5,14 +5,14 @@ function test_bluer_objects_gif() {
|
|
|
5
5
|
|
|
6
6
|
local source_object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
--object_name $source_object_name
|
|
8
|
+
bluer_objects_create_test_asset \
|
|
9
|
+
$source_object_name
|
|
11
10
|
[[ $? -ne 0 ]] && return 1
|
|
12
11
|
|
|
13
12
|
bluer_objects_gif \
|
|
14
13
|
~upload,$options \
|
|
15
14
|
$source_object_name \
|
|
15
|
+
--frame_count 20 \
|
|
16
16
|
--frame_duration 200 \
|
|
17
17
|
--output_filename test.gif \
|
|
18
18
|
--scale 2 \
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
function test_bluer_objects_help() {
|
|
4
4
|
local options=$1
|
|
5
5
|
|
|
6
|
-
# legacy, not tested:
|
|
7
|
-
# - @mysql
|
|
8
|
-
|
|
9
6
|
local module
|
|
10
7
|
for module in \
|
|
8
|
+
"@assets" \
|
|
9
|
+
"@assets cd" \
|
|
10
|
+
"@assets mv" \
|
|
11
|
+
"@assets publish" \
|
|
12
|
+
\
|
|
11
13
|
"@cp" \
|
|
12
14
|
\
|
|
15
|
+
"@create_test_asset" \
|
|
16
|
+
\
|
|
13
17
|
"@objects" \
|
|
14
18
|
\
|
|
15
19
|
"@objects pypi" \
|
|
@@ -22,27 +26,43 @@ function test_bluer_objects_help() {
|
|
|
22
26
|
"@objects test" \
|
|
23
27
|
"@objects test list" \
|
|
24
28
|
\
|
|
29
|
+
"@pdf" \
|
|
30
|
+
"@pdf convert" \
|
|
31
|
+
\
|
|
25
32
|
"@cp" \
|
|
26
33
|
\
|
|
27
34
|
"@download" \
|
|
28
35
|
\
|
|
29
36
|
"@gif" \
|
|
37
|
+
"@gif open" \
|
|
30
38
|
\
|
|
31
39
|
"@ls" \
|
|
32
40
|
\
|
|
41
|
+
"@file" \
|
|
42
|
+
"@file replace" \
|
|
43
|
+
"@file size" \
|
|
44
|
+
\
|
|
33
45
|
"@host" \
|
|
34
46
|
"@host get" \
|
|
35
47
|
"@host reboot" \
|
|
36
48
|
"@host shutdown" \
|
|
37
49
|
\
|
|
50
|
+
"@lock" \
|
|
51
|
+
"@lock lock" \
|
|
52
|
+
"@lock unlock" \
|
|
53
|
+
\
|
|
38
54
|
"@metadata" \
|
|
55
|
+
"@metadata download" \
|
|
56
|
+
"@metadata edit" \
|
|
39
57
|
"@metadata get" \
|
|
40
58
|
"@metadata post" \
|
|
59
|
+
"@metadata upload" \
|
|
41
60
|
\
|
|
42
61
|
"@mlflow" \
|
|
43
62
|
"@mlflow browse" \
|
|
44
63
|
"@mlflow cache" \
|
|
45
64
|
"@mlflow deploy" \
|
|
65
|
+
"@mlflow deploy set" \
|
|
46
66
|
"@mlflow get_id" \
|
|
47
67
|
"@mlflow get_run_id" \
|
|
48
68
|
"@mlflow list_registered_models" \
|
|
@@ -62,10 +82,6 @@ function test_bluer_objects_help() {
|
|
|
62
82
|
\
|
|
63
83
|
"@storage" \
|
|
64
84
|
"@storage clear" \
|
|
65
|
-
"@storage download_file" \
|
|
66
|
-
"@storage exists" \
|
|
67
|
-
"@storage list" \
|
|
68
|
-
"@storage rm" \
|
|
69
85
|
"@storage status" \
|
|
70
86
|
\
|
|
71
87
|
"@upload" \
|
bluer_objects/.abcli/tests/ls.sh
CHANGED
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
function test_bluer_objects_ls() {
|
|
4
4
|
local object_name=test_bluer_objects_ls-$(bluer_ai_string_timestamp_short)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
--object_name $object_name
|
|
6
|
+
bluer_objects_create_test_asset \
|
|
7
|
+
$object_name
|
|
9
8
|
[[ $? -ne 0 ]] && return 1
|
|
10
9
|
bluer_ai_hr
|
|
11
10
|
|
|
@@ -21,5 +20,13 @@ function test_bluer_objects_ls() {
|
|
|
21
20
|
[[ $? -ne 0 ]] && return 1
|
|
22
21
|
bluer_ai_hr
|
|
23
22
|
|
|
24
|
-
bluer_objects_ls
|
|
23
|
+
bluer_objects_ls cloud,objects --prefix 2025-09
|
|
24
|
+
[[ $? -ne 0 ]] && return 1
|
|
25
|
+
bluer_ai_hr
|
|
26
|
+
|
|
27
|
+
bluer_objects_ls local,objects --prefix 2025-09
|
|
28
|
+
[[ $? -ne 0 ]] && return 1
|
|
29
|
+
bluer_ai_hr
|
|
30
|
+
|
|
31
|
+
bluer_objects_ls $abcli_path_git
|
|
25
32
|
}
|
|
@@ -54,3 +54,38 @@ function test_bluer_objects_metadata() {
|
|
|
54
54
|
|
|
55
55
|
return 0
|
|
56
56
|
}
|
|
57
|
+
|
|
58
|
+
function test_bluer_objects_metadata_upload_download_edit() {
|
|
59
|
+
local object_name=test_bluer_objects_metadata_upload_download_edit-$(bluer_ai_string_timestamp)
|
|
60
|
+
|
|
61
|
+
local key=key-$(bluer_ai_string_timestamp)
|
|
62
|
+
local value=value-$(bluer_ai_string_timestamp)
|
|
63
|
+
|
|
64
|
+
bluer_objects_metadata_post \
|
|
65
|
+
$key \
|
|
66
|
+
$value \
|
|
67
|
+
object \
|
|
68
|
+
$object_name \
|
|
69
|
+
--verbose 1
|
|
70
|
+
[[ $? -ne 0 ]] && return 1
|
|
71
|
+
|
|
72
|
+
bluer_objects_metadata_upload \
|
|
73
|
+
$object_name
|
|
74
|
+
[[ $? -ne 0 ]] && return 1
|
|
75
|
+
|
|
76
|
+
rm -v $ABCLI_OBJECT_ROOT/$object_name/metadata.yaml
|
|
77
|
+
[[ $? -ne 0 ]] && return 1
|
|
78
|
+
|
|
79
|
+
bluer_objects_metadata_download \
|
|
80
|
+
$object_name
|
|
81
|
+
[[ $? -ne 0 ]] && return 1
|
|
82
|
+
|
|
83
|
+
local value_received=$(bluer_objects_metadata_get \
|
|
84
|
+
key=$key,object \
|
|
85
|
+
$object_name)
|
|
86
|
+
|
|
87
|
+
bluer_ai_assert \
|
|
88
|
+
$value \
|
|
89
|
+
$value_received \
|
|
90
|
+
yes
|
|
91
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_bluer_objects_mlflow_lock() {
|
|
4
|
+
local options=$1
|
|
5
|
+
|
|
6
|
+
local object_name="test-object-$(bluer_ai_string_timestamp_short)"
|
|
7
|
+
local lock_name="lock-$(bluer_ai_string_random)"
|
|
8
|
+
|
|
9
|
+
bluer_ai_eval ,$options \
|
|
10
|
+
bluer_objects_mlflow_lock \
|
|
11
|
+
lock \
|
|
12
|
+
$object_name \
|
|
13
|
+
--lock $lock_name \
|
|
14
|
+
--timeout 10
|
|
15
|
+
[[ $? -ne 0 ]] && return 1
|
|
16
|
+
|
|
17
|
+
bluer_ai_eval ,$options \
|
|
18
|
+
bluer_objects_mlflow_lock \
|
|
19
|
+
lock \
|
|
20
|
+
$object_name \
|
|
21
|
+
--lock $lock_name \
|
|
22
|
+
--timeout 10
|
|
23
|
+
[[ $? -eq 0 ]] && return 1
|
|
24
|
+
|
|
25
|
+
bluer_ai_eval ,$options \
|
|
26
|
+
bluer_objects_mlflow_lock \
|
|
27
|
+
unlock \
|
|
28
|
+
$object_name \
|
|
29
|
+
--lock $lock_name
|
|
30
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_bluer_objects_pdf_convert_inline() {
|
|
4
|
+
local options=$1
|
|
5
|
+
|
|
6
|
+
local do_install=1
|
|
7
|
+
[[ "$abcli_is_mac" == true ]] &&
|
|
8
|
+
do_install=0
|
|
9
|
+
|
|
10
|
+
local object_name=test_bluer_objects_pdf_convert-$(bluer_ai_string_timestamp)
|
|
11
|
+
|
|
12
|
+
bluer_ai_eval ,$options \
|
|
13
|
+
bluer_objects_pdf_convert \
|
|
14
|
+
inline,install=$do_install,combine,$2 \
|
|
15
|
+
bluer_objects \
|
|
16
|
+
aliases,aliases/assets.md \
|
|
17
|
+
$object_name \
|
|
18
|
+
"${@:3}"
|
|
19
|
+
|
|
20
|
+
return 0
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function test_bluer_objects_pdf_convert() {
|
|
24
|
+
local options=$1
|
|
25
|
+
|
|
26
|
+
local do_install=1
|
|
27
|
+
[[ "$abcli_is_mac" == true ]] &&
|
|
28
|
+
do_install=0
|
|
29
|
+
|
|
30
|
+
local object_name=test_bluer_objects_pdf_convert-2025-11-30-ci0cd7
|
|
31
|
+
|
|
32
|
+
bluer_ai_eval ,$options \
|
|
33
|
+
bluer_objects_pdf_convert \
|
|
34
|
+
install=$do_install,combine,$2 \
|
|
35
|
+
$object_name \
|
|
36
|
+
"${@:3}"
|
|
37
|
+
|
|
38
|
+
return 0
|
|
39
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function test_bluer_objects_storage_public_upload() {
|
|
4
|
+
local options=$1
|
|
5
|
+
|
|
6
|
+
local object_name=test_bluer_objects_storage_public_upload-$(bluer_ai_string_timestamp_short)
|
|
7
|
+
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
|
8
|
+
mkdir -pv $object_path
|
|
9
|
+
|
|
10
|
+
bluer_objects_create_test_asset \
|
|
11
|
+
$object_name \
|
|
12
|
+
--depth 1
|
|
13
|
+
[[ $? -ne 0 ]] && return 1
|
|
14
|
+
bluer_ai_hr
|
|
15
|
+
|
|
16
|
+
bluer_objects_upload \
|
|
17
|
+
public \
|
|
18
|
+
$object_name
|
|
19
|
+
[[ $? -ne 0 ]] && return 1
|
|
20
|
+
bluer_ai_hr
|
|
21
|
+
|
|
22
|
+
bluer_objects_upload \
|
|
23
|
+
public,zip \
|
|
24
|
+
$object_name
|
|
25
|
+
}
|
|
@@ -1,20 +1,23 @@
|
|
|
1
1
|
#! /usr/bin/env bash
|
|
2
2
|
|
|
3
|
-
function
|
|
3
|
+
function test_bluer_objects_storage_upload_download() {
|
|
4
4
|
local options=$1
|
|
5
5
|
|
|
6
|
-
local object_name=
|
|
6
|
+
local object_name=test_bluer_objects_storage_upload_download-$(bluer_ai_string_timestamp_short)
|
|
7
7
|
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
|
8
8
|
mkdir -pv $object_path
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
--
|
|
10
|
+
bluer_objects_create_test_asset \
|
|
11
|
+
$object_name \
|
|
12
|
+
--depth 1
|
|
13
13
|
[[ $? -ne 0 ]] && return 1
|
|
14
|
+
bluer_ai_hr
|
|
14
15
|
|
|
15
|
-
|
|
16
|
+
bluer_objects_ls local $object_name
|
|
17
|
+
[[ $? -ne 0 ]] && return 1
|
|
16
18
|
bluer_ai_hr
|
|
17
19
|
|
|
20
|
+
# upload
|
|
18
21
|
bluer_objects_upload \
|
|
19
22
|
filename=this.yaml \
|
|
20
23
|
$object_name
|
|
@@ -33,12 +36,15 @@ function test_bluer_objects_storage() {
|
|
|
33
36
|
[[ $? -ne 0 ]] && return 1
|
|
34
37
|
bluer_ai_hr
|
|
35
38
|
|
|
39
|
+
bluer_objects_ls cloud $object_name
|
|
40
|
+
[[ $? -ne 0 ]] && return 1
|
|
41
|
+
bluer_ai_hr
|
|
42
|
+
|
|
36
43
|
# clean-up
|
|
37
44
|
rm -rfv $object_path
|
|
38
45
|
bluer_ai_hr
|
|
39
46
|
|
|
40
|
-
#
|
|
41
|
-
|
|
47
|
+
# download
|
|
42
48
|
bluer_objects_download \
|
|
43
49
|
filename=this.yaml \
|
|
44
50
|
$object_name
|
|
@@ -54,4 +60,16 @@ function test_bluer_objects_storage() {
|
|
|
54
60
|
bluer_objects_download \
|
|
55
61
|
- \
|
|
56
62
|
$object_name
|
|
63
|
+
[[ $? -ne 0 ]] && return 1
|
|
64
|
+
bluer_ai_hr
|
|
65
|
+
|
|
66
|
+
bluer_objects_download \
|
|
67
|
+
policy=doesnt_exist \
|
|
68
|
+
$object_name
|
|
69
|
+
[[ $? -ne 0 ]] && return 1
|
|
70
|
+
bluer_ai_hr
|
|
71
|
+
|
|
72
|
+
bluer_objects_upload \
|
|
73
|
+
zip \
|
|
74
|
+
$object_name
|
|
57
75
|
}
|
bluer_objects/.abcli/upload.sh
CHANGED
|
@@ -3,19 +3,43 @@
|
|
|
3
3
|
function bluer_objects_upload() {
|
|
4
4
|
local options=$1
|
|
5
5
|
local filename=$(bluer_ai_option "$options" filename)
|
|
6
|
+
local public=$(bluer_ai_option_int "$options" public 0)
|
|
7
|
+
local do_zip=$(bluer_ai_option_int "$options" zip 0)
|
|
6
8
|
|
|
7
9
|
local object_name=$(bluer_ai_clarify_object $2 .)
|
|
8
10
|
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
|
9
11
|
|
|
10
12
|
rm -rf $object_path/auxiliary
|
|
11
13
|
|
|
14
|
+
if [[ "$do_zip" == 1 ]]; then
|
|
15
|
+
local zip_filename=$ABCLI_OBJECT_ROOT/$object_name.tar.gz
|
|
16
|
+
|
|
17
|
+
[[ -f "$zip_filename" ]] &&
|
|
18
|
+
rm -v $zip_filename
|
|
19
|
+
|
|
20
|
+
bluer_ai_eval - \
|
|
21
|
+
tar -czvf \
|
|
22
|
+
$zip_filename \
|
|
23
|
+
-C $ABCLI_OBJECT_ROOT $object_name
|
|
24
|
+
[[ $? -ne 0 ]] && return 1
|
|
25
|
+
|
|
26
|
+
python3 -m bluer_objects.storage \
|
|
27
|
+
upload \
|
|
28
|
+
--object_name $object_name \
|
|
29
|
+
--zip 1 \
|
|
30
|
+
--public $public
|
|
31
|
+
|
|
32
|
+
return
|
|
33
|
+
fi
|
|
34
|
+
|
|
12
35
|
python3 -m bluer_objects.storage \
|
|
13
36
|
upload \
|
|
14
37
|
--object_name $object_name \
|
|
15
|
-
--filename "$filename"
|
|
38
|
+
--filename "$filename" \
|
|
39
|
+
--public $public
|
|
16
40
|
[[ $? -ne 0 ]] && return 1
|
|
17
41
|
|
|
18
|
-
if [[ -z "$filename" ]]; then
|
|
42
|
+
if [[ -z "$filename" ]] && [[ "$public" == 0 ]]; then
|
|
19
43
|
bluer_objects_mlflow_log_run $object_name
|
|
20
44
|
fi
|
|
21
45
|
}
|
bluer_objects/README/__init__.py
CHANGED
|
@@ -1,45 +1,30 @@
|
|
|
1
1
|
import os
|
|
2
2
|
|
|
3
|
-
from blueness import module
|
|
4
|
-
|
|
5
3
|
from bluer_options.help.functions import get_help
|
|
6
|
-
|
|
4
|
+
|
|
5
|
+
from bluer_objects import NAME, VERSION, REPO_NAME, ICON
|
|
7
6
|
from bluer_objects import file
|
|
7
|
+
from bluer_objects.README.build.docs import docs
|
|
8
8
|
from bluer_objects.README.functions import build
|
|
9
9
|
from bluer_objects.README.items import Items
|
|
10
10
|
from bluer_objects.help.functions import help_functions
|
|
11
|
-
from bluer_objects.logger import logger
|
|
12
|
-
|
|
13
|
-
MY_NAME = module.name(__file__, MY_NAME)
|
|
14
11
|
|
|
15
12
|
|
|
16
13
|
def build_me() -> bool:
|
|
17
|
-
from bluer_objects import NAME, VERSION, REPO_NAME, ICON
|
|
18
|
-
|
|
19
14
|
return all(
|
|
20
15
|
build(
|
|
21
|
-
|
|
16
|
+
items=readme.get("items", []),
|
|
17
|
+
path=os.path.join(file.path(__file__), readme["path"]),
|
|
22
18
|
ICON=ICON,
|
|
23
19
|
NAME=NAME,
|
|
24
20
|
VERSION=VERSION,
|
|
25
21
|
REPO_NAME=REPO_NAME,
|
|
22
|
+
macros=readme.get("macros", {}),
|
|
26
23
|
help_function=lambda tokens: get_help(
|
|
27
24
|
tokens,
|
|
28
25
|
help_functions,
|
|
29
26
|
mono=True,
|
|
30
27
|
),
|
|
31
28
|
)
|
|
32
|
-
for
|
|
33
|
-
"../..",
|
|
34
|
-
".",
|
|
35
|
-
# aliases
|
|
36
|
-
"../docs/aliases/clone.md",
|
|
37
|
-
"../docs/aliases/download.md",
|
|
38
|
-
"../docs/aliases/gif.md",
|
|
39
|
-
"../docs/aliases/host.md",
|
|
40
|
-
"../docs/aliases/ls.md",
|
|
41
|
-
"../docs/aliases/metadata.md",
|
|
42
|
-
"../docs/aliases/mlflow.md",
|
|
43
|
-
"../docs/aliases/upload.md",
|
|
44
|
-
]
|
|
29
|
+
for readme in docs
|
|
45
30
|
)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
from typing import List
|
|
2
|
+
import importlib
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
|
|
7
|
+
from bluer_ai import NAME as BLUER_AI_NAME
|
|
8
|
+
|
|
9
|
+
from bluer_objects import file
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
def list_of_aliases(
|
|
13
|
+
module_name: str,
|
|
14
|
+
log: bool = False,
|
|
15
|
+
as_markdown: bool = True,
|
|
16
|
+
itemized: bool = False,
|
|
17
|
+
) -> List[str]:
|
|
18
|
+
module = importlib.import_module(module_name)
|
|
19
|
+
module_path = str(Path(module.__file__).parent)
|
|
20
|
+
|
|
21
|
+
alias_sh_path = os.path.join(
|
|
22
|
+
module_path,
|
|
23
|
+
(
|
|
24
|
+
".abcli/plugins/alias.sh"
|
|
25
|
+
if module_name == BLUER_AI_NAME
|
|
26
|
+
else ".abcli/alias.sh"
|
|
27
|
+
),
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
output: List[str] = []
|
|
31
|
+
|
|
32
|
+
success, content = file.load_text(
|
|
33
|
+
alias_sh_path,
|
|
34
|
+
ignore_error=True,
|
|
35
|
+
log=log,
|
|
36
|
+
)
|
|
37
|
+
if not success:
|
|
38
|
+
return output
|
|
39
|
+
|
|
40
|
+
content = (
|
|
41
|
+
lambda content, marker: (
|
|
42
|
+
content[: content.index(marker)] if marker in content else content
|
|
43
|
+
)
|
|
44
|
+
)(content, "# ignore")
|
|
45
|
+
|
|
46
|
+
def extract_alias_name(s: str) -> str:
|
|
47
|
+
m = re.fullmatch(r"alias\s+@([^=]+)=.+", s.strip())
|
|
48
|
+
return m.group(1) if m else ""
|
|
49
|
+
|
|
50
|
+
list_of_aliases = [
|
|
51
|
+
alias_name
|
|
52
|
+
for alias_name in sorted([extract_alias_name(line) for line in content])
|
|
53
|
+
if alias_name not in ["", "."]
|
|
54
|
+
]
|
|
55
|
+
|
|
56
|
+
return [
|
|
57
|
+
(
|
|
58
|
+
(
|
|
59
|
+
f"- [@{alias_name}](./{alias_name}.md)"
|
|
60
|
+
if itemized
|
|
61
|
+
else f"[@{alias_name}](./{module_name}/docs/aliases/{alias_name}.md) "
|
|
62
|
+
)
|
|
63
|
+
if as_markdown
|
|
64
|
+
else alias_name
|
|
65
|
+
)
|
|
66
|
+
for alias_name in list_of_aliases
|
|
67
|
+
]
|
|
File without changes
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from bluer_objects import NAME
|
|
2
|
+
from bluer_objects.README.alias import list_of_aliases
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
docs = [
|
|
6
|
+
{
|
|
7
|
+
"path": "../docs/aliases",
|
|
8
|
+
"macros": {
|
|
9
|
+
"aliases:::": list_of_aliases(
|
|
10
|
+
NAME,
|
|
11
|
+
itemized=True,
|
|
12
|
+
),
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
] + [
|
|
16
|
+
{
|
|
17
|
+
"path": f"../docs/aliases/{alias_name}.md",
|
|
18
|
+
}
|
|
19
|
+
for alias_name in list_of_aliases(
|
|
20
|
+
NAME,
|
|
21
|
+
as_markdown=False,
|
|
22
|
+
)
|
|
23
|
+
]
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
from bluer_objects import NAME
|
|
2
|
+
from bluer_objects.README.build import modules
|
|
3
|
+
from bluer_objects.README.alias import list_of_aliases
|
|
4
|
+
from bluer_objects.README.build import aliases
|
|
5
|
+
|
|
6
|
+
docs = (
|
|
7
|
+
[
|
|
8
|
+
{
|
|
9
|
+
"path": ".",
|
|
10
|
+
},
|
|
11
|
+
{
|
|
12
|
+
"path": "../..",
|
|
13
|
+
"macros": {
|
|
14
|
+
"aliases:::": list_of_aliases(NAME),
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"path": "../docs",
|
|
19
|
+
},
|
|
20
|
+
]
|
|
21
|
+
+ aliases.docs
|
|
22
|
+
+ modules.docs
|
|
23
|
+
)
|