Skip to content

Commit 728a54a

Browse files
Merge pull request #389 from syedriko/syedriko-ols-1836
OLS-1836: BYOK tool issues with the production image
2 parents 41c27d1 + 20b004d commit 728a54a

File tree

4 files changed

+20
-10
lines changed

4 files changed

+20
-10
lines changed

.tekton/lightspeed-rag-tool-pull-request.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ spec:
4040
value: "true"
4141
- name: prefetch-input
4242
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type":
43-
"pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt"]}]'
43+
"pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.cpu.txt"]}]'
4444
pipelineSpec:
4545
description: |
4646
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.

.tekton/lightspeed-rag-tool-push.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ spec:
3737
value: "true"
3838
- name: prefetch-input
3939
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type":
40-
"pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt"]}]'
40+
"pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.cpu.txt"]}]'
4141
pipelineSpec:
4242
description: |
4343
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.

byok/Containerfile.tool

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG BYOK_TOOL_IMAGE=registry.redhat.io/lightspeed-rag-tool-tech-preview/lightspeed-rag-tool-rhel9:latest
1+
ARG BYOK_TOOL_IMAGE=registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest
22
ARG UBI_BASE_IMAGE=registry.access.redhat.com/ubi9/ubi:latest
33
ARG HERMETIC=false
44
FROM ${UBI_BASE_IMAGE}
@@ -8,13 +8,13 @@ ARG VECTOR_DB_INDEX=vector_db_index
88
ARG BYOK_TOOL_IMAGE
99
ARG UBI_BASE_IMAGE
1010
ARG HERMETIC
11-
RUN dnf install -y buildah python3.11 python3.11-pip
11+
RUN dnf install -y buildah python3.11 python3.11-pip && dnf clean all
1212

1313
USER 0
1414
WORKDIR /workdir
1515

16-
COPY requirements.gpu.txt .
17-
RUN pip3.11 install --no-cache-dir --no-deps -r requirements.gpu.txt
16+
COPY requirements.cpu.txt .
17+
RUN pip3.11 install --no-cache-dir --no-deps -r requirements.cpu.txt
1818

1919
COPY embeddings_model ./embeddings_model
2020
ENV HERMETIC=$HERMETIC
@@ -46,8 +46,6 @@ LABEL vendor="Red Hat, Inc."
4646
LABEL version=0.0.1
4747
LABEL summary="Red Hat OpenShift Lightspeed BYO Knowledge Tools"
4848

49-
USER 65532:65532
50-
5149
ENV _BUILDAH_STARTED_IN_USERNS=""
5250
ENV BUILDAH_ISOLATION=chroot
5351
ENV OUT_IMAGE_TAG=$OUT_IMAGE_TAG

byok/README.md

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ for resulting image containing the RAG database.
1313

1414
## These steps will be done during the OLS build:
1515

16-
Use for your experimentation. Once released, MY_BYOK_TOOL_IMAGE will be an image tag under registry.redhat.io/openshift-lightspeed-tech-preview.
16+
Use for your experimentation. Once released, MY_BYOK_TOOL_IMAGE will be registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest.
1717

1818
### Build and push the BYOK tool image.
1919

@@ -23,16 +23,27 @@ $ podman build --build-arg BYOK_TOOL_IMAGE=$MY_BYOK_TOOL_IMAGE -t $MY_BYOK_TOOL_
2323
$ podman push $MY_BYOK_TOOL_IMAGE
2424
```
2525

26-
## This is how the user runs the BYOK tool:
26+
## This is how to run the BYOK tool you built yourself:
2727

2828
```bash
2929
$ MY_BYOK_TOOL_IMAGE=quay.io/$USERNAME/byok_tool:0.0.1
3030
$ podman run -e OUT_IMAGE_TAG=my-byok-image -it --rm --device=/dev/fuse \
31+
-v $XDG_RUNTIME_DIR/containers/auth.json:/run/user/0/containers/auth.json:Z \
3132
-v <dir_tree_with_markdown_files>:/markdown:Z \
3233
-v <dir_for_image_tar>:/output:Z \
3334
$MY_BYOK_TOOL_IMAGE
3435
```
3536

37+
The released version of the tool can be run as follows:
38+
39+
```bash
40+
$ podman run -it --rm --device=/dev/fuse \
41+
-v $XDG_RUNTIME_DIR/containers/auth.json:/run/user/0/containers/auth.json:Z \
42+
-v <dir_tree_with_markdown_files>:/markdown:Z \
43+
-v <dir_for_image_tar>:/output:Z \
44+
registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest
45+
```
46+
3647
The tool runs on CPUs, not GPUs.
3748

3849
There are two mandatory parameters:
@@ -41,6 +52,7 @@ There are two mandatory parameters:
4152
- <dir_for_image_tar> is the directory where the resulting image tar archive will be written. It needs to be writable.
4253

4354
The OUT_IMAGE_TAG environment variable can be used to override the tag of the generated image. It defaults to "byok-image".
55+
The VECTOR_DB_INDEX environment variable can be used to override the database index. It defaults to "vector_db_index".
4456

4557
The BYOK tool will produce the resulting container image as a tar archive named `<dir_for_image_tar>/my-byok-image.tar`. Existing `<dir_for_image_tar>/my-byok-image.tar` will be overwritten.
4658

0 commit comments

Comments
 (0)