arozantsev commited on
Commit
764fe7f
·
verified ·
1 Parent(s): 1079f5b

Deploy simready-assets run 20260928-ed4eb73 (GPU variant)

Browse files
Dockerfile CHANGED
@@ -62,11 +62,19 @@
62
  ARG OPENSEARCH_VERSION=3.8.0
63
  ARG NEO4J_VERSION=5.23.0-community
64
  ARG TRITONSERVER_BASE_IMAGE=nvcr.io/nvidia/tritonserver:26.05-py3
 
65
 
66
  FROM opensearchproject/opensearch:${OPENSEARCH_VERSION} AS opensearch-src
67
 
68
  FROM neo4j:${NEO4J_VERSION} AS neo4j-src
69
 
 
 
 
 
 
 
 
70
  FROM ${TRITONSERVER_BASE_IMAGE}
71
 
72
  WORKDIR /workspace
@@ -170,7 +178,7 @@ RUN python3.12 -m venv /app/.venv \
170
  # for the full explanation (identical here; this variant serves the same
171
  # corpus/storage backend, just with a different SigLIP2 backend).
172
  COPY docker/hf-space/hf-storage-api/hf_storage_api /app/hf-storage-api/src/hf_storage_api
173
- COPY docker/hf-space/hf-storage-api/generated /app/hf-storage-api/generated
174
  RUN GRPCIO_VERSION=$(/app/.venv/bin/pip show grpcio | sed -n 's/^Version: //p') \
175
  && env -u PYTHONPATH /app/.venv/bin/pip install --no-cache-dir "grpcio-health-checking==${GRPCIO_VERSION}" \
176
  && chown -R 1000:1000 /app/hf-storage-api
 
62
  ARG OPENSEARCH_VERSION=3.8.0
63
  ARG NEO4J_VERSION=5.23.0-community
64
  ARG TRITONSERVER_BASE_IMAGE=nvcr.io/nvidia/tritonserver:26.05-py3
65
+ ARG PYTHON_IMAGE=python:3.12-bookworm
66
 
67
  FROM opensearchproject/opensearch:${OPENSEARCH_VERSION} AS opensearch-src
68
 
69
  FROM neo4j:${NEO4J_VERSION} AS neo4j-src
70
 
71
+ # hf-storage-api gRPC stubs — see docker/Dockerfile.hf-space's copy of this stage.
72
+ FROM ${PYTHON_IMAGE} AS hf-storage-api-stubs
73
+ COPY docker/hf-space/wheels/constraints.txt /build/constraints.txt
74
+ COPY docker/hf-space/hf-storage-api/schema /build/schema
75
+ COPY docker/hf-space/generate_hf_storage_api_stubs.sh /build/generate_stubs.sh
76
+ RUN bash /build/generate_stubs.sh /build/constraints.txt /build/schema /generated
77
+
78
  FROM ${TRITONSERVER_BASE_IMAGE}
79
 
80
  WORKDIR /workspace
 
178
  # for the full explanation (identical here; this variant serves the same
179
  # corpus/storage backend, just with a different SigLIP2 backend).
180
  COPY docker/hf-space/hf-storage-api/hf_storage_api /app/hf-storage-api/src/hf_storage_api
181
+ COPY --from=hf-storage-api-stubs /generated /app/hf-storage-api/generated
182
  RUN GRPCIO_VERSION=$(/app/.venv/bin/pip show grpcio | sed -n 's/^Version: //p') \
183
  && env -u PYTHONPATH /app/.venv/bin/pip install --no-cache-dir "grpcio-health-checking==${GRPCIO_VERSION}" \
184
  && chown -R 1000:1000 /app/hf-storage-api
docker/hf-space/generate_hf_storage_api_stubs.sh ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ #!/usr/bin/env bash
2
+ # Compiles hf-storage-api's gRPC stubs from the committed schema, at the exact
3
+ # protobuf/grpcio versions the Space's venv installs — run in a throwaway
4
+ # build stage of docker/Dockerfile.hf-space and docker/Dockerfile.hf-space-gpu.
5
+ #
6
+ # Why build-time, not committed: the stubs have to match the venv's protobuf
7
+ # runtime (gencode newer than runtime fails on import), and that runtime is
8
+ # whatever docker/hf-space/wheels/constraints.txt pins. Generating them here
9
+ # from those same pins keeps the two in lockstep automatically; only a schema
10
+ # change in hf-storage-api itself needs scripts/extract_hf_storage_api.sh.
11
+ #
12
+ # Usage: generate_hf_storage_api_stubs.sh <constraints.txt> <schema dir> <output dir>
13
+ # <schema dir> holds all.protoset (a FileDescriptorSet) and proto_files.txt
14
+ # (the top-level .proto names to generate) — both written by
15
+ # scripts/extract_hf_storage_api.sh.
16
+ set -euo pipefail
17
+
18
+ CONSTRAINTS=$1
19
+ SCHEMA=$2
20
+ OUT=$3
21
+
22
+ # Case-insensitive: constraints.txt mixes casing (e.g. PyYAML==...).
23
+ PROTOBUF=$(grep -iE '^protobuf==' "$CONSTRAINTS" | head -1 | cut -d= -f3)
24
+ GRPCIO=$(grep -iE '^grpcio==' "$CONSTRAINTS" | head -1 | cut -d= -f3)
25
+ if [ -z "$PROTOBUF" ] || [ -z "$GRPCIO" ]; then
26
+ echo "FATAL: no protobuf/grpcio pin in $CONSTRAINTS" >&2
27
+ exit 1
28
+ fi
29
+
30
+ # grpcio-tools is released in lockstep with grpcio; pinning it to the grpcio
31
+ # pin keeps its bundled protoc (and so the stamped gencode version) fixed, so
32
+ # a new grpcio-tools release can't start emitting stubs the pinned runtime
33
+ # rejects.
34
+ pip install --quiet --no-cache-dir "grpcio-tools==$GRPCIO" "protobuf==$PROTOBUF"
35
+
36
+ mkdir -p "$OUT"
37
+ # shellcheck disable=SC2046 # one proto path per word, intentionally split
38
+ python -m grpc_tools.protoc \
39
+ --descriptor_set_in="$SCHEMA/all.protoset" \
40
+ --python_out="$OUT" \
41
+ --grpc_python_out="$OUT" \
42
+ --pyi_out="$OUT" \
43
+ $(cat "$SCHEMA/proto_files.txt")
44
+
45
+ # Fail the build here, not at Space startup, if the stubs don't import against
46
+ # the pinned runtime.
47
+ PYTHONDONTWRITEBYTECODE=1 PYTHONPATH="$OUT" python - "$SCHEMA/proto_files.txt" <<'PYEOF'
48
+ import importlib, sys
49
+ names = [l.strip() for l in open(sys.argv[1]) if l.strip()]
50
+ for n in names:
51
+ base = n[:-len(".proto")].replace("/", ".")
52
+ importlib.import_module(base + "_pb2")
53
+ importlib.import_module(base + "_pb2_grpc")
54
+ print(f"generated and imported {len(names)} proto module(s)")
55
+ PYEOF
docker/hf-space/hf-storage-api/SOURCE.txt CHANGED
@@ -1,6 +1,3 @@
1
  # Generated by scripts/extract_hf_storage_api.sh — do not hand-edit.
2
  source_image=nvcr.io/m3sujtetvf5w/usdsearch/hf-storage-api:71b7537
3
- regenerated_against_protobuf=6.33.6
4
- regenerated_against_grpcio_tools=1.80.0
5
- regenerated_from_constraints=docker/hf-space/wheels/constraints.txt
6
- extracted_at=2026-09-29T13:00:16Z
 
1
  # Generated by scripts/extract_hf_storage_api.sh — do not hand-edit.
2
  source_image=nvcr.io/m3sujtetvf5w/usdsearch/hf-storage-api:71b7537
3
+ extracted_at=2026-09-30T07:11:27Z
 
 
 
docker/hf-space/hf-storage-api/schema/all.protoset ADDED
Binary file (30.5 kB). View file
 
docker/hf-space/hf-storage-api/schema/proto_files.txt ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ nvidia/omniverse/notifications/consumer/v1beta/event_consumer.proto
2
+ nvidia/omniverse/storage/capabilities/v1alpha/capabilities.proto
3
+ nvidia/omniverse/storage/capabilities/v1beta/capabilities.proto
4
+ nvidia/omniverse/storage/filefolder/v1alpha/filefolder_service.proto
5
+ nvidia/omniverse/storage/filefolder/v1beta/filefolder_service.proto
6
+ nvidia/omniverse/storage/fileobject/v1alpha/fileobject.proto
7
+ nvidia/omniverse/storage/fileobject/v1alpha/fileobject_service.proto
8
+ nvidia/omniverse/storage/fileobject/v1beta/fileobject.proto
9
+ nvidia/omniverse/storage/fileobject/v1beta/fileobject_service.proto
10
+ nvidia/omniverse/storage/metadata/v1alpha/metadata.proto
11
+ nvidia/omniverse/storage/versioning/v1alpha/versioning.proto
12
+ nvidia/omniverse/storage/versioning/v1beta/versioning.proto