Skip to content

Commit

Permalink
Merge pull request #98 from sallyom/update-python-base
Browse files Browse the repository at this point in the history
update python base images
  • Loading branch information
lmilbaum authored Mar 28, 2024
2 parents f45b92d + 820d4fd commit 10c6df3
Show file tree
Hide file tree
Showing 18 changed files with 46 additions and 43 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/build-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/chatbot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/[email protected]

- 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
2 changes: 1 addition & 1 deletion convert_models/Containerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion finetune/Containerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
4 changes: 2 additions & 2 deletions model_servers/llamacpp_python/base/Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion model_servers/llamacpp_python/vulkan/Containerfile
Original file line number Diff line number Diff line change
@@ -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 && \
Expand Down
4 changes: 2 additions & 2 deletions recipes/audio/audio-to-text/builds/Containerfile
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "streamlit", "run", "whisper_client.py" ]
4 changes: 2 additions & 2 deletions recipes/computer_vision/object_detection/client/Containerfile
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "streamlit", "run", "object_detection_client.py" ]
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "uvicorn", "object_detection_server:app", "--host", "0.0.0.0" ]
4 changes: 2 additions & 2 deletions recipes/multimodal/image_understanding/builds/Containerfile
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "streamlit", "run", "image_understanding.py" ]
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
.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:
podman run -it -p 8501:8501 -e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001/v1 ghcr.io/ai-lab-recipes/chatbot

.PHONY: test
test:
pytest --collect-only chatbot/tests --log-cli-level NOTSET
pytest --collect-only tests --log-cli-level NOTSET
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "streamlit", "run", "chatbot_ui.py" ]
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -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"]
ENTRYPOINT ["streamlit", "run", "codegen-app.py"]
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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" ]
ENTRYPOINT [ "streamlit", "run", "summarizer.py" ]

0 comments on commit 10c6df3

Please sign in to comment.