Spaces:
Sleeping
Sleeping
Commit
·
e9ee5f2
1
Parent(s):
0d3c10c
Patch envs to use /data from HF persistent storage
Browse files- Dockerfile +14 -0
Dockerfile
CHANGED
@@ -15,6 +15,16 @@ RUN apt-get update && \
|
|
15 |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
|
16 |
xz-utils tk-dev libffi-dev liblzma-dev
|
17 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
18 |
USER giskard
|
19 |
|
20 |
ENV PYENV_ROOT="/home/giskard/.pyenv"
|
@@ -43,4 +53,8 @@ COPY --chown=giskard supervisord.conf $GSK_DIST_PATH
|
|
43 |
# Internal workr doesn't download resource, but takes them directly from projects, so no cache
|
44 |
ENV GSK_CACHE_DIR=projects
|
45 |
|
|
|
|
|
|
|
|
|
46 |
EXPOSE 7860
|
|
|
15 |
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
|
16 |
xz-utils tk-dev libffi-dev liblzma-dev
|
17 |
|
18 |
+
# Use HF persistent storage under /data if mounted
|
19 |
+
ENV GISKARD_HF_DATA_DIR=/data/giskard/datadir
|
20 |
+
RUN mkdir -p "${GISKARD_HF_DATA_DIR}" && chown -R giskard "${GISKARD_HF_DATA_DIR}"
|
21 |
+
ENV PGDATA=$GISKARD_HF_DATA_DIR/database
|
22 |
+
|
23 |
+
# Keep the original GSK_HOME for supervisord run files
|
24 |
+
# We can still bring up supervisord in case of the persistent storage not working
|
25 |
+
ENV GSK_RUN=$GSK_HOME
|
26 |
+
RUN mkdir -p "${GSK_RUN}/run" && chown -R giskard "${GSK_RUN}/run"
|
27 |
+
|
28 |
USER giskard
|
29 |
|
30 |
ENV PYENV_ROOT="/home/giskard/.pyenv"
|
|
|
53 |
# Internal workr doesn't download resource, but takes them directly from projects, so no cache
|
54 |
ENV GSK_CACHE_DIR=projects
|
55 |
|
56 |
+
# Redirect to HF persistent storage for Python ($GSK_HOME) and Java ($GISKARD_HOME)
|
57 |
+
ENV GSK_HOME=$GISKARD_HF_DATA_DIR \
|
58 |
+
GISKARD_HOME=$GISKARD_HF_DATA_DIR
|
59 |
+
|
60 |
EXPOSE 7860
|