diff --git a/.github/workflows/ailab_image_build_push.yaml b/.github/workflows/ailab_image_build_push.yaml index 196de8bac..10913a46b 100644 --- a/.github/workflows/ailab_image_build_push.yaml +++ b/.github/workflows/ailab_image_build_push.yaml @@ -167,8 +167,8 @@ jobs: image: ${{ env.RAG_IMAGE_NAME }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - containerfiles: ./recipes/natural_language_processing/rag/builds/Containerfile - context: recipes/natural_language_processing/rag + containerfiles: ./recipes/natural_language_processing/rag/app/Containerfile + context: recipes/natural_language_processing/rag/app - name: Login to quay.io uses: redhat-actions/podman-login@v1 @@ -246,8 +246,8 @@ jobs: image: ${{ env.CHATBOT_IMAGE_NAME }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - containerfiles: ./recipes/natural_language_processing/chatbot/builds/Containerfile - context: recipes/natural_language_processing/chatbot + containerfiles: ./recipes/natural_language_processing/chatbot/app/Containerfile + context: recipes/natural_language_processing/chatbot/app - name: Login to quay.io uses: redhat-actions/podman-login@v1 @@ -286,8 +286,8 @@ jobs: image: ${{ env.SUMMARIZER_IMAGE_NAME }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - containerfiles: ./recipes/natural_language_processing/summarizer/builds/Containerfile - context: recipes/natural_language_processing/summarizer + containerfiles: ./recipes/natural_language_processing/summarizer/app/Containerfile + context: recipes/natural_language_processing/summarizer/app/app - name: Login to quay.io uses: redhat-actions/podman-login@v1 diff --git a/.github/workflows/build-images.yaml b/.github/workflows/build-images.yaml index 31500359b..4f274c04b 100644 --- a/.github/workflows/build-images.yaml +++ b/.github/workflows/build-images.yaml @@ -49,7 +49,7 @@ jobs: uses: tj-actions/changed-files@v42 with: files: | - recipes/natural_language_processing/code-generation/** + recipes/natural_language_processing/codegen/** - name: Get changed chromadb files id: changed-files-chromadb @@ -75,7 +75,7 @@ jobs: username: ${{ secrets.REGISTRY_USER }} password: ${{ secrets.REGISTRY_PASSWORD }} - - name: Build code-generation + - name: Build codegen if: steps.changed-files-codegen.outputs.any_changed == 'true' id: build_codegen_multiplatform uses: redhat-actions/buildah-build@v2 @@ -83,11 +83,11 @@ jobs: image: ${{ env.CODEGEN_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - context: recipes/natural_language_processing/code-generation + context: recipes/natural_language_processing/codegen/app containerfiles: | - ./recipes/natural_language_processing/code-generation/builds/Containerfile + ./recipes/natural_language_processing/codegen/app/Containerfile - - name: Push code-generation image + - name: Push codegen image id: push_codegen if: > (steps.changed-files-codegen.outputs.any_changed == 'true') && @@ -107,9 +107,9 @@ jobs: image: ${{ env.SUMMARIZER_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/amd64, linux/arm64 - context: recipes/natural_language_processing/summarizer + context: recipes/natural_language_processing/summarizer/app containerfiles: | - ./recipes/natural_language_processing/summarizer/builds/Containerfile + ./recipes/natural_language_processing/summarizer/app/Containerfile - name: Push summarizer image id: push_summarizer @@ -131,9 +131,9 @@ jobs: image: ${{ env.RAG_IMAGE }} tags: latest ${{ github.sha }} platforms: linux/arm64, linux/amd64 - context: recipes/natural_language_processing/rag + context: recipes/natural_language_processing/rag/app containerfiles: | - ./recipes/natural_language_processing/rag/builds/Containerfile + ./recipes/natural_language_processing/rag/app/Containerfile - name: Push rag image id: push_rag diff --git a/.github/workflows/chatbot.yaml b/.github/workflows/chatbot.yaml index 2bc7223a6..bb11a7faa 100644 --- a/.github/workflows/chatbot.yaml +++ b/.github/workflows/chatbot.yaml @@ -46,8 +46,8 @@ jobs: image: ${{ env.REGISTRY }}/containers/${{ env.IMAGE_NAME }} tags: latest platforms: linux/amd64, linux/arm64 - containerfiles: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}/builds/Containerfile - context: recipes/natural_language_processing/${{ env.IMAGE_NAME }} + containerfiles: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}/app/Containerfile + context: recipes/natural_language_processing/${{ env.IMAGE_NAME }}/app - name: Set up Python uses: actions/setup-python@v5.0.0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e173f1e81..6009720ab 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -23,8 +23,8 @@ Recipes are currently organized by category: `audio/`, `computer_vision/`, `mult Inside of the new directory you should add the following files: * `ai-lab.yaml` -* `builds/Containerfile` -* `builds/requirements.txt` +* `app/Containerfile` +* `app/requirements.txt` * `_ui.py` * `README.md` @@ -53,7 +53,7 @@ application: image: quay.io/ai-lab/llamacppp-python:latest - name: streamlit-chat-app contextdir: . - containerfile: builds/Containerfile + containerfile: app/Containerfile arch: - arm64 - amd64 @@ -64,14 +64,14 @@ application: You can use this example as your template and change the fields where needed to define your own recipe. -### builds/Containerfile +### app/Containerfile This will be the Containerfile used to build the client side image of your AI application. Whenever possible, we will use Red Hat's UBI as our base image. Below please see an example from the chatbot recipe. ```Dockerfile FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /chat -COPY builds/requirements.txt . +COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /chat/requirements.txt COPY chatbot_ui.py . @@ -81,7 +81,7 @@ ENTRYPOINT [ "streamlit", "run", "chatbot_ui.py" ] You can use this example as your template and change the fields where needed to define your own Containerfile. -### builds/requirements.txt +### app/requirements.txt You need to include a requirements.txt file here as well so that we ensure the correct dependencies get built into our application. @@ -167,4 +167,4 @@ Every vector database needs a README.md that specifies how to build, deploy and ## Additional Contributions -If you would like to contribute in some other way not outlined here, please feel free to open a [PR](https://github.com/containers/ai-lab-recipes/pulls) or an [Issue](https://github.com/containers/ai-lab-recipes/issues) in this repository and one of our maintainers will follow up. Thanks! \ No newline at end of file +If you would like to contribute in some other way not outlined here, please feel free to open a [PR](https://github.com/containers/ai-lab-recipes/pulls) or an [Issue](https://github.com/containers/ai-lab-recipes/issues) in this repository and one of our maintainers will follow up. Thanks! diff --git a/recipes/audio/audio_to_text/README.md b/recipes/audio/audio_to_text/README.md index 5caa701d6..82db353b4 100644 --- a/recipes/audio/audio_to_text/README.md +++ b/recipes/audio/audio_to_text/README.md @@ -73,7 +73,7 @@ image from the `audio-to-text/` directory. ```bash cd audio-to-text -podman build -t audio-to-text . -f builds/Containerfile +podman build -t audio-to-text app ``` ### Deploy the AI Application diff --git a/recipes/audio/audio_to_text/ai-lab.yaml b/recipes/audio/audio_to_text/ai-lab.yaml index fb24f0d01..cabc85f88 100644 --- a/recipes/audio/audio_to_text/ai-lab.yaml +++ b/recipes/audio/audio_to_text/ai-lab.yaml @@ -17,11 +17,11 @@ application: - 8001 image: quay.io/redhat-et/locallm-whispercpp-service:latest - name: whispercpp-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - amd64 ports: - 8501 - image: quay.io/redhat-et/locallm-whisper-client:latest \ No newline at end of file + image: quay.io/redhat-et/locallm-whisper-client:latest diff --git a/recipes/audio/audio_to_text/builds/Containerfile b/recipes/audio/audio_to_text/app/Containerfile similarity index 100% rename from recipes/audio/audio_to_text/builds/Containerfile rename to recipes/audio/audio_to_text/app/Containerfile diff --git a/recipes/audio/audio_to_text/builds/requirements.txt b/recipes/audio/audio_to_text/app/requirements.txt similarity index 100% rename from recipes/audio/audio_to_text/builds/requirements.txt rename to recipes/audio/audio_to_text/app/requirements.txt diff --git a/recipes/audio/audio_to_text/whisper_client.py b/recipes/audio/audio_to_text/app/whisper_client.py similarity index 100% rename from recipes/audio/audio_to_text/whisper_client.py rename to recipes/audio/audio_to_text/app/whisper_client.py diff --git a/recipes/common/Makefile.common b/recipes/common/Makefile.common index c621c5fa2..68de97f32 100644 --- a/recipes/common/Makefile.common +++ b/recipes/common/Makefile.common @@ -56,7 +56,7 @@ UNZIP_EXISTS ?= $(shell command -v unzip) .PHONY: build build: - podman build --squash-all $${ARCH:+--arch $${ARCH}} $${FROM:+--from $${FROM}} -f builds/Containerfile -t ${APP_IMAGE} . + podman build --squash-all $${ARCH:+--arch $${ARCH}} $${FROM:+--from $${FROM}} -t ${APP_IMAGE} app/ .PHONY: bootc bootc: quadlet @@ -152,7 +152,7 @@ run: clean: -rm -rf build -rm -rf tests/__pycache__ - -rm ./$(MODEL_NAME) &> /dev/null + -rm -f ./$(MODEL_NAME) &> /dev/null .PHONY: check-model-in-path check-model-in-path: diff --git a/recipes/multimodal/image_understanding/README.md b/recipes/multimodal/image_understanding/README.md index 00e13ae4b..b1e197125 100644 --- a/recipes/multimodal/image_understanding/README.md +++ b/recipes/multimodal/image_understanding/README.md @@ -3,7 +3,7 @@ ### Build image ```bash cd image_understanding -podman build -t image_understanding . -f builds/Containerfile +podman build -t image_understanding app ``` ### Run the Multimodal Model Server: @@ -36,4 +36,4 @@ podman run --rm -it -p 8501:8501 -e MODEL_SERVICE_ENDPOINT=http://10.88.0.1:8001 Interact with the application from your local browser at `localhost:8501`. You can upload an image file from your host machine and the app will provide a natural language description of the image. -![](/assets/image_analysis.png) \ No newline at end of file +![](/assets/image_analysis.png) diff --git a/recipes/multimodal/image_understanding/ai-lab.yaml b/recipes/multimodal/image_understanding/ai-lab.yaml index 7f67f910f..e201f5cdc 100644 --- a/recipes/multimodal/image_understanding/ai-lab.yaml +++ b/recipes/multimodal/image_understanding/ai-lab.yaml @@ -13,8 +13,8 @@ application: - arm64 - amd64 - name: image-understanding-inference-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - - amd64 \ No newline at end of file + - amd64 diff --git a/recipes/multimodal/image_understanding/builds/Containerfile b/recipes/multimodal/image_understanding/app/Containerfile similarity index 89% rename from recipes/multimodal/image_understanding/builds/Containerfile rename to recipes/multimodal/image_understanding/app/Containerfile index c69cb3079..80aba6cc5 100644 --- a/recipes/multimodal/image_understanding/builds/Containerfile +++ b/recipes/multimodal/image_understanding/app/Containerfile @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /image_understanding -COPY builds/requirements.txt . +COPY requirements.txt . RUN pip install --upgrade pip && \ pip install --no-cache-dir --upgrade -r requirements.txt COPY image_understanding.py . diff --git a/recipes/multimodal/image_understanding/image_understanding.py b/recipes/multimodal/image_understanding/app/image_understanding.py similarity index 100% rename from recipes/multimodal/image_understanding/image_understanding.py rename to recipes/multimodal/image_understanding/app/image_understanding.py diff --git a/recipes/multimodal/image_understanding/builds/requirements.txt b/recipes/multimodal/image_understanding/app/requirements.txt similarity index 100% rename from recipes/multimodal/image_understanding/builds/requirements.txt rename to recipes/multimodal/image_understanding/app/requirements.txt diff --git a/recipes/natural_language_processing/chatbot/ai-lab.yaml b/recipes/natural_language_processing/chatbot/ai-lab.yaml index ddac72f43..715332136 100644 --- a/recipes/natural_language_processing/chatbot/ai-lab.yaml +++ b/recipes/natural_language_processing/chatbot/ai-lab.yaml @@ -17,8 +17,8 @@ application: - 8001 image: quay.io/ai-lab/llamacppp-python:latest - name: streamlit-chat-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - amd64 diff --git a/recipes/natural_language_processing/chatbot/builds/Containerfile b/recipes/natural_language_processing/chatbot/app/Containerfile similarity index 88% rename from recipes/natural_language_processing/chatbot/builds/Containerfile rename to recipes/natural_language_processing/chatbot/app/Containerfile index 796aec72d..13a31118f 100644 --- a/recipes/natural_language_processing/chatbot/builds/Containerfile +++ b/recipes/natural_language_processing/chatbot/app/Containerfile @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /chat -COPY builds/requirements.txt . +COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /chat/requirements.txt COPY chatbot_ui.py . diff --git a/recipes/natural_language_processing/chatbot/chatbot_ui.py b/recipes/natural_language_processing/chatbot/app/chatbot_ui.py similarity index 100% rename from recipes/natural_language_processing/chatbot/chatbot_ui.py rename to recipes/natural_language_processing/chatbot/app/chatbot_ui.py diff --git a/recipes/natural_language_processing/chatbot/builds/requirements.txt b/recipes/natural_language_processing/chatbot/app/requirements.txt similarity index 100% rename from recipes/natural_language_processing/chatbot/builds/requirements.txt rename to recipes/natural_language_processing/chatbot/app/requirements.txt diff --git a/recipes/natural_language_processing/codegen/README.md b/recipes/natural_language_processing/codegen/README.md index 703012db7..5ae1b23f6 100644 --- a/recipes/natural_language_processing/codegen/README.md +++ b/recipes/natural_language_processing/codegen/README.md @@ -72,13 +72,13 @@ podman run --rm -it \ ### Build the AI Application -Now that the Model Service is running we want to build and deploy our AI Application. Use the provided Containerfile to build the AI Application image from the `code-generation/` directory. +Now that the Model Service is running we want to build and deploy our AI Application. Use the provided Containerfile to build the AI Application image from the `codegen/` directory. Run: ```bash -cd code-generation -podman build -t codegen . -f builds/Containerfile +cd codegen +podman build -t codegen app ``` ### Deploy the AI Application diff --git a/recipes/natural_language_processing/codegen/ai-lab.yaml b/recipes/natural_language_processing/codegen/ai-lab.yaml index fa5e7eb96..0f243ae36 100644 --- a/recipes/natural_language_processing/codegen/ai-lab.yaml +++ b/recipes/natural_language_processing/codegen/ai-lab.yaml @@ -2,7 +2,7 @@ version: v1.0 application: type: language name: codegen-demo - description: This is a code-generation demo application. + description: This is a code generation demo application. containers: - name: llamacpp-server contextdir: ../../../model_servers/llamacpp_python @@ -17,8 +17,8 @@ application: - 8001 image: quay.io/ai-lab/llamacpp-python:latest - name: codegen-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - amd64 diff --git a/recipes/natural_language_processing/codegen/builds/Containerfile b/recipes/natural_language_processing/codegen/app/Containerfile similarity index 55% rename from recipes/natural_language_processing/codegen/builds/Containerfile rename to recipes/natural_language_processing/codegen/app/Containerfile index bf1a919fd..a895db473 100644 --- a/recipes/natural_language_processing/codegen/builds/Containerfile +++ b/recipes/natural_language_processing/codegen/app/Containerfile @@ -1,8 +1,8 @@ FROM registry.access.redhat.com/ubi9/python-311:1-52 -WORKDIR /code-generation -COPY builds/requirements.txt . +WORKDIR /codegen +COPY requirements.txt . RUN pip install --upgrade pip -RUN pip install --no-cache-dir --upgrade -r /code-generation/requirements.txt +RUN pip install --no-cache-dir --upgrade -r /codegen/requirements.txt COPY codegen-app.py . EXPOSE 8501 ENTRYPOINT ["streamlit", "run", "codegen-app.py"] diff --git a/recipes/natural_language_processing/codegen/codegen-app.py b/recipes/natural_language_processing/codegen/app/codegen-app.py similarity index 100% rename from recipes/natural_language_processing/codegen/codegen-app.py rename to recipes/natural_language_processing/codegen/app/codegen-app.py diff --git a/recipes/natural_language_processing/codegen/builds/requirements.txt b/recipes/natural_language_processing/codegen/app/requirements.txt similarity index 100% rename from recipes/natural_language_processing/codegen/builds/requirements.txt rename to recipes/natural_language_processing/codegen/app/requirements.txt diff --git a/recipes/natural_language_processing/codegen/quadlet/README.md b/recipes/natural_language_processing/codegen/quadlet/README.md index f21a3c2a6..53cfafe13 100644 --- a/recipes/natural_language_processing/codegen/quadlet/README.md +++ b/recipes/natural_language_processing/codegen/quadlet/README.md @@ -1,4 +1,4 @@ -### Run code-generation as a systemd service +### Run codegen as a systemd service ```bash (cd ../;make quadlet) diff --git a/recipes/natural_language_processing/rag/ai-lab.yaml b/recipes/natural_language_processing/rag/ai-lab.yaml index cc133910a..37a9b2c0d 100644 --- a/recipes/natural_language_processing/rag/ai-lab.yaml +++ b/recipes/natural_language_processing/rag/ai-lab.yaml @@ -27,8 +27,8 @@ application: - 8000 image: quay.io/redhat-et/locallm-chromadb:latest - name: rag-inference-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - amd64 diff --git a/recipes/natural_language_processing/rag/builds/Containerfile b/recipes/natural_language_processing/rag/app/Containerfile similarity index 95% rename from recipes/natural_language_processing/rag/builds/Containerfile rename to recipes/natural_language_processing/rag/app/Containerfile index 564acb9d9..9766a7f9d 100644 --- a/recipes/natural_language_processing/rag/builds/Containerfile +++ b/recipes/natural_language_processing/rag/app/Containerfile @@ -12,7 +12,7 @@ RUN mv /usr/local/bin/sqlite3 /usr/bin/sqlite3 ENV LD_LIBRARY_PATH="/usr/local/lib" #### WORKDIR /rag -COPY builds/requirements.txt . +COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /rag/requirements.txt COPY rag_app.py . diff --git a/recipes/natural_language_processing/rag/populate_vectordb.py b/recipes/natural_language_processing/rag/app/populate_vectordb.py similarity index 100% rename from recipes/natural_language_processing/rag/populate_vectordb.py rename to recipes/natural_language_processing/rag/app/populate_vectordb.py diff --git a/recipes/natural_language_processing/rag/rag_app.py b/recipes/natural_language_processing/rag/app/rag_app.py similarity index 100% rename from recipes/natural_language_processing/rag/rag_app.py rename to recipes/natural_language_processing/rag/app/rag_app.py diff --git a/recipes/natural_language_processing/rag/builds/requirements.txt b/recipes/natural_language_processing/rag/app/requirements.txt similarity index 100% rename from recipes/natural_language_processing/rag/builds/requirements.txt rename to recipes/natural_language_processing/rag/app/requirements.txt diff --git a/recipes/natural_language_processing/summarizer/ai-lab.yaml b/recipes/natural_language_processing/summarizer/ai-lab.yaml index f3bbced46..bab8ffd99 100644 --- a/recipes/natural_language_processing/summarizer/ai-lab.yaml +++ b/recipes/natural_language_processing/summarizer/ai-lab.yaml @@ -17,8 +17,8 @@ application: - 8001 image: quay.io/ai-lab/llamacpp-python:latest - name: streamlit-summary-app - contextdir: . - containerfile: builds/Containerfile + contextdir: app + containerfile: app/Containerfile arch: - arm64 - amd64 diff --git a/recipes/natural_language_processing/summarizer/builds/Containerfile b/recipes/natural_language_processing/summarizer/app/Containerfile similarity index 89% rename from recipes/natural_language_processing/summarizer/builds/Containerfile rename to recipes/natural_language_processing/summarizer/app/Containerfile index fe0bd3545..4f0b9e84e 100644 --- a/recipes/natural_language_processing/summarizer/builds/Containerfile +++ b/recipes/natural_language_processing/summarizer/app/Containerfile @@ -1,6 +1,6 @@ FROM registry.access.redhat.com/ubi9/python-311:1-52 WORKDIR /summarizer -COPY builds/requirements.txt . +COPY requirements.txt . RUN pip install --upgrade pip RUN pip install --no-cache-dir --upgrade -r /summarizer/requirements.txt COPY summarizer.py . diff --git a/recipes/natural_language_processing/summarizer/builds/requirements.txt b/recipes/natural_language_processing/summarizer/app/requirements.txt similarity index 100% rename from recipes/natural_language_processing/summarizer/builds/requirements.txt rename to recipes/natural_language_processing/summarizer/app/requirements.txt diff --git a/recipes/natural_language_processing/summarizer/summarizer.py b/recipes/natural_language_processing/summarizer/app/summarizer.py similarity index 100% rename from recipes/natural_language_processing/summarizer/summarizer.py rename to recipes/natural_language_processing/summarizer/app/summarizer.py