update all recipes to use MODEL_ENDPOINT #931
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Sample applications build,test,push images | |
# Build image once the PR is merged to main branch. | |
on: | |
pull_request: | |
workflow_dispatch: | |
branches: [ main ] | |
push: | |
workflow_dispatch: | |
branches: [main] | |
jobs: | |
build: | |
runs-on: ubuntu-latest # windows-latest || macos-latest | |
env: | |
REGISTRY: quay.io/ai-lab | |
#GH_REGISTRY: ghcr.io | |
# github.repository as <account>/<repo> | |
SUMMARIZER_IMAGE: summarizer | |
CODEGEN_IMAGE: codegen | |
RAG_IMAGE: rag | |
CHROMADB_IMAGE: chromadb | |
steps: | |
- name: Remove unnecessary files | |
run: | | |
sudo rm -rf /usr/share/dotnet | |
sudo rm -rf "$AGENT_TOOLSDIRECTORY" | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 # OR "2" -> To retrieve the preceding commit. | |
- name: Get changed rag files | |
id: changed-files-rag | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
recipes/natural_language_processing/rag/** | |
- name: Get changed summarizer files | |
id: changed-files-summarizer | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
recipes/natural_language_processing/summarizer/** | |
- name: Get changed code-generation files | |
id: changed-files-codegen | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
recipes/natural_language_processing/codegen/** | |
- name: Get changed chromadb files | |
id: changed-files-chromadb | |
uses: tj-actions/changed-files@v42 | |
with: | |
files: | | |
vector_dbs/chromadb/** | |
- name: Install qemu dependency | |
if: steps.changed-files-summarizer.outputs.any_changed == 'true' || steps.changed-files-rag.outputs.any_changed == 'true' || steps.changed-files-codegen.outputs.any_changed == 'true' | |
run: | | |
sudo apt-get update | |
sudo apt-get install -y qemu-user-static | |
- name: Login Quay Container registry | |
if: > | |
(steps.changed-files-summarizer.outputs.any_changed == 'true' || steps.changed-files-rag.outputs.any_changed == 'true' || steps.changed-files-chromadb.outputs.any_changed == 'true' || steps.changed-files-codegen.outputs.any_changed == 'true') && | |
(github.event_name == 'push' || github.event_name == 'schedule') && | |
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
uses: redhat-actions/podman-login@v1 | |
with: | |
registry: quay.io | |
username: ${{ secrets.REGISTRY_USER }} | |
password: ${{ secrets.REGISTRY_PASSWORD }} | |
- name: Build codegen | |
if: steps.changed-files-codegen.outputs.any_changed == 'true' | |
id: build_codegen_multiplatform | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.CODEGEN_IMAGE }} | |
tags: latest ${{ github.sha }} | |
platforms: linux/amd64, linux/arm64 | |
context: recipes/natural_language_processing/codegen/app | |
containerfiles: | | |
./recipes/natural_language_processing/codegen/app/Containerfile | |
- name: Push codegen image | |
id: push_codegen | |
if: > | |
(steps.changed-files-codegen.outputs.any_changed == 'true') && | |
(github.event_name == 'push' || github.event_name == 'schedule') && | |
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_codegen_multiplatform.outputs.image }} | |
tags: ${{ steps.build_codegen_multiplatform.outputs.tags }} | |
registry: ${{ env.REGISTRY }} | |
- name: Build summarizer | |
if: steps.changed-files-summarizer.outputs.any_changed == 'true' | |
id: build_summarizer_multiplatform | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.SUMMARIZER_IMAGE }} | |
tags: latest ${{ github.sha }} | |
platforms: linux/amd64, linux/arm64 | |
context: recipes/natural_language_processing/summarizer/app | |
containerfiles: | | |
./recipes/natural_language_processing/summarizer/app/Containerfile | |
- name: Push summarizer image | |
id: push_summarizer | |
if: > | |
(steps.changed-files-summarizer.outputs.any_changed == 'true') && | |
(github.event_name == 'push' || github.event_name == 'schedule') && | |
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_summarizer_multiplatform.outputs.image }} | |
tags: ${{ steps.build_summarizer_multiplatform.outputs.tags }} | |
registry: ${{ env.REGISTRY }} | |
- name: Build RAG | |
if: steps.changed-files-rag.outputs.any_changed == 'true' | |
id: build_rag_multiplatform | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.RAG_IMAGE }} | |
tags: latest ${{ github.sha }} | |
platforms: linux/arm64, linux/amd64 | |
context: recipes/natural_language_processing/rag/app | |
containerfiles: | | |
./recipes/natural_language_processing/rag/app/Containerfile | |
- name: Push rag image | |
id: push_rag | |
if: > | |
(steps.changed-files-rag.outputs.any_changed == 'true') && | |
(github.event_name == 'push' || github.event_name == 'schedule') && | |
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_rag_multiplatform.outputs.image }} | |
tags: ${{ steps.build_rag_multiplatform.outputs.tags }} | |
registry: ${{ env.REGISTRY }} | |
- name: Build chromadb | |
if: steps.changed-files-chromadb.outputs.any_changed == 'true' | |
id: build_chromadb_multiplatform | |
uses: redhat-actions/buildah-build@v2 | |
with: | |
image: ${{ env.CHROMADB_IMAGE }} | |
tags: latest ${{ github.sha }} | |
platforms: linux/arm64, linux/amd64 | |
context: vector_dbs/chromadb | |
containerfiles: | | |
./vector_dbs/chromadb/Containerfile | |
- name: Push chromadb image | |
id: push_chromadb | |
if: > | |
(steps.changed-files-chromadb.outputs.any_changed == 'true') && | |
(github.event_name == 'push' || github.event_name == 'schedule') && | |
(github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')) | |
uses: redhat-actions/push-to-registry@v2 | |
with: | |
image: ${{ steps.build_chromadb_multiplatform.outputs.image }} | |
tags: ${{ steps.build_chromadb_multiplatform.outputs.tags }} | |
registry: ${{ env.REGISTRY }} |