arozantsev commited on
Commit
db8c698
·
verified ·
1 Parent(s): d8896fb

Deploy simready-assets run 20261020-a3cb7f2-captions (GPU variant)

Browse files
Dockerfile CHANGED
@@ -301,6 +301,8 @@ COPY docker/hf-space/llm_parse_prompt.txt /app/llm_parse_prompt.txt
301
  # reasoning (Triton's default HTTP port 8000 clashes with deepsearch-api's
302
  # own uvicorn; remapped to 8003 here).
303
  COPY docker/hf-space/supervisord-gpu.conf /etc/supervisor/conf.d/hf-space.conf
 
 
304
 
305
  COPY docker/hf-space/nginx.conf.template /etc/nginx/hf-space.conf.template
306
 
 
301
  # reasoning (Triton's default HTTP port 8000 clashes with deepsearch-api's
302
  # own uvicorn; remapped to 8003 here).
303
  COPY docker/hf-space/supervisord-gpu.conf /etc/supervisor/conf.d/hf-space.conf
304
+ # nginx's optional readiness gate (LIBRARY_MEDIA_GATE; see the script's header).
305
+ COPY docker/hf-space/media-gate.sh /usr/local/bin/media-gate.sh
306
 
307
  COPY docker/hf-space/nginx.conf.template /etc/nginx/hf-space.conf.template
308
 
README.md CHANGED
@@ -5,6 +5,7 @@ colorFrom: green
5
  colorTo: blue
6
  sdk: docker
7
  app_port: 7860
 
8
  hardware: a10g-large
9
  ---
10
 
 
5
  colorTo: blue
6
  sdk: docker
7
  app_port: 7860
8
+ startup_duration_timeout: 1h
9
  hardware: a10g-large
10
  ---
11
 
docker/hf-space/media-gate.sh ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/bin/sh
2
+ # Optional readiness gate (2026-10-21): the Space variable LIBRARY_MEDIA_GATE=on keeps nginx (the only port Hugging Face
3
+ # sees) from starting until the library media's lightweight tier is served: every entry's spin, still and web USD
4
+ # viewer (pipeline/library_media.py writes the marker then, or when the media step ends without getting there). Hugging
5
+ # Face keeps the previous container serving until the new one answers, so a deploy then never shows a Space without
6
+ # media; a cold start (restart, wake-up, hardware change) serves nothing until the gate opens. Never longer than
7
+ # LIBRARY_MEDIA_GATE_TIMEOUT seconds (default 1800; the Space's startup_duration_timeout is 1h). Unset / off: no wait.
8
+ case "$(printf '%s' "${LIBRARY_MEDIA_GATE:-}" | tr '[:upper:]' '[:lower:]')" in
9
+ on|true|1|yes) ;;
10
+ *) exit 0 ;;
11
+ esac
12
+ marker="${LIBRARY_MEDIA_GATE_MARKER:-/tmp/library-media-tier1.done}"
13
+ max="${LIBRARY_MEDIA_GATE_TIMEOUT:-1800}"
14
+ step="${LIBRARY_MEDIA_GATE_POLL:-5}"
15
+ waited=0
16
+ echo "media-gate: LIBRARY_MEDIA_GATE on: nginx waits for every spin, still and viewer (at most ${max} s)" >&2
17
+ while [ ! -f "$marker" ] && [ "$waited" -lt "$max" ]; do
18
+ sleep "$step"
19
+ waited=$((waited + step))
20
+ done
21
+ if [ -f "$marker" ]; then
22
+ echo "media-gate: open after ${waited} s ($(cat "$marker" 2>/dev/null))" >&2
23
+ else
24
+ echo "media-gate: open after ${waited} s: LIBRARY_MEDIA_GATE_TIMEOUT reached, media still loading" >&2
25
+ fi
26
+ exit 0
docker/hf-space/supervisord-gpu.conf CHANGED
@@ -249,7 +249,7 @@ stderr_logfile_maxbytes=0
249
  ; upstream skips a process that doesn't answer) and renders the upstream from the same list. Never put
250
  ; a space before a ";" or "#" in a command: supervisord reads it as an inline
251
  ; comment and cuts the command there (2026-10-15: nginx FATAL on prod).
252
- command=/bin/sh -c "n=${DEEPSEARCH_API_PROCESSES:-1}; ports=; ups=; i=1; while [ $i -le $n ]; do ports=\"$ports $((8100+i))\"; ups=\"$ups server 127.0.0.1:$((8100+i));\"; i=$((i+1)); done; t=0; until curl -sf http://localhost:8010/docs >/dev/null 2>&1 && { (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 || exit 1; done) || { [ $t -ge 90 ] && (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 && exit 0; done; exit 1); }; }; do sleep 2; t=$((t+2)); done; dl=false; case '%(ENV_DOWNLOAD_ENABLED)s' in [Tt]rue|1) if [ -f /app/hf-space-pipeline/.build/restore/hf-storage-api-catalog.yaml ]; then dl=true; else echo 'nginx: no hf-storage-api catalog, rendering download:false' >&2; fi;; esac; vf=glb; case $VIEWER_FORMAT in glb|usd|auto) vf=$VIEWER_FORMAT;; *) [ -z \"$VIEWER_FORMAT\" ] || echo 'nginx: VIEWER_FORMAT is not glb, usd or auto: rendering viewerFormat glb' >&2;; esac; sed -e 's/__PORT__/%(ENV_PORT)s/' -e 's|__CORPUS_NAME__|%(ENV_CORPUS_NAME)s|g' -e 's/__DOWNLOAD_ENABLED__/'$dl'/' -e 's|__SUBMIT_CONTENT_URL__|%(ENV_SUBMIT_CONTENT_URL)s|g' -e 's/__VIEWER_FORMAT__/'$vf'/' -e \"s/__DEEPSEARCH_API_SERVERS__/$ups/\" /etc/nginx/hf-space.conf.template > /etc/nginx/conf.d/hf-space.conf && exec nginx -g 'daemon off;'"
253
  user=root
254
  autorestart=true
255
  startsecs=3
 
249
  ; upstream skips a process that doesn't answer) and renders the upstream from the same list. Never put
250
  ; a space before a ";" or "#" in a command: supervisord reads it as an inline
251
  ; comment and cuts the command there (2026-10-15: nginx FATAL on prod).
252
+ command=/bin/sh -c "sh /usr/local/bin/media-gate.sh; n=${DEEPSEARCH_API_PROCESSES:-1}; ports=; ups=; i=1; while [ $i -le $n ]; do ports=\"$ports $((8100+i))\"; ups=\"$ups server 127.0.0.1:$((8100+i));\"; i=$((i+1)); done; t=0; until curl -sf http://localhost:8010/docs >/dev/null 2>&1 && { (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 || exit 1; done) || { [ $t -ge 90 ] && (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 && exit 0; done; exit 1); }; }; do sleep 2; t=$((t+2)); done; dl=false; case '%(ENV_DOWNLOAD_ENABLED)s' in [Tt]rue|1) if [ -f /app/hf-space-pipeline/.build/restore/hf-storage-api-catalog.yaml ]; then dl=true; else echo 'nginx: no hf-storage-api catalog, rendering download:false' >&2; fi;; esac; vf=glb; case $VIEWER_FORMAT in glb|usd|auto) vf=$VIEWER_FORMAT;; *) [ -z \"$VIEWER_FORMAT\" ] || echo 'nginx: VIEWER_FORMAT is not glb, usd or auto: rendering viewerFormat glb' >&2;; esac; sed -e 's/__PORT__/%(ENV_PORT)s/' -e 's|__CORPUS_NAME__|%(ENV_CORPUS_NAME)s|g' -e 's/__DOWNLOAD_ENABLED__/'$dl'/' -e 's|__SUBMIT_CONTENT_URL__|%(ENV_SUBMIT_CONTENT_URL)s|g' -e 's/__VIEWER_FORMAT__/'$vf'/' -e \"s/__DEEPSEARCH_API_SERVERS__/$ups/\" /etc/nginx/hf-space.conf.template > /etc/nginx/conf.d/hf-space.conf && exec nginx -g 'daemon off;'"
253
  user=root
254
  autorestart=true
255
  startsecs=3
docker/hf-space/supervisord.conf CHANGED
@@ -250,7 +250,7 @@ stderr_logfile_maxbytes=0
250
  ; reads " ;" and " #" as the start of an inline comment and cuts the command
251
  ; there (2026-10-15: a " ;;" case arm left nginx FATAL, "No closing
252
  ; quotation"). tests/test_hf_space_runtime.py parses with supervisor itself.
253
- command=/bin/sh -c "n=${DEEPSEARCH_API_PROCESSES:-1}; ports=; ups=; i=1; while [ $i -le $n ]; do ports=\"$ports $((8100+i))\"; ups=\"$ups server 127.0.0.1:$((8100+i));\"; i=$((i+1)); done; t=0; until curl -sf http://localhost:8010/docs >/dev/null 2>&1 && { (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 || exit 1; done) || { [ $t -ge 90 ] && (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 && exit 0; done; exit 1); }; }; do sleep 2; t=$((t+2)); done; dl=false; case '%(ENV_DOWNLOAD_ENABLED)s' in [Tt]rue|1) if [ -f /app/hf-space-pipeline/.build/restore/hf-storage-api-catalog.yaml ]; then dl=true; else echo 'nginx: no hf-storage-api catalog, rendering download:false' >&2; fi;; esac; vf=glb; case $VIEWER_FORMAT in glb|usd|auto) vf=$VIEWER_FORMAT;; *) [ -z \"$VIEWER_FORMAT\" ] || echo 'nginx: VIEWER_FORMAT is not glb, usd or auto: rendering viewerFormat glb' >&2;; esac; sed -e 's/__PORT__/%(ENV_PORT)s/' -e 's|__CORPUS_NAME__|%(ENV_CORPUS_NAME)s|g' -e 's/__DOWNLOAD_ENABLED__/'$dl'/' -e 's|__SUBMIT_CONTENT_URL__|%(ENV_SUBMIT_CONTENT_URL)s|g' -e 's/__VIEWER_FORMAT__/'$vf'/' -e \"s/__DEEPSEARCH_API_SERVERS__/$ups/\" /etc/nginx/hf-space.conf.template > /etc/nginx/conf.d/hf-space.conf && exec nginx -g 'daemon off;'"
254
  user=root
255
  autorestart=true
256
  startsecs=3
 
250
  ; reads " ;" and " #" as the start of an inline comment and cuts the command
251
  ; there (2026-10-15: a " ;;" case arm left nginx FATAL, "No closing
252
  ; quotation"). tests/test_hf_space_runtime.py parses with supervisor itself.
253
+ command=/bin/sh -c "sh /usr/local/bin/media-gate.sh; n=${DEEPSEARCH_API_PROCESSES:-1}; ports=; ups=; i=1; while [ $i -le $n ]; do ports=\"$ports $((8100+i))\"; ups=\"$ups server 127.0.0.1:$((8100+i));\"; i=$((i+1)); done; t=0; until curl -sf http://localhost:8010/docs >/dev/null 2>&1 && { (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 || exit 1; done) || { [ $t -ge 90 ] && (for p in $ports; do curl -sf http://localhost:$p/health >/dev/null 2>&1 && exit 0; done; exit 1); }; }; do sleep 2; t=$((t+2)); done; dl=false; case '%(ENV_DOWNLOAD_ENABLED)s' in [Tt]rue|1) if [ -f /app/hf-space-pipeline/.build/restore/hf-storage-api-catalog.yaml ]; then dl=true; else echo 'nginx: no hf-storage-api catalog, rendering download:false' >&2; fi;; esac; vf=glb; case $VIEWER_FORMAT in glb|usd|auto) vf=$VIEWER_FORMAT;; *) [ -z \"$VIEWER_FORMAT\" ] || echo 'nginx: VIEWER_FORMAT is not glb, usd or auto: rendering viewerFormat glb' >&2;; esac; sed -e 's/__PORT__/%(ENV_PORT)s/' -e 's|__CORPUS_NAME__|%(ENV_CORPUS_NAME)s|g' -e 's/__DOWNLOAD_ENABLED__/'$dl'/' -e 's|__SUBMIT_CONTENT_URL__|%(ENV_SUBMIT_CONTENT_URL)s|g' -e 's/__VIEWER_FORMAT__/'$vf'/' -e \"s/__DEEPSEARCH_API_SERVERS__/$ups/\" /etc/nginx/hf-space.conf.template > /etc/nginx/conf.d/hf-space.conf && exec nginx -g 'daemon off;'"
254
  user=root
255
  autorestart=true
256
  startsecs=3
services/explorer/dist/static/js/main.e1d091ef.js DELETED
The diff for this file is too large to render. See raw diff
 
services/explorer/dist/static/js/main.e1d091ef.js.LICENSE.txt DELETED
@@ -1,39 +0,0 @@
1
- /**
2
- * @license React
3
- * react-dom.production.min.js
4
- *
5
- * Copyright (c) Facebook, Inc. and its affiliates.
6
- *
7
- * This source code is licensed under the MIT license found in the
8
- * LICENSE file in the root directory of this source tree.
9
- */
10
-
11
- /**
12
- * @license React
13
- * react-jsx-runtime.production.min.js
14
- *
15
- * Copyright (c) Facebook, Inc. and its affiliates.
16
- *
17
- * This source code is licensed under the MIT license found in the
18
- * LICENSE file in the root directory of this source tree.
19
- */
20
-
21
- /**
22
- * @license React
23
- * react.production.min.js
24
- *
25
- * Copyright (c) Facebook, Inc. and its affiliates.
26
- *
27
- * This source code is licensed under the MIT license found in the
28
- * LICENSE file in the root directory of this source tree.
29
- */
30
-
31
- /**
32
- * @license React
33
- * scheduler.production.min.js
34
- *
35
- * Copyright (c) Facebook, Inc. and its affiliates.
36
- *
37
- * This source code is licensed under the MIT license found in the
38
- * LICENSE file in the root directory of this source tree.
39
- */