Spaces:
Running
Running
File size: 2,143 Bytes
ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 7d9c3d1 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 ec62995 ae1a8b3 eed4912 ec62995 ae1a8b3 ec62995 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 |
#!/bin/bash
echo "[->] START "
echo "[->] UPDATE OMNITOOL "
if [ -d "./omnitool" ]; then
echo "[v] OMNITOOL already present "
cd ./omnitool
git pull
cd ..
chmod 0777 ./omnitool
chown -R node:node ./omnitool
else
echo "[ERROR] OMNITOOL IS MISSING"
git clone https://github.com/omnitool-ai/omnitool.git
chmod 0777 ./omnitool
chown -R node:node ./omnitool
fi
if [ -d "./omnitool/node_modules" ]; then
echo "[v] OMNITOOL NODE_MODULES already present "
else
mkdir -p ./omnitool/node_modules
chmod 0777 ./omnitool/node_modules
chown node ./omnitool/node_modules
echo "[+] Adding OMNITOOL NODE_MODULES"
fi
echo "[->] CHECKING EXISTING /DATA "
if [ -d "/data" ]; then
echo "$(ls -l /data/files)"
if [ -L "./omnitool/packages/omni-server/data.local" ]; then
echo "[v] DATA.LOCAL symlink already present "
else
if [ -d "./omnitool/packages/omni-server/data.local" ]; then
echo "[v] DATA.LOCAL already present "
# hopefully it got copied over through the symlink in the previous run
rm -rf ./omnitool/packages/omni-server/data.local
mkdir ./omnitool/packages/omni-server/data.local
chmod 0777 ./omnitool/packages/omni-server/data.local
chown node ./omnitool/packages/omni-server/data.local
else
echo "[v] Creating DATA.LOCAL "
mkdir ./omnitool/packages/omni-server/data.local
chmod 0777 ./omnitool/packages/omni-server/data.local
chown node ./omnitool/packages/omni-server/data.local
fi
echo "[v] Creating the symlink "
ln -s /data ./omnitool/packages/omni-server/data.local
chown node ./omnitool/packages/omni-server/data.local
fi
else
echo "[v] NO persistent /DATA DETECTED. You can add 20Gig of persistent storage as a paid option to Hugging Face"
fi
cd omnitool
echo "[x] CD OMNITOOL "
echo "[->] YARN INSTALL "
yarn
# maybe that's all that is really needed (to be tested)
chmod -R 0777 .
chown -Rh node .
echo "[v] YARN START "
yarn start -u -rb -R blocks
|