Skip to content

Commit fba6e8d

Browse files
authored
AAP-48373: llama-stack: Tidy-up ansible-chatbot-stack once LSC supports required features. (#63)
1 parent b104fce commit fba6e8d

File tree

3 files changed

+10
-10
lines changed

3 files changed

+10
-10
lines changed

Containerfile

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,9 @@ FROM quay.io/lightspeed-core/lightspeed-stack:dev-latest
3434
USER 0
3535

3636
# Re-declaring arguments without a value, inherits the global default one.
37+
ARG APP_ROOT
3738
ARG ANSIBLE_CHATBOT_VERSION
38-
ARG APP_ROOT=/app-root
3939
RUN microdnf install -y --nodocs --setopt=keepcache=0 --setopt=tsflags=nodocs python3.11 jq
40-
WORKDIR /app-root
4140

4241
# PYTHONDONTWRITEBYTECODE 1 : disable the generation of .pyc
4342
# PYTHONUNBUFFERED 1 : force the stdout and stderr streams to be unbuffered
@@ -49,7 +48,7 @@ ENV PYTHONDONTWRITEBYTECODE=1 \
4948
PYTHONIOENCODING=UTF-8 \
5049
LANG=en_US.UTF-8
5150

52-
COPY --from=builder --chown=1001:1001 /app-root /app-root
51+
COPY --from=builder /app-root /app-root
5352

5453
# this directory is checked by ecosystem-cert-preflight-checks task in Konflux
5554
COPY --from=builder /app-root/LICENSE.md /licenses/
@@ -62,6 +61,7 @@ ENV LLAMA_STACK_CONFIG_DIR=/.llama/data
6261
# Data and configuration
6362
RUN mkdir -p /.llama/distributions/ansible-chatbot
6463
RUN mkdir -p /.llama/data/distributions/ansible-chatbot
64+
ADD lightspeed-stack.yaml /.llama/distributions/ansible-chatbot
6565
ADD ansible-chatbot-run.yaml /.llama/distributions/ansible-chatbot
6666
RUN echo -e "\
6767
{\n\

ansible-chatbot-run.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,14 @@ models:
7979
provider_model_id: null
8080
- metadata:
8181
embedding_dimension: 768
82-
model_id: ./embeddings_model
82+
model_id: /.llama/data/distributions/ansible-chatbot/embeddings_model
8383
provider_id: inline_sentence-transformer
8484
model_type: embedding
8585
shields: []
8686
vector_dbs:
8787
- metadata: {}
8888
vector_db_id: "aap-product-docs-2_5"
89-
embedding_model: ./embeddings_model
89+
embedding_model: /.llama/data/distributions/ansible-chatbot/embeddings_model
9090
embedding_dimension: 768
9191
provider_id: "aap_faiss"
9292
datasets: []

entrypoint.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
MOUNTPATH=/.llama/data
33

44
echo "Checking preloaded embedding model..."
5-
if [[ -e ./embeddings_model ]]; then
6-
echo "./embeddings_model already exists."
5+
if [[ -e /.llama/data/distributions/ansible-chatbot/embeddings_model ]]; then
6+
echo "/.llama/data/distributions/ansible-chatbot/embeddings_model already exists."
77
else
88
if [[ ! -d ${MOUNTPATH} ]]; then
99
echo "Volume mount path is not found."
@@ -13,14 +13,14 @@ else
1313
echo "Embedding model is not found on the volume mount path."
1414
exit 1
1515
else
16-
ln -s ${MOUNTPATH}/embeddings_model ./embeddings_model
16+
ln -s ${MOUNTPATH}/embeddings_model /.llama/data/distributions/ansible-chatbot/embeddings_model
1717
if [[ $? != 0 ]]; then
1818
echo "Failed to create symlink ./embeddings_model"
1919
exit 1
2020
fi
21-
echo "Symlink ./embeddings_model has been created."
21+
echo "Symlink /.llama/data/distributions/ansible-chatbot/embeddings_model has been created."
2222
fi
2323
fi
2424
fi
2525

26-
python3.12 src/lightspeed_stack.py --config /.llama/data/lightspeed-stack.yaml
26+
python3.12 /app-root/src/lightspeed_stack.py --config /.llama/distributions/ansible-chatbot/lightspeed-stack.yaml

0 commit comments

Comments
 (0)