diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 3a29bf83..dc5760a1 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -41,35 +41,35 @@ jobs: uses: tj-actions/changed-files@v42 with: files: | - rag-langchain/** + recipes/natural_language_processing/rag/** - name: Get changed summarizer files id: changed-files-summarizer uses: tj-actions/changed-files@v42 with: files: | - summarizer-langchain/** + recipes/natural_language_processing/summarizer/** - name: Get changed code-generation files id: changed-files-codegen uses: tj-actions/changed-files@v42 with: files: | - code-generation/** + recipes/natural_language_processing/code-generation/** - name: Get changed chatbot files id: changed-files-chatbot uses: tj-actions/changed-files@v42 with: files: | - chatbot-langchain/** + recipes/natural_language_processing/chatbot/** - name: Get changed chromadb files id: changed-files-chromadb uses: tj-actions/changed-files@v42 with: files: | - rag-langchain/builds/chromadb/** + vector_dbs/chromadb/** - name: Install qemu dependency if: steps.changed-files-model-service.outputs.any_changed == 'true' || steps.changed-files-chatbot.outputs.any_changed == 'true' || steps.changed-files-summarizer.outputs.any_changed == 'true' || steps.changed-files-rag.outputs.any_changed == 'true' || steps.changed-files-codegen.outputs.any_changed == 'true' @@ -119,9 +119,9 @@ jobs: image: ${{ env.CHATBOT_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - context: chatbot-langchain + context: recipes/natural_language_processing/chatbot containerfiles: | - ./chatbot-langchain/builds/Containerfile + recipes/natural_language_processing/chatbot/builds/Containerfile - name: Push chatbot image id: push_chatbot @@ -143,9 +143,9 @@ jobs: image: ${{ env.CODEGEN_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - context: code-generation + context: recipes/natural_language_processing/code-generation containerfiles: | - ./code-generation/builds/Containerfile + ./recipes/natural_language_processing/code-generation/builds/Containerfile - name: Push code-generation image id: push_codegen @@ -167,9 +167,9 @@ jobs: image: ${{ env.SUMMARIZER_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - context: summarizer-langchain + context: recipes/natural_language_processing/summarizer containerfiles: | - ./summarizer-langchain/builds/Containerfile + ./recipes/natural_language_processing/summarizer/builds/Containerfile - name: Push summarizer image id: push_summarizer @@ -192,9 +192,9 @@ jobs: tags: latest ${{ github.sha }} # TODO: add amd64 platforms: linux/arm64 - context: rag-langchain + context: recipes/natural_language_processing/rag containerfiles: | - ./rag-langchain/builds/Containerfile + ./recipes/natural_language_processing/rag/builds/Containerfile - name: Push rag image id: push_rag @@ -217,9 +217,9 @@ jobs: tags: latest ${{ github.sha }} # TODO: add amd64 platforms: linux/arm64, linux/amd64 - context: rag-langchain/builds/chromadb + context: vector_dbs/chromadb containerfiles: | - ./rag-langchain/builds/chromadb/Containerfile + ./vector_dbs/chromadb/Containerfile - name: Push chromadb image id: push_chromadb diff --git a/.github/workflows/chatbot.yaml b/.github/workflows/chatbot.yaml index 66ade83b..38155c15 100644 --- a/.github/workflows/chatbot.yaml +++ b/.github/workflows/chatbot.yaml @@ -38,14 +38,16 @@ jobs: with: image: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: latest - containerfiles: ./chatbot/builds/Containerfile - context: chatbot + containerfiles: ./recipes/natural_language_processing/chatbot/builds/Containerfile + context: recipes/natural_language_processing/chatbot - name: Set up Python uses: actions/setup-python@v5.0.0 - name: Install python dependencies - run: make -f chatbot/Makefile install + working-directory: ./recipes/natural_language_processing/chatbot + run: make install - name: Run tests - run: make -f chatbot/Makefile test + working-directory: ./recipes/natural_language_processing/chatbot + run: make test diff --git a/convert_models/Containerfile b/convert_models/Containerfile index a2e4e02e..ce712757 100644 --- a/convert_models/Containerfile +++ b/convert_models/Containerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:1-158 +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /converter RUN git clone https://github.com/ggerganov/llama.cpp.git RUN cd llama.cpp/ && make diff --git a/finetune/Containerfile b/finetune/Containerfile index 9582c368..eac23b0b 100644 --- a/finetune/Containerfile +++ b/finetune/Containerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:1-158 +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /locallm RUN git clone https://github.com/michaelclifford/llama.cpp.git RUN cd llama.cpp/ && make diff --git a/model_servers/llamacpp_python/base/Makefile b/model_servers/llamacpp_python/base/Makefile index 92a1aad7..e515d3f4 100644 --- a/model_servers/llamacpp_python/base/Makefile +++ b/model_servers/llamacpp_python/base/Makefile @@ -1,13 +1,13 @@ .PHONY: build build: - podman build -f Containerfile -t ghcr.io/ai-lab-recipes/model_servers . + podman build -t ghcr.io/ai-lab-recipes/model_servers . models/llama-2-7b-chat.Q5_K_S.gguf: curl -s -S -L -f https://huggingface.co/TheBloke/Llama-2-7B-Chat-GGUF/resolve/main/llama-2-7b-chat.Q5_K_S.gguf -z $@ -o $@.tmp && mv -f $@.tmp $@ 2>/dev/null || rm -f $@.tmp $@ .PHONY: install install: - pip install -r requirements-test.txt + pip install -r tests/requirements-test.txt .PHONY: run run: models/llama-2-7b-chat.Q5_K_S.gguf install diff --git a/model_servers/llamacpp_python/base/tests/requirements-test.txt b/model_servers/llamacpp_python/base/tests/requirements-test.txt new file mode 120000 index 00000000..0348837e --- /dev/null +++ b/model_servers/llamacpp_python/base/tests/requirements-test.txt @@ -0,0 +1 @@ +../../../../requirements-test.txt \ No newline at end of file diff --git a/model_servers/llamacpp_python/vulkan/Containerfile b/model_servers/llamacpp_python/vulkan/Containerfile index aac1ad1c..9163fc09 100644 --- a/model_servers/llamacpp_python/vulkan/Containerfile +++ b/model_servers/llamacpp_python/vulkan/Containerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 USER 0 RUN dnf install -y python3-dnf-plugin-versionlock && \ dnf copr enable -y slp/mesa-krunkit epel-9-aarch64 && \ diff --git a/recipes/audio/audio-to-text/builds/Containerfile b/recipes/audio/audio-to-text/builds/Containerfile index 57bd366f..6bc79942 100644 --- a/recipes/audio/audio-to-text/builds/Containerfile +++ b/recipes/audio/audio-to-text/builds/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /locallm COPY requirements.txt /locallm/requirements.txt RUN pip install --upgrade pip && \ pip install --no-cache-dir --upgrade -r requirements.txt COPY whisper_client.py whisper_client.py EXPOSE 8501 -ENTRYPOINT [ "streamlit", "run", "whisper_client.py" ] \ No newline at end of file +ENTRYPOINT [ "streamlit", "run", "whisper_client.py" ] diff --git a/recipes/computer_vision/object_detection/client/Containerfile b/recipes/computer_vision/object_detection/client/Containerfile index a3602cf7..116fc847 100644 --- a/recipes/computer_vision/object_detection/client/Containerfile +++ b/recipes/computer_vision/object_detection/client/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /locallm COPY requirements.txt /locallm/requirements.txt RUN pip install --upgrade pip && \ pip install --no-cache-dir --upgrade -r requirements.txt COPY object_detection_client.py object_detection_client.py EXPOSE 8501 -ENTRYPOINT [ "streamlit", "run", "object_detection_client.py" ] \ No newline at end of file +ENTRYPOINT [ "streamlit", "run", "object_detection_client.py" ] diff --git a/recipes/computer_vision/object_detection/model_server/Containerfile b/recipes/computer_vision/object_detection/model_server/Containerfile index 982f1288..d7b57353 100644 --- a/recipes/computer_vision/object_detection/model_server/Containerfile +++ b/recipes/computer_vision/object_detection/model_server/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /locallm COPY requirements.txt /locallm/requirements.txt RUN pip install --upgrade pip && \ pip install --no-cache-dir --upgrade -r requirements.txt COPY object_detection_server.py object_detection_server.py EXPOSE 8000 -ENTRYPOINT [ "uvicorn", "object_detection_server:app", "--host", "0.0.0.0" ] \ No newline at end of file +ENTRYPOINT [ "uvicorn", "object_detection_server:app", "--host", "0.0.0.0" ] diff --git a/recipes/multimodal/image_understanding/builds/Containerfile b/recipes/multimodal/image_understanding/builds/Containerfile index bd9d6b23..c69cb307 100644 --- a/recipes/multimodal/image_understanding/builds/Containerfile +++ b/recipes/multimodal/image_understanding/builds/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /image_understanding COPY builds/requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir --upgrade -r requirements.txt COPY image_understanding.py . EXPOSE 8501 -ENTRYPOINT [ "streamlit", "run", "image_understanding.py" ] \ No newline at end of file +ENTRYPOINT [ "streamlit", "run", "image_understanding.py" ] diff --git a/chatbot/Makefile b/recipes/natural_language_processing/chatbot/Makefile similarity index 53% rename from chatbot/Makefile rename to recipes/natural_language_processing/chatbot/Makefile index fccc7309..cee4949e 100644 --- a/chatbot/Makefile +++ b/recipes/natural_language_processing/chatbot/Makefile @@ -1,10 +1,10 @@ .PHONY: build build: - podman build -f chatbot/Containerfile -t ghcr.io/ai-lab-recipes/chatbot . + podman build -t ghcr.io/ai-lab-recipes/chatbot . .PHONY: install install: - pip install -r requirements-test.txt + pip install -r tests/requirements-test.txt .PHONY: run run: @@ -12,4 +12,4 @@ run: .PHONY: test test: - pytest --collect-only chatbot/tests --log-cli-level NOTSET + pytest --collect-only tests --log-cli-level NOTSET diff --git a/recipes/natural_language_processing/chatbot/builds/Containerfile b/recipes/natural_language_processing/chatbot/builds/Containerfile index 6d28981e..796aec72 100644 --- a/recipes/natural_language_processing/chatbot/builds/Containerfile +++ b/recipes/natural_language_processing/chatbot/builds/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /chat COPY builds/requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /chat/requirements.txt COPY chatbot_ui.py . EXPOSE 8501 -ENTRYPOINT [ "streamlit", "run", "chatbot_ui.py" ] \ No newline at end of file +ENTRYPOINT [ "streamlit", "run", "chatbot_ui.py" ] diff --git a/recipes/natural_language_processing/chatbot/tests/requirements-test.txt b/recipes/natural_language_processing/chatbot/tests/requirements-test.txt new file mode 120000 index 00000000..0348837e --- /dev/null +++ b/recipes/natural_language_processing/chatbot/tests/requirements-test.txt @@ -0,0 +1 @@ +../../../../requirements-test.txt \ No newline at end of file diff --git a/chatbot/tests/test_alive.py b/recipes/natural_language_processing/chatbot/tests/test_alive.py similarity index 100% rename from chatbot/tests/test_alive.py rename to recipes/natural_language_processing/chatbot/tests/test_alive.py diff --git a/recipes/natural_language_processing/code-generation/builds/Containerfile b/recipes/natural_language_processing/code-generation/builds/Containerfile index f89db27f..bf1a919f 100644 --- a/recipes/natural_language_processing/code-generation/builds/Containerfile +++ b/recipes/natural_language_processing/code-generation/builds/Containerfile @@ -1,9 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest - +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /code-generation COPY builds/requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /code-generation/requirements.txt COPY codegen-app.py . EXPOSE 8501 -ENTRYPOINT ["streamlit", "run", "codegen-app.py"] \ No newline at end of file +ENTRYPOINT ["streamlit", "run", "codegen-app.py"] diff --git a/recipes/natural_language_processing/rag/builds/Containerfile b/recipes/natural_language_processing/rag/builds/Containerfile index 93c3dee9..564acb9d 100644 --- a/recipes/natural_language_processing/rag/builds/Containerfile +++ b/recipes/natural_language_processing/rag/builds/Containerfile @@ -1,4 +1,4 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 ### Update sqlite for chroma USER root RUN dnf remove sqlite3 -y diff --git a/recipes/natural_language_processing/summarizer/builds/Containerfile b/recipes/natural_language_processing/summarizer/builds/Containerfile index 2197afbb..fe0bd354 100644 --- a/recipes/natural_language_processing/summarizer/builds/Containerfile +++ b/recipes/natural_language_processing/summarizer/builds/Containerfile @@ -1,8 +1,8 @@ -FROM registry.access.redhat.com/ubi9/python-39:latest +FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /summarizer COPY builds/requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /summarizer/requirements.txt COPY summarizer.py . EXPOSE 8501 -ENTRYPOINT [ "streamlit", "run", "summarizer.py" ] \ No newline at end of file +ENTRYPOINT [ "streamlit", "run", "summarizer.py" ]