Spaces:
Running
Running
Commit
·
c61a51f
1
Parent(s):
f538031
moving symlink handling to Dockerfile so it can be done as root
Browse files- Dockerfile +15 -3
- hf_server.js +1 -1
- omnitool_init.sh +18 -18
Dockerfile
CHANGED
@@ -3,13 +3,25 @@ FROM node:20.6.1
|
|
3 |
USER node
|
4 |
WORKDIR /app
|
5 |
|
|
|
|
|
|
|
6 |
#RUN chmod 0777 /app
|
7 |
#RUN cd /app
|
8 |
RUN git clone https://github.com/omnitool-ai/omnitool.git
|
9 |
RUN cd omnitool && yarn install
|
10 |
-
|
11 |
-
|
12 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
RUN mkdir -p /app/omnitool/node_modules
|
14 |
RUN chmod 0777 /app
|
15 |
RUN chown -Rh $user:$user /app
|
|
|
3 |
USER node
|
4 |
WORKDIR /app
|
5 |
|
6 |
+
|
7 |
+
|
8 |
+
|
9 |
#RUN chmod 0777 /app
|
10 |
#RUN cd /app
|
11 |
RUN git clone https://github.com/omnitool-ai/omnitool.git
|
12 |
RUN cd omnitool && yarn install
|
13 |
+
|
14 |
+
USER root
|
15 |
+
RUN if [ -d "/data" ]; then \
|
16 |
+
if [ -d "./omnitool/packages/omni-server/data.local" ]; then \
|
17 |
+
rm -rf ./omnitool/packages/omni-server/data.local; \
|
18 |
+
fi && \
|
19 |
+
ln -s /data ./omnitool/packages/omni-server/data.local && \
|
20 |
+
chmod 0777 ./omnitool/packages/omni-server/data.local && \
|
21 |
+
chown node ./omnitool/packages/omni-server/data.local; \
|
22 |
+
fi
|
23 |
+
USER node
|
24 |
+
|
25 |
RUN mkdir -p /app/omnitool/node_modules
|
26 |
RUN chmod 0777 /app
|
27 |
RUN chown -Rh $user:$user /app
|
hf_server.js
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
-
const VERSION = '0.6.0.hf.
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
|
|
3 |
* All rights reserved.
|
4 |
*/
|
5 |
//@ts-check
|
6 |
+
const VERSION = '0.6.0.hf.013.a';
|
7 |
|
8 |
const express = require('express');
|
9 |
const http = require('http');
|
omnitool_init.sh
CHANGED
@@ -1,27 +1,27 @@
|
|
1 |
#!/bin/bash
|
2 |
echo "[->] START "
|
3 |
|
4 |
-
echo "[->] CHECKING EXISTING /DATA "
|
5 |
-
if [ -d "/data" ]; then
|
6 |
-
|
7 |
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
else
|
23 |
-
|
24 |
-
fi
|
25 |
|
26 |
echo "[->] UPDATE OMNITOOL "
|
27 |
cd ./omnitool
|
|
|
1 |
#!/bin/bash
|
2 |
echo "[->] START "
|
3 |
|
4 |
+
# echo "[->] CHECKING EXISTING /DATA "
|
5 |
+
# if [ -d "/data" ]; then
|
6 |
+
# echo "$(ls -l /data)"
|
7 |
|
8 |
+
# if [ -L "./omnitool/packages/omni-server/data.local" ]; then
|
9 |
+
# echo "[v] DATA.LOCAL symlink already present. Removing it."
|
10 |
+
# rm -rf ./omnitool/packages/omni-server/data.local
|
11 |
+
# fi
|
12 |
|
13 |
+
# if [ -d "./omnitool/packages/omni-server/data.local" ]; then
|
14 |
+
# echo "[v] DATA.LOCAL already present "
|
15 |
+
# rm -rf ./omnitool/packages/omni-server/data.local # hopefully it got copied over through the symlink in the previous run
|
16 |
+
# fi
|
17 |
|
18 |
+
# echo "[v] Creating the symlink "
|
19 |
+
# ln -s /data ./omnitool/packages/omni-server/data.local
|
20 |
+
# chmod 0777 ./omnitool/packages/omni-server/data.local
|
21 |
+
# chown node ./omnitool/packages/omni-server/data.local
|
22 |
+
# else
|
23 |
+
# echo "[v] NO persistent /DATA DETECTED. You can add 20Gig of persistent storage as a paid option to Hugging Face"
|
24 |
+
# fi
|
25 |
|
26 |
echo "[->] UPDATE OMNITOOL "
|
27 |
cd ./omnitool
|