@leverege/build-tools 2.87.2 → 2.88.0
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 +1 -1
- package/src/upload-model.sh +22 -0
package/package.json
CHANGED
|
@@ -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
|