《OpenShift 4.x HOL教程汇总》说明本文已经在 OpenShift 4.21 环境中验证文章目录构建自有知识库镜像在 Lightspeed 中使用自有知识库测试验证参考构建自有知识库镜像创建自有知识库的目录和内容。$mkdir~/byokcd~/byok $catdr-drills.mdEOF --- title: ACME Corp disaster recovery drill procedure for OpenShift url: https://wiki.acme.example/openshift/dr-drills --- # ACME Corp disaster recovery drill procedure for OpenShift ACME Corp requires every production OpenShift cluster to complete a disaster recovery (DR) drill once per quarter. Drills are coordinated by the Platform Reliability team and tracked in the ACME-DR Jira project. ## Drill requirements - DR drills must be scheduled at least two weeks in advance through the ACME-DR Jira project. - The drill must simulate the loss of one availability zone by cordoning and draining all nodes in that zone. - etcd backups must be restored to the staging cluster acme-dr-staging and validated by the application teams. - The maximum tolerated recovery time objective (RTO) at ACME Corp is 45 minutes. Drills that exceed 45 minutes must be repeated within 30 days. ## Sign-off After a successful drill, the Platform Reliability team lead records the results in the ACME-DR Jira project and notifies the compliance team via the #acme-compliance Slack channel. Compliance sign-off is mandatory before the next production change window opens. EOF创建 Dockerfile 文件。$catDockerfileEOF FROM registry.redhat.io/openshift-lightspeed-tech-preview/lightspeed-rag-tool-rhel9:latest AS tool USER 0 WORKDIR /workdir COPY *.md /markdown/ RUN python3.12 -m pip install --no-cache-dir \ --index-url https://pypi.org/simple \ --trusted-host pypi.org \ --trusted-host files.pythonhosted.org \ faiss-cpu \ python-frontmatter \ llama-index \ llama-index-embeddings-huggingface \ llama-index-readers-file \ llama-index-vector-stores-faiss RUN python3.12 generate_embeddings_tool.py -i /markdown -emd embeddings_model \ -emn sentence-transformers/all-mpnet-base-v2 -o vector_db -id workshop_index FROM registry.access.redhat.com/ubi9/ubi:1.1.5 COPY --fromtool /workdir/vector_db /rag/vector_d EOF构建镜像然后将其推送到 OpenShift 可以访问的镜像仓库里。$podmanbuild-tttl.sh/rag-workshop:v1.$podmanpush ttl.sh/rag-workshop:v1在 Lightspeed 中使用自有知识库修改 OpenShift Lightspeed 的 OLSConfigs 配置使用自有 RAG 知识库。$ oc patch OLSConfigs cluster-nopenshift-lishtspeed--typejson-p [ { op: add, path: /spec/ols/rag/-, value: { image: ttl.sh/rag-workshop:v1, indexID: , indexPath: /rag/vector_db } } ]确认 lightspeed-app-server 部署更新了 Pod。$ oc get events-nopenshift-lightspeed --field-selectorinvolvedObject.kindDeployment,involvedObject.namelightspeed-app-server LAST SEEN TYPE REASON OBJECT MESSAGE 。。。 8m18s Normal ScalingReplicaSet deployment/lightspeed-app-server Scaled up replicasetlightspeed-app-server-5c78cd678f from0to11m2s Normal ScalingReplicaSet deployment/lightspeed-app-server Scaled down replicasetlightspeed-app-server-7cf95c8bc from1to0测试验证在 OpenShift Lightspeed 中提交一下问题确认返回的答案为自有知识库中的内容。What is the ACME Corp procedurefordisaster recovery drills on OpenShift?参考https://github.com/dialvare/showroom-openshift-lightspeed/blob/main/content/modules/ROOT/pages/module-02b.adochttps://www.redhat.com/en/blog/bring-your-own-knowledge-openshift-lightspeedhttps://interact.redhat.com/share/gOHOHHzfqFlgtM5bMuBZ
阅读完成 · 觉得有帮助?