Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
49 changes: 47 additions & 2 deletions .tekton/own-app-lightspeed-rag-content-pull-request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,16 @@ spec:
- name: build-source-image
value: "true"
- name: prefetch-input
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type": "pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt"]}]'
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type": "pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt", "requirements.arm64.txt"]}]'
- name: hermetic
value: "true"
- name: build-args
value:
- FLAVOR=gpu
- HERMETIC=true
- REQUIREMENTS_FILE=requirements.gpu.txt
- name: build-image-index
value: "false"
value: "true"
pipelineSpec:
description: |
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down Expand Up @@ -242,6 +243,48 @@ spec:
- name: kind
value: task
resolver: bundles
- name: build-container-arm64
params:
- name: PLATFORM
value: linux/arm64
- name: IMAGE
value: $(params.output-image)-arm64
- name: DOCKERFILE
value: $(params.dockerfile)
- name: CONTEXT
value: $(params.path-context)
- name: HERMETIC
value: $(params.hermetic)
- name: PREFETCH_INPUT
value: $(params.prefetch-input)
- name: IMAGE_EXPIRES_AFTER
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS
value:
- FLAVOR=cpu
- HERMETIC=true
- REQUIREMENTS_FILE=requirements.arm64.txt
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
- name: BUILDAH_FORMAT
value: $(params.buildah-format)
runAfter:
- prefetch-dependencies
taskRef:
params:
- name: name
value: buildah-remote-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.9@sha256:77007259cc87f32d63d2c201226aadaab98313cfd4e02b46abc243c4d2cc27bd
- name: kind
value: task
resolver: bundles
- name: build-image-index
params:
- name: IMAGE
Expand All @@ -251,11 +294,13 @@ spec:
- name: IMAGES
value:
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
- $(tasks.build-container-arm64.results.IMAGE_URL)@$(tasks.build-container-arm64.results.IMAGE_DIGEST)
- name: BUILDAH_FORMAT
value: $(params.buildah-format)
retries: 5
runAfter:
- build-container
- build-container-arm64
taskRef:
params:
- name: name
Expand Down
49 changes: 47 additions & 2 deletions .tekton/own-app-lightspeed-rag-content-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@ spec:
- name: build-source-image
value: "true"
- name: prefetch-input
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type": "pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt"]}]'
value: '[{"type": "generic", "path": "."}, {"type": "rpm", "path": "."}, {"type": "pip", "path": ".", "allow_binary": "true", "requirements_files": ["requirements.gpu.txt", "requirements.arm64.txt"]}]'
- name: hermetic
value: "true"
- name: build-args
value:
- FLAVOR=gpu
- HERMETIC=true
- REQUIREMENTS_FILE=requirements.gpu.txt
- name: build-image-index
value: "false"
value: "true"
pipelineSpec:
description: |
This pipeline is ideal for building container images from a Containerfile while maintaining trust after pipeline customization.
Expand Down Expand Up @@ -239,6 +240,48 @@ spec:
- name: kind
value: task
resolver: bundles
- name: build-container-arm64
params:
- name: PLATFORM
value: linux/arm64
- name: IMAGE
value: $(params.output-image)-arm64
- name: DOCKERFILE
value: $(params.dockerfile)
- name: CONTEXT
value: $(params.path-context)
- name: HERMETIC
value: $(params.hermetic)
- name: PREFETCH_INPUT
value: $(params.prefetch-input)
- name: IMAGE_EXPIRES_AFTER
value: $(params.image-expires-after)
- name: COMMIT_SHA
value: $(tasks.clone-repository.results.commit)
- name: BUILD_ARGS
value:
- FLAVOR=cpu
- HERMETIC=true
- REQUIREMENTS_FILE=requirements.arm64.txt
- name: BUILD_ARGS_FILE
value: $(params.build-args-file)
- name: SOURCE_ARTIFACT
value: $(tasks.prefetch-dependencies.results.SOURCE_ARTIFACT)
- name: CACHI2_ARTIFACT
value: $(tasks.prefetch-dependencies.results.CACHI2_ARTIFACT)
- name: BUILDAH_FORMAT
value: $(params.buildah-format)
runAfter:
- prefetch-dependencies
taskRef:
params:
- name: name
value: buildah-remote-oci-ta
- name: bundle
value: quay.io/konflux-ci/tekton-catalog/task-buildah-remote-oci-ta:0.9@sha256:77007259cc87f32d63d2c201226aadaab98313cfd4e02b46abc243c4d2cc27bd
- name: kind
value: task
resolver: bundles
- name: build-image-index
params:
- name: IMAGE
Expand All @@ -248,11 +291,13 @@ spec:
- name: IMAGES
value:
- $(tasks.build-container.results.IMAGE_URL)@$(tasks.build-container.results.IMAGE_DIGEST)
- $(tasks.build-container-arm64.results.IMAGE_URL)@$(tasks.build-container-arm64.results.IMAGE_DIGEST)
- name: BUILDAH_FORMAT
value: $(params.buildah-format)
retries: 5
runAfter:
- build-container
- build-container-arm64
taskRef:
params:
- name: name
Expand Down
10 changes: 8 additions & 2 deletions Containerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ARG EMBEDDING_MODEL=sentence-transformers/all-mpnet-base-v2
ARG FLAVOR=cpu
ARG HERMETIC=false
ARG REQUIREMENTS_FILE=requirements.gpu.txt

FROM registry.access.redhat.com/ubi9/python-312 as cpu-base
ARG EMBEDDING_MODEL
Expand All @@ -16,12 +17,17 @@ FROM ${FLAVOR}-base as lightspeed-rag-builder
ARG EMBEDDING_MODEL
ARG FLAVOR
ARG HERMETIC
ARG REQUIREMENTS_FILE

USER 0
WORKDIR /workdir

COPY requirements.gpu.txt .
RUN pip3.12 install --no-cache-dir -r requirements.gpu.txt && ln -s /usr/local/lib/python3.12/site-packages/llama_index/core/_static/nltk_cache /root/nltk_data
COPY --from=gpu-base /usr/lib64/openmpi/lib/ /usr/lib64/openmpi/lib/
ENV LD_LIBRARY_PATH=/usr/lib64/openmpi/lib
RUN ldconfig

COPY ${REQUIREMENTS_FILE} ./requirements.txt
RUN pip3.12 install --no-cache-dir -r requirements.txt && ln -s /usr/local/lib/python3.12/site-packages/llama_index/core/_static/nltk_cache /root/nltk_data

COPY ocp-product-docs-plaintext ./ocp-product-docs-plaintext
COPY runbooks ./runbooks
Expand Down
Loading