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.
Files changed (170) hide show
  1. bluer_objects/.abcli/abcli.sh +6 -0
  2. bluer_objects/.abcli/alias.sh +13 -6
  3. bluer_objects/.abcli/assets/cd.sh +20 -0
  4. bluer_objects/.abcli/assets/mv.sh +34 -0
  5. bluer_objects/.abcli/assets/publish.sh +40 -0
  6. bluer_objects/.abcli/assets.sh +15 -0
  7. bluer_objects/.abcli/create_test_asset.sh +10 -0
  8. bluer_objects/.abcli/download.sh +3 -1
  9. bluer_objects/.abcli/file.sh +15 -4
  10. bluer_objects/.abcli/gif.sh +18 -0
  11. bluer_objects/.abcli/host.sh +23 -7
  12. bluer_objects/.abcli/ls.sh +19 -8
  13. bluer_objects/.abcli/metadata/download.sh +9 -0
  14. bluer_objects/.abcli/metadata/edit.sh +15 -0
  15. bluer_objects/.abcli/metadata/upload.sh +9 -0
  16. bluer_objects/.abcli/mlflow/browse.sh +2 -0
  17. bluer_objects/.abcli/mlflow/deploy.sh +21 -5
  18. bluer_objects/.abcli/mlflow/lock/lock.sh +11 -0
  19. bluer_objects/.abcli/mlflow/lock/unlock.sh +12 -0
  20. bluer_objects/.abcli/mlflow/lock.sh +15 -0
  21. bluer_objects/.abcli/mlflow/tags/search.sh +1 -5
  22. bluer_objects/.abcli/mlflow.sh +0 -2
  23. bluer_objects/.abcli/pdf/convert.sh +92 -0
  24. bluer_objects/.abcli/pdf.sh +15 -0
  25. bluer_objects/.abcli/storage/clear.sh +2 -0
  26. bluer_objects/.abcli/tests/clone.sh +2 -3
  27. bluer_objects/.abcli/tests/create_test_asset.sh +16 -0
  28. bluer_objects/.abcli/tests/file.sh +64 -0
  29. bluer_objects/.abcli/tests/gif.sh +3 -3
  30. bluer_objects/.abcli/tests/help.sh +23 -7
  31. bluer_objects/.abcli/tests/ls.sh +11 -4
  32. bluer_objects/.abcli/tests/metadata.sh +35 -0
  33. bluer_objects/.abcli/tests/mlflow_lock.sh +30 -0
  34. bluer_objects/.abcli/tests/mlflow_tags.sh +1 -1
  35. bluer_objects/.abcli/tests/open.sh +11 -0
  36. bluer_objects/.abcli/tests/open_gif_open.sh +14 -0
  37. bluer_objects/.abcli/tests/pdf.sh +39 -0
  38. bluer_objects/.abcli/tests/storage_clear.sh +11 -0
  39. bluer_objects/.abcli/tests/storage_public_upload.sh +25 -0
  40. bluer_objects/.abcli/tests/storage_status.sh +12 -0
  41. bluer_objects/.abcli/tests/{storage.sh → storage_upload_download.sh} +26 -8
  42. bluer_objects/.abcli/upload.sh +26 -2
  43. bluer_objects/README/__init__.py +7 -22
  44. bluer_objects/README/alias.py +67 -0
  45. bluer_objects/README/build/__init__.py +0 -0
  46. bluer_objects/README/build/aliases.py +23 -0
  47. bluer_objects/README/build/docs.py +23 -0
  48. bluer_objects/README/build/modules.py +9 -0
  49. bluer_objects/README/consts.py +44 -0
  50. bluer_objects/README/functions.py +154 -204
  51. bluer_objects/README/items.py +78 -6
  52. bluer_objects/README/process/__init__.py +0 -0
  53. bluer_objects/README/process/assets.py +36 -0
  54. bluer_objects/README/process/details.py +20 -0
  55. bluer_objects/README/process/envs.py +23 -0
  56. bluer_objects/README/process/help.py +27 -0
  57. bluer_objects/README/process/include.py +40 -0
  58. bluer_objects/README/process/legacy.py +21 -0
  59. bluer_objects/README/process/mermaid.py +20 -0
  60. bluer_objects/README/process/national_internet.py +55 -0
  61. bluer_objects/README/process/objects.py +32 -0
  62. bluer_objects/README/process/signature.py +35 -0
  63. bluer_objects/README/process/title.py +44 -0
  64. bluer_objects/README/process/variables.py +12 -0
  65. bluer_objects/__init__.py +1 -1
  66. bluer_objects/assets/__init__.py +0 -0
  67. bluer_objects/assets/__main__.py +57 -0
  68. bluer_objects/assets/functions.py +62 -0
  69. bluer_objects/config.env +13 -1
  70. bluer_objects/env.py +27 -1
  71. bluer_objects/file/__main__.py +52 -7
  72. bluer_objects/file/functions.py +21 -4
  73. bluer_objects/file/load.py +2 -9
  74. bluer_objects/file/save.py +17 -24
  75. bluer_objects/graphics/__main__.py +7 -0
  76. bluer_objects/graphics/gif.py +11 -7
  77. bluer_objects/graphics/screen.py +9 -8
  78. bluer_objects/help/assets.py +93 -0
  79. bluer_objects/help/create_test_asset.py +22 -0
  80. bluer_objects/help/download.py +17 -3
  81. bluer_objects/help/file.py +59 -0
  82. bluer_objects/help/functions.py +9 -1
  83. bluer_objects/help/gif.py +25 -0
  84. bluer_objects/help/host.py +6 -4
  85. bluer_objects/help/ls.py +26 -3
  86. bluer_objects/help/metadata.py +51 -0
  87. bluer_objects/help/mlflow/__init__.py +23 -2
  88. bluer_objects/help/mlflow/cache.py +2 -4
  89. bluer_objects/help/mlflow/lock.py +52 -0
  90. bluer_objects/help/mlflow/tags.py +34 -23
  91. bluer_objects/help/pdf.py +67 -0
  92. bluer_objects/help/upload.py +10 -3
  93. bluer_objects/host/functions.py +4 -1
  94. bluer_objects/logger/confusion_matrix.py +76 -0
  95. bluer_objects/logger/image.py +110 -0
  96. bluer_objects/logger/stitch.py +107 -0
  97. bluer_objects/markdown.py +8 -6
  98. bluer_objects/metadata/__init__.py +1 -0
  99. bluer_objects/metadata/flatten.py +27 -0
  100. bluer_objects/mlflow/__init__.py +1 -1
  101. bluer_objects/mlflow/__main__.py +49 -31
  102. bluer_objects/mlflow/lock/__init__.py +1 -0
  103. bluer_objects/mlflow/lock/__main__.py +58 -0
  104. bluer_objects/mlflow/lock/functions.py +121 -0
  105. bluer_objects/mlflow/logging.py +53 -41
  106. bluer_objects/mlflow/models.py +7 -0
  107. bluer_objects/mlflow/objects.py +7 -0
  108. bluer_objects/mlflow/runs.py +10 -1
  109. bluer_objects/mlflow/serverless/__init__.py +3 -0
  110. bluer_objects/mlflow/serverless/api.py +88 -0
  111. bluer_objects/mlflow/serverless/read.py +19 -0
  112. bluer_objects/mlflow/serverless/search.py +35 -0
  113. bluer_objects/mlflow/serverless/write.py +42 -0
  114. bluer_objects/mlflow/tags.py +59 -9
  115. bluer_objects/objects.py +3 -1
  116. bluer_objects/pdf/__init__.py +1 -0
  117. bluer_objects/pdf/__main__.py +78 -0
  118. bluer_objects/pdf/convert/__init__.py +0 -0
  119. bluer_objects/pdf/convert/batch.py +54 -0
  120. bluer_objects/pdf/convert/combination.py +32 -0
  121. bluer_objects/pdf/convert/convert.py +110 -0
  122. bluer_objects/pdf/convert/image.py +53 -0
  123. bluer_objects/pdf/convert/md.py +97 -0
  124. bluer_objects/pdf/convert/missing.py +96 -0
  125. bluer_objects/pdf/convert/pdf.py +37 -0
  126. bluer_objects/sample.env +6 -0
  127. bluer_objects/storage/WebDAV.py +11 -7
  128. bluer_objects/storage/WebDAVrequest.py +360 -0
  129. bluer_objects/storage/WebDAVzip.py +26 -29
  130. bluer_objects/storage/__init__.py +28 -1
  131. bluer_objects/storage/__main__.py +40 -6
  132. bluer_objects/storage/base.py +84 -5
  133. bluer_objects/storage/policies.py +7 -0
  134. bluer_objects/storage/s3.py +367 -0
  135. bluer_objects/testing/__main__.py +6 -0
  136. bluer_objects/tests/test_README_consts.py +71 -0
  137. bluer_objects/tests/test_README_items.py +128 -0
  138. bluer_objects/tests/test_alias.py +33 -0
  139. bluer_objects/tests/test_env.py +42 -7
  140. bluer_objects/tests/test_file_download.py +30 -0
  141. bluer_objects/tests/test_file_load_save.py +1 -2
  142. bluer_objects/tests/test_file_load_save_text.py +46 -0
  143. bluer_objects/tests/test_graphics_gif.py +2 -0
  144. bluer_objects/tests/test_log_image_grid.py +29 -0
  145. bluer_objects/tests/test_logger_confusion_matrix.py +18 -0
  146. bluer_objects/tests/test_logger_matrix.py +2 -2
  147. bluer_objects/tests/test_logger_stitch_images.py +47 -0
  148. bluer_objects/tests/test_metadata.py +12 -6
  149. bluer_objects/tests/test_metadata_flatten.py +109 -0
  150. bluer_objects/tests/test_mlflow.py +114 -5
  151. bluer_objects/tests/test_mlflow_lock.py +26 -0
  152. bluer_objects/tests/test_objects.py +2 -0
  153. bluer_objects/tests/test_shell.py +34 -0
  154. bluer_objects/tests/test_storage.py +8 -21
  155. bluer_objects/tests/test_storage_base.py +39 -0
  156. bluer_objects/tests/test_storage_s3.py +67 -0
  157. bluer_objects/tests/test_storage_webdav_request.py +75 -0
  158. bluer_objects/tests/test_storage_webdav_zip.py +42 -0
  159. bluer_objects/tests/test_web_is_accessible.py +11 -0
  160. {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/METADATA +20 -11
  161. bluer_objects-6.464.1.dist-info/RECORD +228 -0
  162. {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/WHEEL +1 -1
  163. bluer_objects/.abcli/storage/download_file.sh +0 -9
  164. bluer_objects/.abcli/storage/exists.sh +0 -8
  165. bluer_objects/.abcli/storage/list.sh +0 -8
  166. bluer_objects/.abcli/storage/rm.sh +0 -11
  167. bluer_objects/.abcli/tests/mlflow_test.sh +0 -7
  168. bluer_objects-6.104.1.dist-info/RECORD +0 -143
  169. {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/licenses/LICENSE +0 -0
  170. {bluer_objects-6.104.1.dist-info → bluer_objects-6.464.1.dist-info}/top_level.txt +0 -0
@@ -5,5 +5,11 @@ bluer_ai_source_caller_suffix_path /tests
5
5
  bluer_ai_env_dot_load \
6
6
  caller,plugin=bluer_objects,suffix=/../..
7
7
 
8
+ if [[ "$MLFLOW_DEPLOYMENT" == "local" ]]; then
9
+ export MLFLOW_TRACKING_URI=$HOME/mlflow
10
+ else
11
+ export MLFLOW_TRACKING_URI=$MLFLOW_DEPLOYMENT
12
+ fi
13
+
8
14
  bluer_ai_env_dot_load \
9
15
  caller,filename=config.env,suffix=/..
@@ -1,13 +1,14 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
- alias @ai=bluer_ai
3
+ alias @assets=bluer_objects_assets
4
+
5
+ alias @create_test_asset=bluer_objects_create_test_asset
4
6
 
5
7
  alias @download=bluer_objects_download
6
8
 
7
9
  alias @gif=bluer_objects_gif
8
10
 
9
11
  alias @cache=bluer_objects_mlflow_cache
10
- alias @ref="bluer_objects_mlflow_cache read"
11
12
  alias @tags=bluer_objects_mlflow_tags
12
13
 
13
14
  alias @clone=bluer_objects_clone
@@ -19,18 +20,24 @@ alias @host=bluer_objects_host
19
20
 
20
21
  alias @ls=bluer_objects_ls
21
22
 
23
+ alias @lock=bluer_objects_mlflow_lock
24
+
22
25
  alias @metadata=bluer_objects_metadata
23
26
 
24
27
  alias @mlflow=bluer_objects_mlflow
25
28
 
26
- alias @mysql=abcli_mysql
29
+ alias @pdf=bluer_objects_pdf
30
+
31
+ alias @upload=bluer_objects_upload
32
+
33
+ # ignore
34
+ alias @i=bluer_ai
35
+ alias @ai=bluer_ai
27
36
 
28
37
  alias @objects=bluer_objects
29
38
 
30
- alias @random=bluer_ai_string_random
39
+ alias @ref="bluer_objects_mlflow_cache read"
31
40
 
32
41
  alias @select=bluer_ai_select
33
42
 
34
43
  alias @storage=bluer_ai_storage
35
-
36
- alias @upload=bluer_objects_upload
@@ -0,0 +1,20 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_cd() {
4
+ local options=$1
5
+ local do_create=$(bluer_ai_option_int "$options" create 0)
6
+ local volume=$(bluer_ai_option "$options" vol $BLUER_OBJECTS_DEFAULT_ASSETS_VOL)
7
+
8
+ local path=$2
9
+ path=$abcli_path_git/assets$volume/$path
10
+
11
+ if [[ "$do_create" == 1 ]]; then
12
+ mkdir -pv $path
13
+ [[ $? -ne 0 ]] && return 1
14
+ fi
15
+
16
+ cd $path
17
+ [[ $? -ne 0 ]] && return 1
18
+
19
+ bluer_ai_log "🔗 $path"
20
+ }
@@ -0,0 +1,34 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_mv() {
4
+ local options=$1
5
+ local do_create=$(bluer_ai_option_int "$options" create 1)
6
+ local extension=$(bluer_ai_option "$options" extension jpg)
7
+ local volume=$(bluer_ai_option "$options" vol $BLUER_OBJECTS_DEFAULT_ASSETS_VOL)
8
+
9
+ local path=$2
10
+ local full_path=$abcli_path_git/assets$volume/$path/
11
+
12
+ if [[ "$do_create" == 1 ]]; then
13
+ mkdir -pv $full_path
14
+ [[ $? -ne 0 ]] && return 1
15
+ fi
16
+
17
+ bluer_ai_log "Downloads/.$extension -> assets$volume/$path"
18
+
19
+ mv -v \
20
+ $HOME/Downloads/*.$extension \
21
+ $full_path
22
+ [[ $? -ne 0 ]] && return 1
23
+
24
+ local push_options=$3
25
+ local do_push=$(bluer_ai_option_int "$push_options" push 0)
26
+ [[ "$do_push" == 0 ]] &&
27
+ return 0
28
+
29
+ bluer_ai_git \
30
+ assets$volume \
31
+ push \
32
+ "$path += " \
33
+ $push_options
34
+ }
@@ -0,0 +1,40 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets_publish() {
4
+ local options=$1
5
+
6
+ local do_download=$(bluer_ai_option_int "$options" download 0)
7
+
8
+ local do_pull=1
9
+ [[ "$BLUER_AI_WEB_STATUS" != "online" ]] && do_pull=0
10
+ do_pull=$(bluer_ai_option_int "$options" pull $do_pull)
11
+ local do_push=$(bluer_ai_option_int "$options" push 0)
12
+ local extensions=$(bluer_ai_option "$options" extensions png)
13
+
14
+ [[ "$do_pull" == 1 ]] &&
15
+ bluer_ai_git \
16
+ assets \
17
+ pull \
18
+ ~all
19
+
20
+ local object_name=$(bluer_ai_clarify_object $2 .)
21
+
22
+ [[ "$do_download" == 1 ]] &&
23
+ bluer_objects_download - $object_name
24
+
25
+ bluer_ai_eval dryrun=$do_dryrun \
26
+ python3 -m bluer_objects.assets \
27
+ publish \
28
+ --object_name $object_name \
29
+ --extensions $extensions \
30
+ "${@:3}"
31
+ [[ $? -ne 0 ]] && return 1
32
+
33
+ [[ "$do_push" == 1 ]] &&
34
+ bluer_ai_git \
35
+ assets \
36
+ push \
37
+ "$object_name update."
38
+
39
+ return 0
40
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_assets() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_assets_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.assets "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /assets
@@ -0,0 +1,10 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_create_test_asset() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ python3 -m bluer_objects.testing \
7
+ create_test_asset \
8
+ --object_name $object_name \
9
+ "${@:2}"
10
+ }
@@ -3,13 +3,15 @@
3
3
  function bluer_objects_download() {
4
4
  local options=$1
5
5
  local filename=$(bluer_ai_option "$options" filename)
6
+ local policy=$(bluer_ai_option "$options" policy none)
6
7
 
7
8
  local object_name=$(bluer_ai_clarify_object $2 .)
8
9
 
9
10
  python3 -m bluer_objects.storage \
10
11
  download \
11
12
  --object_name $object_name \
12
- --filename "$filename"
13
+ --filename "$filename" \
14
+ --policy $policy
13
15
  [[ $? -ne 0 ]] && return 1
14
16
 
15
17
  local open_options=$3
@@ -1,8 +1,19 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
3
  function bluer_objects_file() {
4
- python3 -m bluer_objects.file \
5
- "$1" \
6
- --filename "$2" \
7
- "${@:3}"
4
+ local options=$1
5
+ local do_sudo=$(bluer_ai_option_int "$options" sudo 0)
6
+
7
+ local task=$2
8
+
9
+ local prefix=""
10
+ [[ "$do_sudo" == 1 ]] &&
11
+ prefix="sudo -E"
12
+
13
+ local filename=$3
14
+
15
+ $prefix $(which python) -m bluer_objects.file \
16
+ "$task" \
17
+ --filename "$filename" \
18
+ "${@:4}"
8
19
  }
@@ -2,6 +2,24 @@
2
2
 
3
3
  function bluer_objects_gif() {
4
4
  local options=$1
5
+ local do_open=$(bluer_ai_option_int "$options" open 0)
6
+ if [[ "$do_open" == 1 ]]; then
7
+ local options=$2
8
+ local do_download=$(bluer_ai_option_int "$options" download 0)
9
+
10
+ local object_name=$(bluer_ai_clarify_object $3 .)
11
+ local filename=$(bluer_ai_option "$options" filename $object_name.gif)
12
+
13
+ [[ "$do_download" == 1 ]] &&
14
+ bluer_objects_download \
15
+ filename=$filename \
16
+ $object_name
17
+
18
+ bluer_ai_browse $ABCLI_OBJECT_ROOT/$object_name/$filename
19
+
20
+ return
21
+ fi
22
+
5
23
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
6
24
  local do_download=$(bluer_ai_option_int "$options" download $(bluer_ai_not $do_dryrun))
7
25
  local do_upload=$(bluer_ai_option_int "$options" upload $(bluer_ai_not $do_dryrun))
@@ -12,15 +12,31 @@ function bluer_objects_host() {
12
12
  return
13
13
  fi
14
14
 
15
- if [ $task == "reboot" ]; then
16
- bluer_ai_eval ,$options \
17
- sudo reboot
18
- return
19
- fi
15
+ if [[ "|reboot|shutdown|" == *"|$task|"* ]]; then
16
+ local command_line
17
+ [[ $task == "reboot" ]] &&
18
+ command_line="sudo reboot"
19
+ [[ $task == "shutdown" ]] &&
20
+ command_line="sudo shutdown -h now"
21
+
22
+ local rpi=$(bluer_ai_option_int "$options" rpi 0)
23
+ if [[ "$rpi" == 1 ]]; then
24
+ local machine_name=$3
25
+ if [[ -z "$machine_name" ]]; then
26
+ bluer_ai_log_error "machine_name not found."
27
+ return 1
28
+ fi
29
+
30
+ ssh \
31
+ pi@$machine_name.local \
32
+ $command_line
33
+
34
+ return
35
+ fi
20
36
 
21
- if [ $task == "shutdown" ]; then
22
37
  bluer_ai_eval ,$options \
23
- sudo shutdown -h now
38
+ $command_line
39
+
24
40
  return
25
41
  fi
26
42
 
@@ -3,16 +3,27 @@
3
3
  function bluer_objects_ls() {
4
4
  local options=$1
5
5
  local where=$(bluer_ai_option_choice "$options" cloud,local)
6
+ local objects=$(bluer_ai_option_int "$options" objects 0)
6
7
 
7
- if [[ -z "$where" ]]; then
8
- ls -1 "$@"
9
- else
10
- local object_name=$(bluer_ai_clarify_object $2 .)
11
-
8
+ if [[ "$objects" == 1 ]]; then
12
9
  python3 -m bluer_objects.storage \
13
- ls \
14
- --object_name $object_name \
10
+ ls_objects \
15
11
  --where $where \
16
- "${@:3}"
12
+ "${@:2}"
13
+
14
+ return
15
+ fi
16
+
17
+ if [[ -z "$where" ]]; then
18
+ ls -1 "$@"
19
+ return
17
20
  fi
21
+
22
+ local object_name=$(bluer_ai_clarify_object $2 .)
23
+
24
+ python3 -m bluer_objects.storage \
25
+ ls \
26
+ --object_name $object_name \
27
+ --where $where \
28
+ "${@:3}"
18
29
  }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_download() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_objects_download \
7
+ filename=metadata.yaml \
8
+ $object_name
9
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_edit() {
4
+ local options=$1
5
+ local do_download=$(bluer_ai_option_int "$options" download 0)
6
+
7
+ local object_name=$(bluer_ai_clarify_object $2 .)
8
+
9
+ if [[ "$do_download" == 1 ]]; then
10
+ bluer_objects_metadata_download \
11
+ $object_name
12
+ fi
13
+
14
+ bluer_ai_code $ABCLI_OBJECT_ROOT/$object_name/metadata.yaml
15
+ }
@@ -0,0 +1,9 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_metadata_upload() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_objects_upload \
7
+ filename=metadata.yaml \
8
+ $object_name
9
+ }
@@ -5,6 +5,8 @@ function bluer_objects_mlflow_browse() {
5
5
  local browse_experiment=$(bluer_ai_option_int "$options" experiment 0)
6
6
 
7
7
  local url=http://localhost:5001/#
8
+ [[ "$MLFLOW_DEPLOYMENT" != "local" ]] &&
9
+ url=$MLFLOW_TRACKING_URI
8
10
 
9
11
  if [ $(bluer_ai_option_int "$options" databricks 0) == 1 ]; then
10
12
  url="https://accounts.cloud.databricks.com/"
@@ -2,14 +2,30 @@
2
2
 
3
3
  function bluer_objects_mlflow_deploy() {
4
4
  local options=$1
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
19
+
20
+ bluer_objects init
21
+ return
22
+ fi
23
+
5
24
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 0)
6
- local do_local=$(bluer_ai_option_int "$options" local 1)
7
25
  local port=$(bluer_ai_option "$options" port 5001)
8
26
 
9
- if [[ "$do_local" == 0 ]]; then
10
- bluer_ai_log_error "only local deployment is supported."
11
- return 1
12
- fi
27
+ [[ "$MLFLOW_DEPLOYMENT" != "local" ]] &&
28
+ bluer_ai_log_warning "MLFLOW_DEPLOYMENT is not local".
13
29
 
14
30
  bluer_ai_badge "🤖"
15
31
 
@@ -0,0 +1,11 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock_lock() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_ai_eval dryrun=$do_dryrun \
7
+ python3 -m bluer_objects.mlflow.lock \
8
+ lock \
9
+ --object_name $object_name \
10
+ "${@:2}"
11
+ }
@@ -0,0 +1,12 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock_unlock() {
4
+ local object_name=$(bluer_ai_clarify_object $1 .)
5
+
6
+ bluer_ai_eval dryrun=$do_dryrun \
7
+ python3 -m bluer_objects.mlflow.lock \
8
+ unlock \
9
+ --object_name $object_name \
10
+ "${@:2}"
11
+
12
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_mlflow_lock() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_mlflow_lock_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 -m bluer_objects.mlflow.lock "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /lock
@@ -1,12 +1,8 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
3
  function bluer_objects_mlflow_tags_search() {
4
- local options=$1
5
- local is_explicit=$(bluer_ai_option_int "$options" explicit 0)
6
-
7
4
  python3 -m bluer_objects.mlflow \
8
5
  search \
9
- --explicit_query $is_explicit \
10
- --tags "$options" \
6
+ --tags "$1" \
11
7
  "${@:2}"
12
8
  }
@@ -1,7 +1,5 @@
1
1
  #! /usr/bin/env bash
2
2
 
3
- export MLFLOW_TRACKING_URI=$HOME/mlflow
4
-
5
3
  function bluer_objects_mlflow() {
6
4
  local task=$1
7
5
 
@@ -0,0 +1,92 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_pdf_convert() {
4
+ local options=$1
5
+ local do_inline=$(bluer_ai_option_int "$options" inline 0)
6
+ local do_install=$(bluer_ai_option_int "$options" install 0)
7
+ local do_combine=$(bluer_ai_option_int "$options" combine 0)
8
+ local do_compress=$(bluer_ai_option_int "$options" compress $do_combine)
9
+ local do_upload=$(bluer_ai_option_int "$options" upload 0)
10
+ local filename=$(bluer_ai_option "$options" filename release.pdf)
11
+
12
+ if [[ "$do_install" == 1 ]]; then
13
+ pip install pypandoc
14
+ pip install PyPDF2
15
+
16
+ if [[ "$abcli_is_mac" == true ]]; then
17
+ brew install pandoc
18
+ brew install wkhtmltopdf
19
+ brew install ghostscript
20
+ fi
21
+ fi
22
+
23
+ if [[ "$do_inline" == 1 ]]; then
24
+ local module_name=${2:-object}
25
+ if alias "$module_name" &>/dev/null; then
26
+ module_name=$(alias "$module_name" | sed -E "s/^alias $module_name='(.*)'$/\1/")
27
+ fi
28
+
29
+ local path_prefix=$(python3 -m $module_name locate)/docs/
30
+
31
+ local suffixes=${3:-metadata}
32
+
33
+ local object_name=$(bluer_ai_clarify_object $4 pdf-$(bluer_ai_string_timestamp))
34
+
35
+ bluer_ai_log "@pdf $module_name/$suffixes -> $object_name ..."
36
+
37
+ bluer_ai_eval dryrun=$do_dryrun \
38
+ python3 -m bluer_objects.pdf \
39
+ convert \
40
+ --path_prefix $path_prefix \
41
+ --object_name $object_name \
42
+ --suffixes $suffixes \
43
+ --combine $do_combine \
44
+ "${@:5}"
45
+ else
46
+ local object_name=$(bluer_ai_clarify_object $2 pdf-$(bluer_ai_string_timestamp))
47
+
48
+ bluer_ai_log "@pdf $object_name ..."
49
+
50
+ bluer_ai_eval dryrun=$do_dryrun \
51
+ python3 -m bluer_objects.pdf \
52
+ convert \
53
+ --object_name $object_name \
54
+ --combine $do_combine \
55
+ --use_metadata 1 \
56
+ "${@:3}"
57
+ fi
58
+ [[ $? -ne 0 ]] && return 1
59
+
60
+ if [[ "$do_compress" == 1 ]]; then
61
+ bluer_ai_log "compressing..."
62
+
63
+ local object_path=$ABCLI_OBJECT_ROOT/$object_name
64
+ mv -v \
65
+ $object_path/$filename \
66
+ $object_path/_$filename
67
+
68
+ gs -sDEVICE=pdfwrite \
69
+ -dCompatibilityLevel=1.4 \
70
+ -dPDFSETTINGS=/ebook \
71
+ -dNOPAUSE \
72
+ -dBATCH \
73
+ -sOutputFile=$object_path/$filename \
74
+ $object_path/_$filename
75
+ [[ $? -ne 0 ]] && return 1
76
+
77
+ rm $object_path/_$filename
78
+ bluer_ai_log "-> $object_path/$filename"
79
+ fi
80
+
81
+ if [[ "$do_upload" == 1 ]]; then
82
+ bluer_objects_upload \
83
+ filename=$filename \
84
+ $object_name
85
+ [[ $? -ne 0 ]] && return 1
86
+
87
+ if [[ "$do_inline" == 0 ]]; then
88
+ bluer_objects_metadata_upload \
89
+ $object_name
90
+ fi
91
+ fi
92
+ }
@@ -0,0 +1,15 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function bluer_objects_pdf() {
4
+ local task=$1
5
+
6
+ local function_name=bluer_objects_pdf_$task
7
+ if [[ $(type -t $function_name) == "function" ]]; then
8
+ $function_name "${@:2}"
9
+ return
10
+ fi
11
+
12
+ python3 bluer_objects.pdf "$@"
13
+ }
14
+
15
+ bluer_ai_source_caller_suffix_path /pdf
@@ -4,11 +4,13 @@ function bluer_ai_storage_clear() {
4
4
  local options=$1
5
5
  local do_cloud=$(bluer_ai_option_int "$options" cloud 0)
6
6
  local do_dryrun=$(bluer_ai_option_int "$options" dryrun 1)
7
+ local do_public=$(bluer_ai_option_int "$options" public 0)
7
8
 
8
9
  if [[ "$do_cloud" == 1 ]]; then
9
10
  python3 -m bluer_objects.storage \
10
11
  clear \
11
12
  --do_dryrun $do_dryrun \
13
+ --public $do_public \
12
14
  "${@:2}"
13
15
  return
14
16
  fi
@@ -5,9 +5,8 @@ function test_bluer_objects_clone() {
5
5
 
6
6
  local source_object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
7
7
 
8
- python3 -m bluer_objects.testing \
9
- create_test_asset \
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
  local object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
@@ -0,0 +1,16 @@
1
+ #! /usr/bin/env bash
2
+
3
+ function test_bluer_objects_create_test_asset() {
4
+ local options=$1
5
+
6
+ local source_object_name=test_bluer_objects_clone-$(bluer_ai_string_timestamp_short)
7
+
8
+ bluer_objects_create_test_asset \
9
+ $source_object_name
10
+ [[ $? -ne 0 ]] && return 1
11
+ bluer_ai_hr
12
+
13
+ bluer_objects_create_test_asset \
14
+ $source_object_name \
15
+ --depth 3
16
+ }