Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 10 additions & 19 deletions docker/profiles/docker-compose.onnx-override.yml
Original file line number Diff line number Diff line change
@@ -1,29 +1,25 @@
---
# Override file for ONNX-based semantic search in debug quickstart.
# Mounts the host-side model directory into the GMS debug container AND sets the
# semantic-search / ONNX environment directly on the GMS service so that
# semantic-search / ONNX environment on the GMS service so that
# OnnxEmbeddingProvider loads and activates at startup.
#
# The environment MUST live on the service here (not in the Gradle compose
# plugin's process env), because Compose does not inject the plugin's process
# environment into sibling service containers.
# The values live in env/docker/variants/onnx/, added to the service's env_file
# list here (not in the Gradle compose plugin's process env), because Compose
# does not inject the plugin's process environment into sibling service
# containers. ONNX_EMBEDDING_MODEL_DIR stays in environment: it is tied to the
# /datahub/models mount below.
#
# Used automatically by the quickstartDebugBuiltinEmbedding Gradle target.
# Not meant to be activated manually — use:
# ./gradlew quickstartDebugBuiltinEmbedding

services:
datahub-gms-debug:
env_file:
- ../../env/docker/variants/onnx/gms.env

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Compose appends an override file's env_file entries after the base service's list, so this ONNX file now wins over every layer in the base list: env/docker/gms.env, <mode>/all.env, the extension dir and the job dir. That is the reverse of the documented order, where variants sit below the extension and job layers. I confirmed it by rendering with an ad-hoc file that sets one of these keys: the ONNX value wins.

Before this PR the same values sat in the override's environment: block, which also outranks env_file, so an ad-hoc or job file could not override them then either. The change is not a regression. It does mean the new layering doc is wrong for this variant.

Either document that the ONNX variant is last, or add the variant to the base env_file list at its normal position. The same applies to system-update-debug below.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: the override's env_file entries are appended after the service's whole list, so the ONNX variant beats the extension, job and ad-hoc layers. Kept the behaviour and documented it in env/README.md and next to each env_file in the override (fda3c07). Only environment: beats it.

environment:
EMBEDDING_PROVIDER_TYPE: onnx
ELASTICSEARCH_SEMANTIC_SEARCH_ENABLED: "true"
SEARCH_SERVICE_SEMANTIC_SEARCH_ENABLED: "true"
ONNX_EMBEDDING_MODEL_NAME: snowflake_arctic_embed_s
ONNX_EMBEDDING_MODEL_DIR: /datahub/models/snowflake_arctic_embed_s
ELASTICSEARCH_ENTITY_INDEX_SEMANTIC_SEARCH_MODELS_SNOWFLAKE_ARCTIC_EMBED_S_VECTORDIMENSION: "384"
# Arctic-embed is CLS-pooled and expects a query instruction prefix.
ONNX_EMBEDDING_POOLING: cls
ONNX_EMBEDDING_QUERY_INSTRUCTION: "Represent this sentence for searching relevant passages: "
volumes:
- ../datahub-gms-onnx/models:/datahub/models:ro
# Shadow the default (slim) war with the onnx boot archive so the debug stack runs the same
Expand All @@ -37,15 +33,10 @@ services:
# it either skips the semantic index (flags off) or fails to start the
# provider bean (flags on, model missing). It mirrors the GMS service exactly.
system-update-debug:
env_file:
- ../../env/docker/variants/onnx/system-update.env
environment:
EMBEDDING_PROVIDER_TYPE: onnx
ELASTICSEARCH_SEMANTIC_SEARCH_ENABLED: "true"
SEARCH_SERVICE_SEMANTIC_SEARCH_ENABLED: "true"
ONNX_EMBEDDING_MODEL_NAME: snowflake_arctic_embed_s
ONNX_EMBEDDING_MODEL_DIR: /datahub/models/snowflake_arctic_embed_s
ELASTICSEARCH_ENTITY_INDEX_SEMANTIC_SEARCH_MODELS_SNOWFLAKE_ARCTIC_EMBED_S_VECTORDIMENSION: "384"
ONNX_EMBEDDING_POOLING: cls
ONNX_EMBEDDING_QUERY_INSTRUCTION: "Represent this sentence for searching relevant passages: "
volumes:
- ../datahub-gms-onnx/models:/datahub/models:ro
# Shadow the default (slim) jar with the onnx boot archive so system-update embeds via the
Expand Down
3 changes: 2 additions & 1 deletion env/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,8 @@ names are `gms`, `system-update`, `mae-consumer`, `mce-consumer`, `frontend`, `a
1. `env/docker/all.env`, `env/docker/<service>.env`, then the same names in
`env/docker/${DATAHUB_ENV_MODE:-local}/`, then `env/docker/variants/<name>/<service>.env` for the
variants the service belongs to, in this order: datastore (`postgres`, `cassandra`), graph
(`neo4j`), cloud (`localstack`), then `debug`. The service files hold the default stack: MySQL,
(`neo4j`), cloud (`localstack`), `debug`, then `onnx` (added by
`docker-compose.onnx-override.yml` after the service's own list). The service files hold the default stack: MySQL,
the Elasticsearch graph, OpenSearch and Kafka.
2. Extension: `${DATAHUB_ENV_EXTENSION_DIR}/docker/{all,<service>}.env`.
3. Job: `${DATAHUB_ENV_JOB_DIR}/{all,<service>}.env`, then the same names in its
Expand Down
10 changes: 10 additions & 0 deletions env/docker/variants/onnx/gms.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ONNX semantic search for the debug quickstart (quickstartDebugBuiltinEmbedding). Arctic-embed is
# CLS-pooled and expects a query instruction prefix. The model dir stays in the override file's
# environment: it is tied to the /datahub/models mount.
EMBEDDING_PROVIDER_TYPE=onnx
ELASTICSEARCH_SEMANTIC_SEARCH_ENABLED=true
SEARCH_SERVICE_SEMANTIC_SEARCH_ENABLED=true
ONNX_EMBEDDING_MODEL_NAME=snowflake_arctic_embed_s
ELASTICSEARCH_ENTITY_INDEX_SEMANTIC_SEARCH_MODELS_SNOWFLAKE_ARCTIC_EMBED_S_VECTORDIMENSION=384
ONNX_EMBEDDING_POOLING=cls
ONNX_EMBEDDING_QUERY_INSTRUCTION="Represent this sentence for searching relevant passages: "
10 changes: 10 additions & 0 deletions env/docker/variants/onnx/system-update.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# ONNX semantic search for the debug quickstart (quickstartDebugBuiltinEmbedding). Arctic-embed is
# CLS-pooled and expects a query instruction prefix. The model dir stays in the override file's
# environment: it is tied to the /datahub/models mount.
EMBEDDING_PROVIDER_TYPE=onnx
ELASTICSEARCH_SEMANTIC_SEARCH_ENABLED=true
SEARCH_SERVICE_SEMANTIC_SEARCH_ENABLED=true
ONNX_EMBEDDING_MODEL_NAME=snowflake_arctic_embed_s
ELASTICSEARCH_ENTITY_INDEX_SEMANTIC_SEARCH_MODELS_SNOWFLAKE_ARCTIC_EMBED_S_VECTORDIMENSION=384
ONNX_EMBEDDING_POOLING=cls
ONNX_EMBEDDING_QUERY_INSTRUCTION="Represent this sentence for searching relevant passages: "
Loading