bluer-objects 6.3.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/abcli.sh +9 -0
- bluer_objects/.abcli/actions.sh +11 -0
- bluer_objects/.abcli/aka.sh +3 -0
- bluer_objects/.abcli/alias.sh +36 -0
- bluer_objects/.abcli/blue_objects.sh +11 -0
- bluer_objects/.abcli/cache.sh +5 -0
- bluer_objects/.abcli/clone.sh +94 -0
- bluer_objects/.abcli/download.sh +53 -0
- bluer_objects/.abcli/file.sh +8 -0
- bluer_objects/.abcli/gif.sh +27 -0
- bluer_objects/.abcli/host.sh +29 -0
- bluer_objects/.abcli/ls.sh +24 -0
- bluer_objects/.abcli/metadata/get.sh +24 -0
- bluer_objects/.abcli/metadata/post.sh +22 -0
- bluer_objects/.abcli/metadata.sh +16 -0
- bluer_objects/.abcli/mlflow/browse.sh +36 -0
- bluer_objects/.abcli/mlflow/cache.sh +31 -0
- bluer_objects/.abcli/mlflow/list_registered_models.sh +9 -0
- bluer_objects/.abcli/mlflow/log_artifacts.sh +10 -0
- bluer_objects/.abcli/mlflow/log_run.sh +10 -0
- bluer_objects/.abcli/mlflow/run.sh +11 -0
- bluer_objects/.abcli/mlflow/tags/clone.sh +15 -0
- bluer_objects/.abcli/mlflow/tags/get.sh +10 -0
- bluer_objects/.abcli/mlflow/tags/search.sh +12 -0
- bluer_objects/.abcli/mlflow/tags/set.sh +13 -0
- bluer_objects/.abcli/mlflow/tags.sh +16 -0
- bluer_objects/.abcli/mlflow/test.sh +11 -0
- bluer_objects/.abcli/mlflow/transition.sh +20 -0
- bluer_objects/.abcli/mlflow.sh +29 -0
- bluer_objects/.abcli/mysql/cache.sh +65 -0
- bluer_objects/.abcli/mysql/relations.sh +83 -0
- bluer_objects/.abcli/mysql/tags.sh +85 -0
- bluer_objects/.abcli/mysql.sh +16 -0
- bluer_objects/.abcli/object.sh +54 -0
- bluer_objects/.abcli/publish.sh +58 -0
- bluer_objects/.abcli/select.sh +34 -0
- bluer_objects/.abcli/storage/clear.sh +45 -0
- bluer_objects/.abcli/storage/download_file.sh +9 -0
- bluer_objects/.abcli/storage/exists.sh +8 -0
- bluer_objects/.abcli/storage/list.sh +8 -0
- bluer_objects/.abcli/storage/rm.sh +11 -0
- bluer_objects/.abcli/storage/status.sh +11 -0
- bluer_objects/.abcli/storage.sh +15 -0
- bluer_objects/.abcli/tags.sh +5 -0
- bluer_objects/.abcli/tests/README.sh +8 -0
- bluer_objects/.abcli/tests/clone.sh +32 -0
- bluer_objects/.abcli/tests/help.sh +85 -0
- bluer_objects/.abcli/tests/host.sh +7 -0
- bluer_objects/.abcli/tests/ls.sh +13 -0
- bluer_objects/.abcli/tests/metadata.sh +53 -0
- bluer_objects/.abcli/tests/mlflow_cache.sh +14 -0
- bluer_objects/.abcli/tests/mlflow_logging.sh +12 -0
- bluer_objects/.abcli/tests/mlflow_tags.sh +29 -0
- bluer_objects/.abcli/tests/mlflow_test.sh +7 -0
- bluer_objects/.abcli/tests/mysql_cache.sh +15 -0
- bluer_objects/.abcli/tests/mysql_relations.sh +20 -0
- bluer_objects/.abcli/tests/mysql_tags.sh +16 -0
- bluer_objects/.abcli/tests/test_gif.sh +13 -0
- bluer_objects/.abcli/tests/version.sh +10 -0
- bluer_objects/.abcli/upload.sh +73 -0
- bluer_objects/README/__init__.py +29 -0
- bluer_objects/README/functions.py +285 -0
- bluer_objects/README/items.py +30 -0
- bluer_objects/__init__.py +19 -0
- bluer_objects/__main__.py +16 -0
- bluer_objects/config.env +22 -0
- bluer_objects/env.py +72 -0
- bluer_objects/file/__init__.py +41 -0
- bluer_objects/file/__main__.py +51 -0
- bluer_objects/file/classes.py +38 -0
- bluer_objects/file/functions.py +290 -0
- bluer_objects/file/load.py +219 -0
- bluer_objects/file/save.py +280 -0
- bluer_objects/graphics/__init__.py +4 -0
- bluer_objects/graphics/__main__.py +84 -0
- bluer_objects/graphics/frame.py +15 -0
- bluer_objects/graphics/gif.py +86 -0
- bluer_objects/graphics/screen.py +63 -0
- bluer_objects/graphics/signature.py +97 -0
- bluer_objects/graphics/text.py +165 -0
- bluer_objects/help/__init__.py +0 -0
- bluer_objects/help/__main__.py +10 -0
- bluer_objects/help/functions.py +5 -0
- bluer_objects/host/__init__.py +1 -0
- bluer_objects/host/__main__.py +84 -0
- bluer_objects/host/functions.py +66 -0
- bluer_objects/logger/__init__.py +4 -0
- bluer_objects/logger/matrix.py +209 -0
- bluer_objects/markdown.py +43 -0
- bluer_objects/metadata/__init__.py +8 -0
- bluer_objects/metadata/__main__.py +110 -0
- bluer_objects/metadata/enums.py +29 -0
- bluer_objects/metadata/get.py +89 -0
- bluer_objects/metadata/post.py +101 -0
- bluer_objects/mlflow/__init__.py +28 -0
- bluer_objects/mlflow/__main__.py +271 -0
- bluer_objects/mlflow/cache.py +13 -0
- bluer_objects/mlflow/logging.py +81 -0
- bluer_objects/mlflow/models.py +57 -0
- bluer_objects/mlflow/objects.py +76 -0
- bluer_objects/mlflow/runs.py +100 -0
- bluer_objects/mlflow/tags.py +90 -0
- bluer_objects/mlflow/testing.py +39 -0
- bluer_objects/mysql/cache/__init__.py +8 -0
- bluer_objects/mysql/cache/__main__.py +91 -0
- bluer_objects/mysql/cache/functions.py +181 -0
- bluer_objects/mysql/relations/__init__.py +9 -0
- bluer_objects/mysql/relations/__main__.py +138 -0
- bluer_objects/mysql/relations/functions.py +180 -0
- bluer_objects/mysql/table.py +144 -0
- bluer_objects/mysql/tags/__init__.py +1 -0
- bluer_objects/mysql/tags/__main__.py +130 -0
- bluer_objects/mysql/tags/functions.py +203 -0
- bluer_objects/objects.py +167 -0
- bluer_objects/path.py +194 -0
- bluer_objects/sample.env +16 -0
- bluer_objects/storage/__init__.py +3 -0
- bluer_objects/storage/__main__.py +114 -0
- bluer_objects/storage/classes.py +237 -0
- bluer_objects/tests/__init__.py +0 -0
- bluer_objects/tests/test_README.py +5 -0
- bluer_objects/tests/test_env.py +27 -0
- bluer_objects/tests/test_file_load_save.py +105 -0
- bluer_objects/tests/test_fullname.py +5 -0
- bluer_objects/tests/test_graphics.py +28 -0
- bluer_objects/tests/test_graphics_frame.py +11 -0
- bluer_objects/tests/test_graphics_gif.py +29 -0
- bluer_objects/tests/test_graphics_screen.py +8 -0
- bluer_objects/tests/test_graphics_signature.py +80 -0
- bluer_objects/tests/test_graphics_text.py +14 -0
- bluer_objects/tests/test_logger.py +5 -0
- bluer_objects/tests/test_logger_matrix.py +73 -0
- bluer_objects/tests/test_markdown.py +10 -0
- bluer_objects/tests/test_metadata.py +204 -0
- bluer_objects/tests/test_mlflow.py +60 -0
- bluer_objects/tests/test_mysql_cache.py +14 -0
- bluer_objects/tests/test_mysql_relations.py +16 -0
- bluer_objects/tests/test_mysql_table.py +9 -0
- bluer_objects/tests/test_mysql_tags.py +13 -0
- bluer_objects/tests/test_objects.py +180 -0
- bluer_objects/tests/test_path.py +7 -0
- bluer_objects/tests/test_storage.py +7 -0
- bluer_objects/tests/test_version.py +5 -0
- bluer_objects/urls.py +3 -0
- bluer_objects-6.3.1.dist-info/METADATA +57 -0
- bluer_objects-6.3.1.dist-info/RECORD +149 -0
- bluer_objects-6.3.1.dist-info/WHEEL +5 -0
- bluer_objects-6.3.1.dist-info/licenses/LICENSE +121 -0
- bluer_objects-6.3.1.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
alias @download=abcli_download
|
|
4
|
+
|
|
5
|
+
alias @gif=abcli_gif
|
|
6
|
+
|
|
7
|
+
alias @assets=abcli_assets
|
|
8
|
+
|
|
9
|
+
alias @cache=abcli_cache
|
|
10
|
+
alias @ref="abcli_cache read"
|
|
11
|
+
alias @tags=abcli_tags
|
|
12
|
+
|
|
13
|
+
alias @clone=abcli_clone
|
|
14
|
+
alias @cp=abcli_clone
|
|
15
|
+
|
|
16
|
+
alias @file=bluer_objects_file
|
|
17
|
+
|
|
18
|
+
alias @host=abcli_host
|
|
19
|
+
|
|
20
|
+
alias @ls=abcli_ls
|
|
21
|
+
|
|
22
|
+
alias @metadata=abcli_metadata
|
|
23
|
+
|
|
24
|
+
alias @mlflow=abcli_mlflow
|
|
25
|
+
|
|
26
|
+
alias @mysql=abcli_mysql
|
|
27
|
+
|
|
28
|
+
alias @object=abcli_object
|
|
29
|
+
|
|
30
|
+
alias @objects=bluer_objects
|
|
31
|
+
|
|
32
|
+
alias @publish=abcli_publish
|
|
33
|
+
|
|
34
|
+
alias @select=abcli_select
|
|
35
|
+
|
|
36
|
+
alias @upload=abcli_upload
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_clone() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local do_relate=$(abcli_option_int "$options" relate 1)
|
|
6
|
+
local do_upload=$(abcli_option_int "$options" upload 0)
|
|
7
|
+
|
|
8
|
+
local from_s3=$(abcli_option_int "$options" s3 0)
|
|
9
|
+
if [[ "$from_s3" == 1 ]]; then
|
|
10
|
+
local s3_uri=${2:-void}
|
|
11
|
+
|
|
12
|
+
local object_name=$(abcli_clarify_object $3 .)
|
|
13
|
+
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
|
14
|
+
mkdir -pv $object_path
|
|
15
|
+
|
|
16
|
+
abcli_log "$s3_uri -clone-> $object_name"
|
|
17
|
+
|
|
18
|
+
aws s3 sync \
|
|
19
|
+
"$s3_uri" \
|
|
20
|
+
"$object_path" \
|
|
21
|
+
--exact-timestamps
|
|
22
|
+
[[ $? -ne 0 ]] && return 1
|
|
23
|
+
|
|
24
|
+
[[ "$do_relate" == 1 ]] &&
|
|
25
|
+
abcli_tags set \
|
|
26
|
+
$object_name \
|
|
27
|
+
cloned.$s3_uri
|
|
28
|
+
|
|
29
|
+
[[ "$do_upload" == 1 ]] &&
|
|
30
|
+
abcli_upload - $object_name
|
|
31
|
+
|
|
32
|
+
return 0
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
local clone_tags=$(abcli_option_int "$options" tags 1)
|
|
36
|
+
local copy_content=$(abcli_option_int "$options" content 1)
|
|
37
|
+
local do_download=$(abcli_option_int "$options" download 1)
|
|
38
|
+
local transfer_mechanism=$(abcli_option_choice "$options" cp,mv mv)
|
|
39
|
+
|
|
40
|
+
local object_1_name=$(abcli_clarify_object $2 ..)
|
|
41
|
+
local object_2_name=$(abcli_clarify_object $3 .)
|
|
42
|
+
|
|
43
|
+
abcli_log "$object_1_name -clone:$transfer_mechanism-> $object_2_name"
|
|
44
|
+
|
|
45
|
+
[[ "$do_download" == 1 ]] &&
|
|
46
|
+
abcli_download - $object_1_name
|
|
47
|
+
|
|
48
|
+
local object_1_path=$ABCLI_OBJECT_ROOT/$object_1_name
|
|
49
|
+
local object_2_path=$ABCLI_OBJECT_ROOT/$object_2_name
|
|
50
|
+
|
|
51
|
+
if [[ "$copy_content" == 1 ]]; then
|
|
52
|
+
abcli_eval - \
|
|
53
|
+
rsync \
|
|
54
|
+
-avv \
|
|
55
|
+
$object_1_path/ \
|
|
56
|
+
$object_2_path
|
|
57
|
+
else
|
|
58
|
+
local extension
|
|
59
|
+
for extension in qgz; do
|
|
60
|
+
cp -v \
|
|
61
|
+
$object_1_path/*.$extension \
|
|
62
|
+
$object_2_path
|
|
63
|
+
done
|
|
64
|
+
fi
|
|
65
|
+
|
|
66
|
+
[[ "$clone_tags" == 1 ]] &&
|
|
67
|
+
abcli_tags clone \
|
|
68
|
+
$object_1_name \
|
|
69
|
+
$object_2_name
|
|
70
|
+
|
|
71
|
+
[[ "$do_relate" == 1 ]] &&
|
|
72
|
+
abcli_tags set \
|
|
73
|
+
$object_2_name \
|
|
74
|
+
cloned.$object_1_name
|
|
75
|
+
|
|
76
|
+
pushd $object_2_path >/dev/null
|
|
77
|
+
local filename
|
|
78
|
+
for filename in $object_1_name.*; do
|
|
79
|
+
$transfer_mechanism -v \
|
|
80
|
+
$filename \
|
|
81
|
+
$object_2_path/$object_2_name.${filename##*.}
|
|
82
|
+
done
|
|
83
|
+
popd >/dev/null
|
|
84
|
+
|
|
85
|
+
[[ -f "$object_1_path/metadata.yaml" ]] &&
|
|
86
|
+
cp -v \
|
|
87
|
+
$object_1_path/metadata.yaml \
|
|
88
|
+
$object_2_path/metadata-$object_1_name.yaml
|
|
89
|
+
|
|
90
|
+
[[ "$do_upload" == 1 ]] &&
|
|
91
|
+
abcli_upload - $object_2_name
|
|
92
|
+
|
|
93
|
+
return 0
|
|
94
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_download() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local filename=$(abcli_option "$options" filename)
|
|
6
|
+
|
|
7
|
+
local object_name=$(abcli_clarify_object $2 .)
|
|
8
|
+
local object_path=$ABCLI_OBJECT_ROOT/$object_name
|
|
9
|
+
|
|
10
|
+
local open_options=$3
|
|
11
|
+
|
|
12
|
+
if [ -f "../$object_name.tar.gz" ]; then
|
|
13
|
+
abcli_log "✅ $object_name.tar.gz already exists - skipping download."
|
|
14
|
+
return 1
|
|
15
|
+
fi
|
|
16
|
+
|
|
17
|
+
if [ ! -z "$filename" ]; then
|
|
18
|
+
abcli_log "downloading $object_name/$filename ..."
|
|
19
|
+
aws s3 cp "$ABCLI_S3_OBJECT_PREFIX/$object_name/$filename" "$object_path/$filename"
|
|
20
|
+
else
|
|
21
|
+
local exists=$(aws s3 ls $ABCLI_AWS_S3_BUCKET_NAME/$ABCLI_AWS_S3_PREFIX/$object_name.tar.gz)
|
|
22
|
+
if [ -z "$exists" ]; then
|
|
23
|
+
abcli_log "downloading $object_name ..."
|
|
24
|
+
|
|
25
|
+
aws s3 sync \
|
|
26
|
+
"$ABCLI_S3_OBJECT_PREFIX/$object_name" \
|
|
27
|
+
"$object_path" \
|
|
28
|
+
--exact-timestamps
|
|
29
|
+
else
|
|
30
|
+
abcli_log "downloading $object_name.tar.gz ..."
|
|
31
|
+
|
|
32
|
+
pushd $ABCLI_OBJECT_ROOT >/dev/null
|
|
33
|
+
|
|
34
|
+
aws s3 cp \
|
|
35
|
+
"$ABCLI_S3_OBJECT_PREFIX/$object_name.tar.gz" .
|
|
36
|
+
|
|
37
|
+
local object_size=$(bluer_objects_file size $object_name.tar.gz)
|
|
38
|
+
abcli_log "$object_name.tar.gz ($object_size) downloaded."
|
|
39
|
+
|
|
40
|
+
tar -xvf "$object_name.tar.gz"
|
|
41
|
+
|
|
42
|
+
popd >/dev/null
|
|
43
|
+
fi
|
|
44
|
+
|
|
45
|
+
fi
|
|
46
|
+
|
|
47
|
+
local do_open=$(abcli_option_int "$open_options" open 0)
|
|
48
|
+
[[ "$do_open" == 1 ]] &&
|
|
49
|
+
abcli_open filename=$filename,$open_options \
|
|
50
|
+
$object_name
|
|
51
|
+
|
|
52
|
+
return 0
|
|
53
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_gif() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local do_dryrun=$(abcli_option_int "$options" dryrun 0)
|
|
6
|
+
local do_download=$(abcli_option_int "$options" download $(abcli_not $do_dryrun))
|
|
7
|
+
local do_upload=$(abcli_option_int "$options" upload $(abcli_not $do_dryrun))
|
|
8
|
+
|
|
9
|
+
local object_name=$(abcli_clarify_object $2 .)
|
|
10
|
+
|
|
11
|
+
[[ "$do_download" == 1 ]] &&
|
|
12
|
+
abcli_download - $object_name
|
|
13
|
+
|
|
14
|
+
abcli_log "generating animated gif: $object_name ..."
|
|
15
|
+
|
|
16
|
+
abcli_eval dryrun=$do_dryrun \
|
|
17
|
+
python3 -m bluer_objects.graphics \
|
|
18
|
+
generate_animated_gif \
|
|
19
|
+
--object_name $object_name \
|
|
20
|
+
"${@:3}"
|
|
21
|
+
local status="$?"
|
|
22
|
+
|
|
23
|
+
[[ "$do_upload" == 1 ]] &&
|
|
24
|
+
abcli_upload - $object_name
|
|
25
|
+
|
|
26
|
+
return $status
|
|
27
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_host() {
|
|
4
|
+
local task=$(abcli_unpack_keyword $1 void)
|
|
5
|
+
local options=$2
|
|
6
|
+
|
|
7
|
+
if [ $task == "get" ]; then
|
|
8
|
+
python3 -m blue_options.host \
|
|
9
|
+
get \
|
|
10
|
+
--keyword "$2" \
|
|
11
|
+
"${@:3}"
|
|
12
|
+
return
|
|
13
|
+
fi
|
|
14
|
+
|
|
15
|
+
if [ $task == "reboot" ]; then
|
|
16
|
+
abcli_eval ,$options \
|
|
17
|
+
sudo reboot
|
|
18
|
+
return
|
|
19
|
+
fi
|
|
20
|
+
|
|
21
|
+
if [ $task == "shutdown" ]; then
|
|
22
|
+
abcli_eval ,$options \
|
|
23
|
+
sudo shutdown -h now
|
|
24
|
+
return
|
|
25
|
+
fi
|
|
26
|
+
|
|
27
|
+
abcli_log_error "@host: $task: command not found."
|
|
28
|
+
return 1
|
|
29
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_ls() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local on_cloud=$(abcli_option_int "$options" cloud 0)
|
|
6
|
+
local on_local=$(abcli_option_int "$options" local 0)
|
|
7
|
+
|
|
8
|
+
[[ "$on_cloud" == 1 ]] ||
|
|
9
|
+
[[ "$on_local" == 1 ]] &&
|
|
10
|
+
local object_name=$(abcli_clarify_object $2 .)
|
|
11
|
+
|
|
12
|
+
if [ "$on_cloud" == 1 ]; then
|
|
13
|
+
abcli_eval - \
|
|
14
|
+
aws s3 ls $ABCLI_S3_OBJECT_PREFIX/$object_name/
|
|
15
|
+
elif [ "$on_local" == 1 ]; then
|
|
16
|
+
abcli_eval - \
|
|
17
|
+
ls -1lh $ABCLI_OBJECT_ROOT/$object_name
|
|
18
|
+
else
|
|
19
|
+
abcli_eval - \
|
|
20
|
+
ls -1 "$@"
|
|
21
|
+
fi
|
|
22
|
+
|
|
23
|
+
return 0
|
|
24
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_metadata_get() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local source_type=$(abcli_option_choice "$options" object,path,filename object)
|
|
6
|
+
|
|
7
|
+
local source=$2
|
|
8
|
+
[[ "$source_type" == object ]] &&
|
|
9
|
+
source=$(abcli_clarify_object $2 .)
|
|
10
|
+
|
|
11
|
+
local key=$(abcli_option "$options" key)
|
|
12
|
+
local default=$(abcli_option "$options" default)
|
|
13
|
+
|
|
14
|
+
python3 -m bluer_objects.metadata get \
|
|
15
|
+
--default "$default" \
|
|
16
|
+
--delim $(abcli_option "$options" delim ,) \
|
|
17
|
+
--dict_keys $(abcli_option_int "$options" dict.keys 0) \
|
|
18
|
+
--dict_values $(abcli_option_int "$options" dict.values 0) \
|
|
19
|
+
--filename $(abcli_option "$options" filename metadata.yaml) \
|
|
20
|
+
--key "$key" \
|
|
21
|
+
--source "$source" \
|
|
22
|
+
--source_type $source_type \
|
|
23
|
+
"${@:3}"
|
|
24
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_metadata_post() {
|
|
4
|
+
local key=$1
|
|
5
|
+
|
|
6
|
+
local value=$2
|
|
7
|
+
|
|
8
|
+
local options=$3
|
|
9
|
+
local source_type=$(abcli_option_choice "$options" object,path,filename object)
|
|
10
|
+
|
|
11
|
+
local source=$4
|
|
12
|
+
[[ "$source_type" == object ]] &&
|
|
13
|
+
source=$(abcli_clarify_object $4 .)
|
|
14
|
+
|
|
15
|
+
python3 -m bluer_objects.metadata post \
|
|
16
|
+
--filename $(abcli_option "$options" filename metadata.yaml) \
|
|
17
|
+
--key "$key" \
|
|
18
|
+
--value "$value" \
|
|
19
|
+
--source "$source" \
|
|
20
|
+
--source_type $source_type \
|
|
21
|
+
"${@:5}"
|
|
22
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_metadata() {
|
|
4
|
+
local task=${1:-help}
|
|
5
|
+
|
|
6
|
+
local function_name="abcli_metadata_$task"
|
|
7
|
+
if [[ $(type -t $function_name) == "function" ]]; then
|
|
8
|
+
$function_name "${@:2}"
|
|
9
|
+
return
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
abcli_log_error "@metadata: $task: command not found."
|
|
13
|
+
return 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
abcli_source_caller_suffix_path /metadata
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_mlflow_browse() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local browse_experiment=$(abcli_option_int "$options" experiment 0)
|
|
6
|
+
|
|
7
|
+
local url=$DATABRICKS_HOST/$ABCLI_MLFLOW_URL_SUBDOMAIN
|
|
8
|
+
|
|
9
|
+
if [ $(abcli_option_int "$options" databricks 0) == 1 ]; then
|
|
10
|
+
url="https://accounts.cloud.databricks.com/"
|
|
11
|
+
elif [ $(abcli_option_int "$options" host 0) == 1 ]; then
|
|
12
|
+
: # do nothing
|
|
13
|
+
elif [ $(abcli_option_int "$options" models 0) == 1 ]; then
|
|
14
|
+
url="$url/models"
|
|
15
|
+
else
|
|
16
|
+
local object_name=$(abcli_clarify_object $2 .)
|
|
17
|
+
|
|
18
|
+
local experiment_id=$(abcli_mlflow get_id $object_name)
|
|
19
|
+
if [ -z "$experiment_id" ]; then
|
|
20
|
+
abcli_log_error "@mlflow: browse: $object_name: object not found."
|
|
21
|
+
return 1
|
|
22
|
+
fi
|
|
23
|
+
abcli_log "experiment id: $experiment_id"
|
|
24
|
+
|
|
25
|
+
url="$url/experiments/$experiment_id"
|
|
26
|
+
|
|
27
|
+
if [[ "$browse_experiment" == 0 ]]; then
|
|
28
|
+
local last_run_id=$(abcli_mlflow get_run_id $object_name --count 1)
|
|
29
|
+
abcli_log "last run id: $last_run_id"
|
|
30
|
+
|
|
31
|
+
url="$url/runs/$last_run_id"
|
|
32
|
+
fi
|
|
33
|
+
fi
|
|
34
|
+
|
|
35
|
+
abcli_browse $url
|
|
36
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_mlflow_cache() {
|
|
4
|
+
local task=$(abcli_unpack_keyword $1 help)
|
|
5
|
+
|
|
6
|
+
local keyword=$2
|
|
7
|
+
|
|
8
|
+
if [ "$task" == "read" ]; then
|
|
9
|
+
|
|
10
|
+
abcli_mlflow_tags get \
|
|
11
|
+
$keyword \
|
|
12
|
+
--tag referent \
|
|
13
|
+
"${@:3}"
|
|
14
|
+
|
|
15
|
+
return
|
|
16
|
+
fi
|
|
17
|
+
|
|
18
|
+
if [ "$task" == "write" ]; then
|
|
19
|
+
local value=$3
|
|
20
|
+
|
|
21
|
+
abcli_mlflow_tags set \
|
|
22
|
+
$keyword \
|
|
23
|
+
referent=$value \
|
|
24
|
+
"${@:4}"
|
|
25
|
+
|
|
26
|
+
return
|
|
27
|
+
fi
|
|
28
|
+
|
|
29
|
+
abcli_log_error "@mlflow: cache: $task: command not found."
|
|
30
|
+
return 1
|
|
31
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_mlflow_tags_clone() {
|
|
4
|
+
local source_object=$(abcli_clarify_object $1 ..)
|
|
5
|
+
|
|
6
|
+
local destination_object=$(abcli_clarify_object $2 .)
|
|
7
|
+
|
|
8
|
+
abcli_log "mlflow: tags: clone: $source_object -> $destination_object ..."
|
|
9
|
+
|
|
10
|
+
python3 -m bluer_objects.mlflow \
|
|
11
|
+
clone_tags \
|
|
12
|
+
--destination_object $destination_object \
|
|
13
|
+
--source_object $source_object \
|
|
14
|
+
"${@:3}"
|
|
15
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_mlflow_tags_search() {
|
|
4
|
+
local options=$1
|
|
5
|
+
local is_explicit=$(abcli_option_int "$options" explicit 0)
|
|
6
|
+
|
|
7
|
+
python3 -m bluer_objects.mlflow \
|
|
8
|
+
search \
|
|
9
|
+
--explicit_query $is_explicit \
|
|
10
|
+
--tags "$options" \
|
|
11
|
+
"${@:2}"
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
function abcli_mlflow_tags() {
|
|
4
|
+
local task=$1
|
|
5
|
+
|
|
6
|
+
local function_name=abcli_mlflow_tags_$task
|
|
7
|
+
if [[ $(type -t $function_name) == "function" ]]; then
|
|
8
|
+
$function_name "${@:2}"
|
|
9
|
+
return
|
|
10
|
+
fi
|
|
11
|
+
|
|
12
|
+
abcli_log_error "@mlflow: tags: $task: command not found."
|
|
13
|
+
return 1
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
abcli_source_caller_suffix_path /tags
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
export ABCLI_MLFLOW_STAGES="Staging|Production|Archived"
|
|
4
|
+
|
|
5
|
+
function abcli_mlflow_transition() {
|
|
6
|
+
local options=$1
|
|
7
|
+
local model_name=$(abcli_option "$options" model)
|
|
8
|
+
local stage_name=$(abcli_option_choice "$options" $(echo $ABCLI_MLFLOW_STAGES | tr \| ,) Staging)
|
|
9
|
+
local version=$(abcli_option "$options" version)
|
|
10
|
+
|
|
11
|
+
local description="$2"
|
|
12
|
+
|
|
13
|
+
python3 -m bluer_objects.mlflow \
|
|
14
|
+
transition \
|
|
15
|
+
--model_name "$model_name" \
|
|
16
|
+
--version "$version" \
|
|
17
|
+
--stage_name "$stage_name" \
|
|
18
|
+
--description "$description" \
|
|
19
|
+
"${@:3}"
|
|
20
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
#! /usr/bin/env bash
|
|
2
|
+
|
|
3
|
+
export MLFLOW_TRACKING_URI="databricks"
|
|
4
|
+
|
|
5
|
+
function abcli_mlflow() {
|
|
6
|
+
local task=$(abcli_unpack_keyword $1 help)
|
|
7
|
+
|
|
8
|
+
local function_name=abcli_mlflow_$task
|
|
9
|
+
if [[ $(type -t $function_name) == "function" ]]; then
|
|
10
|
+
$function_name "${@:2}"
|
|
11
|
+
return
|
|
12
|
+
fi
|
|
13
|
+
|
|
14
|
+
if [[ ",get_id,get_run_id,rm," == *",$task,"* ]]; then
|
|
15
|
+
local object_name=$(abcli_clarify_object $2 .)
|
|
16
|
+
|
|
17
|
+
python3 -m bluer_objects.mlflow \
|
|
18
|
+
$task \
|
|
19
|
+
--object_name $object_name \
|
|
20
|
+
"${@:3}"
|
|
21
|
+
|
|
22
|
+
return
|
|
23
|
+
fi
|
|
24
|
+
|
|
25
|
+
abcli_log_error "@mlflow: $task: command not found."
|
|
26
|
+
return 1
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
abcli_source_caller_suffix_path /mlflow
|