Spaces:
Sleeping
Sleeping
Commit ·
e58b995
1
Parent(s): 8230b79
re-adding the symlink
Browse files- hf_server.js +1 -4
- omnitool_init.sh +33 -2
hf_server.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
| 3 |
* All rights reserved.
|
| 4 |
*/
|
| 5 |
//@ts-check
|
| 6 |
-
const VERSION = '0.6.0.hf.012.
|
| 7 |
|
| 8 |
const express = require('express');
|
| 9 |
const http = require('http');
|
|
@@ -21,9 +21,6 @@ const PROXY_PORT_OMNITOOL = 4444;
|
|
| 21 |
const CONTAINER_PORT_OMNITOOL = 1688;
|
| 22 |
const OMNITOOL_HEALTH_PING = '/api/v1/mercenaries/ping';
|
| 23 |
const FAVICON = 'https://github.com/omnitool-ai/omnitool/raw/main/packages/omni-ui/omni-web/public/favicon.jpg'
|
| 24 |
-
|
| 25 |
-
//const OMNITOOL_SPACE_NAME = 'omnitool-test-3';
|
| 26 |
-
//const OMNITOOL_SPACE_OWNER = 'manu-sapiens';
|
| 27 |
const OMNITOOL_SPACE_URL = "omnitool-ai-omnitool-on-hf.hf.space";
|
| 28 |
const HF_SPACE_URL = "https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf";
|
| 29 |
const HF_SPACE_DUPLICATE_URL = "https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf?duplicate=true";
|
|
|
|
| 3 |
* All rights reserved.
|
| 4 |
*/
|
| 5 |
//@ts-check
|
| 6 |
+
const VERSION = '0.6.0.hf.012.c';
|
| 7 |
|
| 8 |
const express = require('express');
|
| 9 |
const http = require('http');
|
|
|
|
| 21 |
const CONTAINER_PORT_OMNITOOL = 1688;
|
| 22 |
const OMNITOOL_HEALTH_PING = '/api/v1/mercenaries/ping';
|
| 23 |
const FAVICON = 'https://github.com/omnitool-ai/omnitool/raw/main/packages/omni-ui/omni-web/public/favicon.jpg'
|
|
|
|
|
|
|
|
|
|
| 24 |
const OMNITOOL_SPACE_URL = "omnitool-ai-omnitool-on-hf.hf.space";
|
| 25 |
const HF_SPACE_URL = "https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf";
|
| 26 |
const HF_SPACE_DUPLICATE_URL = "https://huggingface.co/spaces/omnitool-ai/omnitool_on_hf?duplicate=true";
|
omnitool_init.sh
CHANGED
|
@@ -1,11 +1,42 @@
|
|
| 1 |
#!/bin/bash
|
| 2 |
echo "[->] START "
|
| 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 4 |
echo "[->] UPDATE OMNITOOL "
|
| 5 |
cd ./omnitool
|
| 6 |
-
|
| 7 |
output=$(git pull)
|
| 8 |
-
|
| 9 |
if echo "$output" | grep -q "Already up to date."; then
|
| 10 |
echo "The repository is already up to date."
|
| 11 |
else
|
|
|
|
| 1 |
#!/bin/bash
|
| 2 |
echo "[->] START "
|
| 3 |
|
| 4 |
+
|
| 5 |
+
echo "[->] CHECKING EXISTING /DATA "
|
| 6 |
+
if [ -d "/data" ]; then
|
| 7 |
+
echo "$(ls -l /data)"
|
| 8 |
+
|
| 9 |
+
if [ -L "./omnitool/packages/omni-server/data.local" ]; then
|
| 10 |
+
echo "[v] DATA.LOCAL symlink already present "
|
| 11 |
+
else
|
| 12 |
+
if [ -d "./omnitool/packages/omni-server/data.local" ]; then
|
| 13 |
+
echo "[v] DATA.LOCAL already present "
|
| 14 |
+
# hopefully it got copied over through the symlink in the previous run
|
| 15 |
+
rm -rf ./omnitool/packages/omni-server/data.local
|
| 16 |
+
|
| 17 |
+
#mkdir ./omnitool/packages/omni-server/data.local
|
| 18 |
+
#chmod 0777 ./omnitool/packages/omni-server/data.local
|
| 19 |
+
#chown node ./omnitool/packages/omni-server/data.local
|
| 20 |
+
#else
|
| 21 |
+
# echo "[v] Creating DATA.LOCAL "
|
| 22 |
+
# mkdir ./omnitool/packages/omni-server/data.local
|
| 23 |
+
# chmod 0777 ./omnitool/packages/omni-server/data.local
|
| 24 |
+
# chown node ./omnitool/packages/omni-server/data.local
|
| 25 |
+
fi
|
| 26 |
+
|
| 27 |
+
echo "[v] Creating the symlink "
|
| 28 |
+
ln -s /data ./omnitool/packages/omni-server/data.local
|
| 29 |
+
chown node ./omnitool/packages/omni-server/data.local
|
| 30 |
+
fi
|
| 31 |
+
|
| 32 |
+
else
|
| 33 |
+
echo "[v] NO persistent /DATA DETECTED. You can add 20Gig of persistent storage as a paid option to Hugging Face"
|
| 34 |
+
fi
|
| 35 |
+
|
| 36 |
+
|
| 37 |
echo "[->] UPDATE OMNITOOL "
|
| 38 |
cd ./omnitool
|
|
|
|
| 39 |
output=$(git pull)
|
|
|
|
| 40 |
if echo "$output" | grep -q "Already up to date."; then
|
| 41 |
echo "The repository is already up to date."
|
| 42 |
else
|