@leverege/build-tools 2.87.2 → 2.88.1

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@leverege/build-tools",
3
- "version": "2.87.2",
3
+ "version": "2.88.1",
4
4
  "description": "A collection of build / support tools for Leverege developers",
5
5
  "main": "index.js",
6
6
  "repository": {
@@ -59,7 +59,8 @@
59
59
  "send-to-slack": "src/send-to-slack.mjs",
60
60
  "snapshot-cnpg": "src/snapshot-cnpg.mjs",
61
61
  "tag-release": "src/tag-release.mjs",
62
- "unleash": "src/unleash.mjs"
62
+ "unleash": "src/unleash.mjs",
63
+ "upload-model": "src/upload_model.sh"
63
64
  },
64
65
  "author": "Leverege Devs",
65
66
  "license": "SEE LICENSE IN LICENSE.md",
@@ -0,0 +1,22 @@
1
+ #!/bin/bash
2
+ #
3
+ # just a simple wrapper round gsutil docker lifter
4
+ #
5
+ SOURCE_MODEL="${1}"
6
+ DESTINATION_MODEL="${2}"
7
+ BUCKET="gs://leverege-registry-ml-models/"
8
+ DEST_URI="${BUCKET}${DESTINATION_MODEL}"
9
+ URL="https://console.cloud.google.com/storage/browser/leverege-registry-ml-models/${DESTINATION_MODEL}"
10
+
11
+ # Check if any objects exist within the destination prefix using a wildcard
12
+ # Redirecting all output (stdout and stderr) to /dev/null to suppress error messages
13
+ gsutil -q ls "${DEST_URI}/*" > /dev/null 2>&1
14
+
15
+ if [ $? -eq 0 ]; then
16
+ echo "Model already exists and contains objects."
17
+ else
18
+ # Objects not found, proceed with upload
19
+ echo "Uploading model to ${DEST_URI}"
20
+ gsutil cp -r ${SOURCE_MODEL} ${DEST_URI}
21
+ open ${URL}
22
+ fi