Compare commits

...

698 Commits
v1.1.1 ... main

Author SHA1 Message Date
Platform Engineering Bot 63a83a7398
fix(deps): update auto merged updates (#880)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-06-09 08:44:36 +03:00
Platform Engineering Bot 1bace0e7c5
fix(deps): update auto merged updates (#879)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-06-02 08:05:13 +03:00
Platform Engineering Bot 2f6980bd4d
fix(deps): update auto merged updates (#878)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-05-26 09:24:49 +03:00
Brian M cdf6cd5615
Fixed graphrag macos errors and really long load times for parsing documents (#876) 2025-05-21 13:44:14 +02:00
Jeff MAURY bbffacf06d
fix: update summarizer recipe for the ramalama images (#875) 2025-05-21 10:13:51 +02:00
Jeff MAURY a4b25dc8ac
fix: ajust PydanticAI recipe to latest release (#872) 2025-05-19 16:28:47 +02:00
Jeff MAURY 86fe2a196b
fix:object_detection_python build failure (#871) 2025-05-19 16:07:11 +02:00
Platform Engineering Bot b5a33f3e44
fix(deps): update auto merged updates (#870)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-05-19 08:24:30 +03:00
Platform Engineering Bot 2d3f0584fc
fix(deps): update auto merged updates (#869)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-05-12 07:54:22 +03:00
Daniel J Walsh 67b7b20c4e
Merge pull request #868 from bmahabirbu/react-fix
fix: fixed agent containerfile reqs and entrypoint
2025-05-05 10:45:48 -04:00
Brian 0e90ee18b1
fix: fixed agent containerfile reqs and entrypoint
Signed-off-by: Brian <bmahabir@bu.edu>
2025-05-05 02:57:08 -04:00
Platform Engineering Bot dfd85f2270
fix(deps): update auto merged updates (#867)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-05-05 08:24:59 +03:00
Daniel J Walsh 30fe56379a
Merge pull request #866 from containers/renovate/auto-merged-updates
fix(deps): update auto merged updates
LGTM
2025-04-30 09:00:51 -04:00
Platform Engineering Bot a5b965e0b2 fix(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-04-30 09:17:15 +00:00
Platform Engineering Bot eb476dd67b
fix(deps): update auto merged updates (#865)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-04-21 09:54:21 +03:00
Platform Engineering Bot e010fbef36
fix(deps): update auto merged updates (#864)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-04-14 09:14:32 +03:00
Platform Engineering Bot 0d68496a14
fix(deps): update auto merged updates (#863)
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-04-07 08:14:19 +03:00
Brian M 900d38a9ee
Merge pull request #862 from bmahabirbu/graph-fix
fix: reduced token size and gracefully handle token limit errors
2025-03-28 12:22:36 -04:00
Brian ce3c39d7f0 fix: reduced token size and gracefully handle token limit errors
Signed-off-by: Brian <bmahabir@bu.edu>
2025-03-18 01:02:08 -04:00
Daniel J Walsh 418d2f3bf2
Merge pull request #861 from jeffmaury/GH-860
fix: NodeJS function calling is broken on Windows
2025-03-17 09:21:01 -04:00
Jeff MAURY 9224b9a1fc
fix: NodeJS function calling is broken on Windows
Fixes #860

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2025-03-17 12:46:24 +01:00
Daniel J Walsh 53def1030a
Merge pull request #858 from lholmquist/function_calling_nodejs
feat: Add Node.js Function calling example using langgraph.js
2025-03-14 14:24:38 -04:00
Daniel J Walsh 693420a04b
Merge pull request #859 from jeffmaury/add-jeffmaury
chore: add jeffmaury as code owner
2025-03-14 14:24:11 -04:00
Jeff MAURY bee419b497
chore: add jeffmaury as code owner
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2025-03-14 15:10:39 +01:00
Lucas Holmquist 496950ebbf squash: change user after doing the npm install
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-13 15:26:44 -04:00
Lucas Holmquist f198fdd8a0 squash: set version for ubi image
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-10 12:36:24 -04:00
Lucas Holmquist 15d38622e3 squash: use ubi9
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-10 12:36:24 -04:00
Lucas Holmquist a380205467 squash: remove unneeded commented out code
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-10 12:34:10 -04:00
Lucas Holmquist 85e3af9a9d squash: update description
Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-10 08:25:10 -04:00
Lucas Holmquist 5f9344a61d feat: add node.js function calling recipe with langgraph
* This recipe uses langchain.js and langgraph.js to create an AI application that does function calling

Signed-off-by: Lucas Holmquist <lholmqui@redhat.com>
2025-03-10 08:25:10 -04:00
Daniel J Walsh 40630d417e
Merge pull request #855 from bmahabirbu/graph-fix
Fixed containerfile build issue
2025-03-09 00:35:18 -05:00
Daniel J Walsh 7de934e74a
Merge pull request #852 from containers/renovate/auto-merged-updates
fix(deps): update auto merged updates
2025-03-08 16:39:13 -05:00
Brian e62cabdd68 Updated permission fix for graphrag and pydantic ai recipe
Signed-off-by: Brian <bmahabir@bu.edu>
2025-03-07 19:52:42 -05:00
Platform Engineering Bot 4f1f7bcce5 fix(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-03-08 00:27:32 +00:00
Brian 1ff4148656 Fixed containerfile build issue
Signed-off-by: Brian <bmahabir@bu.edu>
2025-02-26 20:15:38 -05:00
Daniel J Walsh 12a5b37fcf
Merge pull request #854 from bmahabirbu/pydantic-readme
Added readme to pydantic recipe
2025-02-26 11:32:04 -05:00
Brian Mahabir f0a728bff1 Added readme to pydantic recipe
Signed-off-by: Brian Mahabir <56164556+bmahabirbu@users.noreply.github.com>
2025-02-26 11:25:16 -05:00
Daniel J Walsh a190e10127
Merge pull request #853 from bmahabirbu/grag
Added GraphRag Recipe using Lightrag repo
2025-02-26 10:29:52 -05:00
Brian df7bcc107c Added GraphRag Recipe using Lightrag repo
Signed-off-by: Brian <bmahabir@bu.edu>
2025-02-25 20:51:05 -05:00
Daniel J Walsh ef26248d4b
Merge pull request #849 from bmahabirbu/pydantic
Added pydantic-ai recipe
2025-02-24 08:56:32 -05:00
Brian M 759f22ba6d
Merge branch 'containers:main' into pydantic 2025-02-21 02:21:32 -05:00
Brian 6ff584f997 removed model bearer
Signed-off-by: Brian <bmahabir@bu.edu>
2025-02-17 22:37:01 -05:00
Brian 2485595815 Fixed permission issue in containerfile
Signed-off-by: Brian <bmahabir@bu.edu>
2025-02-17 22:08:28 -05:00
Daniel J Walsh a32ccb8f1d
Merge pull request #847 from containers/renovate/auto-merged-updates
fix(deps): update auto merged updates
2025-02-10 14:41:32 -05:00
Brian 956d857bbe Added pydantic-ai recipe
Signed-off-by: Brian <bmahabir@bu.edu>
2025-02-06 22:09:53 -05:00
Platform Engineering Bot c175e400cc fix(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-02-06 18:15:21 +00:00
Sally O'Malley 31875d393e
Merge pull request #848 from maorfr/gcp-mkdir-exists
cloud gcp mkdir handle existing directory
2025-01-28 09:36:12 -05:00
Maor Friedman 6eef634aa9 cloud gcp mkdir handle existing directory
Signed-off-by: Maor Friedman <mafriedm@redhat.com>
2025-01-28 16:21:42 +02:00
Daniel J Walsh 11fc2467f2
Merge pull request #842 from javipolo/cloud-user
Use cloud-user as a default username in AWS
2025-01-15 06:48:01 -05:00
Javi Polo 3d3dec93ed
Use cloud-user as a default username in AWS
Signed-off-by: Javi Polo <jpolo@redhat.com>
2025-01-15 11:45:13 +01:00
Gregory Pereira 28819abe5e
Merge pull request #841 from mhdawson/work-with-later-chroma
fix: update Rag Node.js recipie to make compatible with later chromadb version
2025-01-13 13:30:50 -08:00
Michael Dawson 4a8211e116 fix: update to make compatible with later chromadb version
https://github.com/containers/ai-lab-recipes/pull/806 updated the
version of chromadb used with the rag recipe when run with podman
ai lab.

Update the versions of Langchain and Chromadb clients to be compatible

Signed-off-by: Michael Dawson <mdawson@devrus.com>
2025-01-09 16:17:26 -05:00
Liora Milbaum 73be4fdb66
Merge pull request #840 from lmilbaum/remove-lmilbaum
lmilbaum removed from CODEOWNERS
2025-01-08 21:23:09 +02:00
Liora Milbaum a3e395644f lmilbaum removed from CODEOWNERS
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2025-01-08 21:22:37 +02:00
Daniel J Walsh 00ab6ef366
Merge pull request #834 from mhdawson/add-nodejs-rag
feat: add Node.js RAG recipe
2025-01-08 13:04:51 -05:00
Daniel J Walsh 146f92331b
Merge pull request #838 from sallyom/update-rag-manage-vector-db
update rag/app/manage_vectordb.py imports
2025-01-08 07:34:11 -05:00
Daniel J Walsh 52f7c72286
Merge pull request #839 from Gregory-Pereira/fix-rag-recipe-tagging-and-var-names
fix variable naming conventions
2025-01-08 07:33:47 -05:00
Michael Dawson f10622d2d7 squash: pin chromadb ver to match current client
pin the chromadb version when using quadlet and bootc to the
same one used when run with podman ai lab. Chromadb seems to
break comapibility regularly and the client must be compatible
with the chromadb version used.

Signed-off-by: Michael Dawson <mdawson@devrus.com>
2025-01-07 20:17:00 -05:00
Michael Dawson 35c5a9e02e squash: address comments
Signed-off-by: Michael Dawson <mdawson@devrus.com>
2025-01-07 18:22:06 -05:00
greg pereira f0af5e8790
fix variable naming conventions
Signed-off-by: greg pereira <grpereir@redhat.com>
2025-01-07 14:35:34 -08:00
Daniel J Walsh 26d4e6617b
Merge pull request #837 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2025-01-07 12:04:24 -05:00
Daniel J Walsh 92ef41d473
Merge pull request #828 from sallyom/rag-milvus
Documentation updates
2025-01-07 12:00:38 -05:00
Platform Engineering Bot db7ce279e7 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2025-01-07 09:24:32 +00:00
sallyom 4088d68af7 update rag/app/manage_vectordb.py imports
Signed-off-by: sallyom <somalley@redhat.com>
2025-01-06 15:32:14 -05:00
sallyom 3d1ccf295a Documentation updates & .gitignore add
Signed-off-by: sallyom <somalley@redhat.com>
2025-01-06 15:25:59 -05:00
Liora Milbaum 60e6018c29
Merge pull request #836 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-12-23 06:44:34 +02:00
Platform Engineering Bot 3a49027131 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-12-23 01:43:55 +00:00
Daniel J Walsh eceeb0dc81
Merge pull request #806 from containers/renovate/auto-merged-updates
fix(deps): update auto merged updates
2024-12-13 07:09:11 -05:00
Platform Engineering Bot 740e9c723d fix(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-12-12 10:54:01 +00:00
Gregory Pereira 8d2b5b9eb5
Merge pull request #835 from nerdalert/bash-bugs 2024-12-11 23:15:24 -08:00
Brent Salisbury 28525a47bd Fixed some readme bash in model_servers/llamacpp_python
Signed-off-by: Brent Salisbury <bsalisbu@redhat.com>
2024-12-12 01:29:23 -05:00
Michael Dawson d959db1316 feat: add Node.js RAG recipe
Signed-off-by: Michael Dawson <mdawson@devrus.com>
2024-12-04 17:27:14 -05:00
Daniel J Walsh 7fbdf03a8d
Merge pull request #833 from praveenkumar/fix_vulkan
Update mesa-vulkan-drivers from 23.3.3 to 24.1.2
2024-12-04 07:12:19 -05:00
Daniel J Walsh 6d90ca3237
Merge pull request #832 from praveenkumar/fix_doc_vulkan
Fix outdated containerfile link and add link about vulkan
2024-12-04 07:11:37 -05:00
Praveen Kumar 2e0c17b1e8 Update mesa-vulkan-drivers from 23.3.3 to 24.1.2
Signed-off-by: Praveen Kumar <kumarpraveen.nitdgp@gmail.com>
2024-12-04 14:09:01 +05:30
Praveen Kumar e41da812b3 Fix outdated containerfile link and add link about vulkan
Signed-off-by: Praveen Kumar <kumarpraveen.nitdgp@gmail.com>
2024-12-04 13:22:35 +05:30
Gregory Pereira c300271e37
Merge pull request #831 from sallyom/workflow-update
update models build & push workflow
2024-12-03 16:32:18 -08:00
sallyom 2e9475d59e update models build & push workflow
Signed-off-by: sallyom <somalley@redhat.com>
2024-12-03 19:28:10 -05:00
Gregory Pereira 0ea02c0f9d
Merge pull request #830 from sallyom/workflow-trigger-model-builds
allow update to model images
2024-12-03 15:30:30 -08:00
sallyom 3ac66e2a4f allow update to model images
Signed-off-by: sallyom <somalley@redhat.com>
2024-12-03 18:25:39 -05:00
Daniel J Walsh 7a7edc7c49
Merge pull request #827 from javipolo/disable-gcp-cloud-ops-agent
Disable google-cloud-ops-agent
2024-11-26 12:07:24 -05:00
Javi Polo aed7857507
Disable google-cloud-ops-agent
The current version of google-cloud-ops-agent is impacted by a CVE:
https://access.redhat.com/security/cve/CVE-2024-41110

Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-11-26 17:27:09 +01:00
Gregory Pereira 26b10d23c8
Merge pull request #825 from mhdawson/fix-expose-health
fix: bind to both local and externally visible IPs
2024-11-25 09:47:16 -08:00
Michael Dawson e6188ea86b fix: bind to both local and externally visible IPs
- allows both health check and app to work correctly

Signed-off-by: Michael Dawson <mdawson@devrus.com>
2024-11-25 11:41:27 -05:00
Gregory Pereira 5e2264c4d2
Merge pull request #823 from mhdawson/fix-annother-port
fix: fix another port number for Node.js chatbot
2024-11-22 15:11:11 -08:00
Michael Dawson 717be93ffc fix: fix another port number for Node.js chatbot
Signed-off-by: Michael Dawson <mdawson@devrus.com>
2024-11-22 18:05:59 -05:00
Gregory Pereira 33c0a23d73
Merge pull request #822 from mhdawson/fix-nodejs-recipe
fix: fix the port used by Node.js chatbot example
2024-11-22 12:47:26 -08:00
Michael Dawson ef6b12fdb7 fix: fix the port used by Node.js chatbot example
Signed-off-by: Michael Dawson <mdawson@devrus.com>
2024-11-22 15:30:16 -08:00
Daniel J Walsh 7d7fde0346
Merge pull request #821 from jeffmaury/GH-819
fix: update chatbot-nodejs to bind to localhost
2024-11-22 13:20:03 -05:00
Daniel J Walsh df0cb1e091
Merge pull request #820 from jeffmaury/GH-818
fix: update port for chatbot-nodejs
2024-11-22 13:19:20 -05:00
Jeff MAURY 56a975fc3e
fix: update chatbot-nodejs to bind to localhost
Fixes #819

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-22 18:37:01 +01:00
Jeff MAURY 5951769a8c
fix: update port for chatbot-nodejs
Fixes #818

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-22 18:15:13 +01:00
Daniel J Walsh e96d3b1dd4
Merge pull request #817 from jeffmaury/GH-816
fix: update chatbot-java-quarkus to be running on Windows
2024-11-21 16:23:40 -05:00
Jeff MAURY a4c37fc593
fix: update chatbot-java-quarkus to be running on Windows
Fixes #816

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-21 17:34:46 +01:00
Daniel J Walsh e7647afeff
Merge pull request #815 from feloy/fix-814/md-files-summarizer
fix: support application/octet-stream file type
2024-11-20 10:26:22 -05:00
Philippe Martin ec31a71c90 fix: support application/octet-stream file type
Signed-off-by: Philippe Martin <phmartin@redhat.com>
2024-11-20 09:27:08 +01:00
Daniel J Walsh 9e3acbafef
Merge pull request #810 from jeffmaury/GH-803
fix: use Chroma 0.5.16 as this is the last one working with the RAG r…
2024-11-15 01:45:49 -07:00
Daniel J Walsh a7b03d7bd0
Merge pull request #813 from jmartisk/quarkus-rename
Rename Quarkus example to chatbot-java-quarkus
2024-11-15 01:45:27 -07:00
Jan Martiska 09d00c6434 Rename Quarkus example to chatbot-java-quarkus, some minor metadata fixes
Signed-off-by: Jan Martiska <jmartisk@redhat.com>
2024-11-13 08:26:20 +01:00
Gregory Pereira d853a208b2
Merge pull request #800 from mhdawson/nodejs-chatbot-recipe-2
feat: add JavaScript/Node.js based chatbot recipe
2024-11-12 07:56:20 -08:00
Jeff MAURY fac827880a
fix: use Chroma 0.5.16 as this is the last one working with the RAG recipe
Fixes #803

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-11-08 19:03:40 +01:00
Daniel J Walsh d267075baa
Merge pull request #809 from jmartisk/quarkus-recipe
Recipe for a simple Quarkus-based chatbot
2024-11-08 11:14:14 -05:00
Jan Martiska 6e545870fb Recipe for a simple Quarkus-based chatbot
Signed-off-by: Jan Martiska <jmartisk@redhat.com>
2024-11-08 07:53:09 +01:00
Daniel J Walsh 6e33bfd468
Merge pull request #808 from suppathak/react-agents
Recipe for ReAct agent
2024-11-07 08:09:52 -05:00
Surya Prakash Pathak 6b8fba2e23 Added react-agent supporting files
Signed-off-by: Surya Prakash Pathak <supathak@redhat.com>
2024-11-04 16:48:49 -08:00
Michael Dawson 7fdd184fc8 squash: address comments
- remove provision directory

Signed-off-by: Michael Dawson <midawson@redhat.com>
2024-10-28 12:25:07 -04:00
Daniel J Walsh dcb2bc8e78
Merge pull request #804 from jeffmaury/GH-802
fix: update summarizer app to use correct url for token count
2024-10-28 08:57:35 -04:00
Jeff MAURY 4d15f1b563 fix: update summarizer app to use correct url for token count
Fixes #802

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-10-24 12:10:21 +02:00
Gregory Pereira e19f5f28f6
Merge pull request #805 from javipolo/not-blacklist-amdgpu
Do not blacklist amdgpu module
2024-10-23 11:22:49 -07:00
Javi Polo 5a42559693
Do not blacklist amdgpu module
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-10-16 19:16:30 +02:00
Daniel J Walsh 2b09302008
Merge pull request #799 from thepetk/feat/add_bearer_to_chatbot_and_codegen
Pass bearer to ChatOpenAI object
2024-10-11 15:31:20 -04:00
Daniel J Walsh 2c669ae468
Merge pull request #796 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-10-11 15:29:01 -04:00
Platform Engineering Bot 39ad4d5e70 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-10-10 23:43:45 +00:00
thepetk e192e2afb4 Pass api_key to ChatOpenAI object
Signed-off-by: thepetk <thepetk@gmail.com>
2024-10-06 23:03:18 +01:00
Daniel J Walsh c6daa30fc6
Merge pull request #794 from jeffmaury/GH-562
feat: add function calling recipe
2024-10-02 09:24:00 -04:00
Daniel J Walsh e67cfbe413
Merge pull request #795 from fabiendupont/amd-bootc-shared-container-storage
amd-bootc: Share the additional container storage
2024-10-02 06:19:55 -04:00
Daniel J Walsh aaedd717e5
Merge pull request #797 from fabiendupont/nvidia-bootc-fix-shared-storage
NVIDIA bootc - Shared container storage fix
2024-10-02 06:19:08 -04:00
Daniel J Walsh 33f0d6c139
Merge pull request #790 from thepetk/ft/add_bearer_auth_support
Add Bearer (token) authentication support to recipes
2024-10-02 06:17:43 -04:00
Fabien Dupont 4ef60bd5ae NVIDIA bootc - Shared container storage fix
Follow-up #766

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-10-01 08:57:35 -04:00
Fabien Dupont 5d5a722f15 amd-bootc: Share the additional container storage
We need to share container image storage between rootless users, so that
we don't need `sudo` and we don't duplicate the `instructlab` image.
This change follows the Red Hat solution to
[create additional image store for rootless
users](https://access.redhat.com/solutions/6206192).

The `/usr/lib/containers/storage` folder can be read by anyone and new
users will inherit a default configuration via `/etc/skel` that
configures the additional storage.

The `ilab` wrapper is also modified to remove the impersonation code and
not use `sudo` anymore.

Follow-up on #766

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-09-27 08:20:28 -04:00
Jeff MAURY f421121cf3
fix: typo and unused imports
Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-09-25 14:57:14 +02:00
Jeff MAURY 900f54844f
feat: add function calling recipe
Fixes #562

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-09-25 00:02:50 +02:00
Daniel J Walsh 1e3999d75a
Merge pull request #793 from enriquebelarte/fix-bootc-script
Fix intel bootc script variable
2024-09-24 07:17:56 -04:00
Enrique Belarte Luque 4f91c5aebb
Fix intel bootc script variable
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-24 06:10:43 -05:00
Daniel J Walsh 773b899074
Merge pull request #792 from enriquebelarte/intel-mnt-secret
Add extra secrets for intel-bootc build
2024-09-24 06:42:30 -04:00
Enrique Belarte Luque 3b6232f5bf
Add extra secrets for intel-bootc build
Adds mount secret for using as auth/token for builds

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-24 04:47:14 -05:00
Daniel J Walsh 569c2dbe99
Merge pull request #789 from javipolo/gcp-ops-agent
RHELAI-1474 - Install Google Ops Agent
2024-09-23 13:14:56 -04:00
Daniel J Walsh 5d14b26637
Merge pull request #791 from enriquebelarte/intel-bootc-fix
Some fixes to intel Containerfile
2024-09-23 13:13:12 -04:00
Enrique Belarte Luque 9a63344de3
Some fixes to intel Containerfile
Not all devel packages can be removed as they're dependencies

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-23 11:31:48 -05:00
thepetk 9bd66e0c3e Add summarizer bearer auth support
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 14:13:11 +01:00
thepetk 9a4a08e280 Add bearer auth support to rag
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 14:00:22 +01:00
thepetk 9af5be0033 Add bearer auth support to codegen
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 13:44:13 +01:00
thepetk dd6c8d68ab Remove breakpoint
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 13:43:16 +01:00
thepetk c7524b8988 Add bearer auth support to chatbot
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 13:40:46 +01:00
thepetk 192b5d61dc Add bearer support to object-detection
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 13:32:06 +01:00
thepetk 381089ab63 Add bearer support to audo_to_text
Signed-off-by: thepetk <thepetk@gmail.com>
2024-09-23 13:26:51 +01:00
Liora Milbaum f2859613e4
Merge pull request #788 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-09-23 07:43:16 -04:00
Javi Polo 172dec0775
RHELAI-1474 - Install Google Ops Agent
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-23 12:33:44 +02:00
Platform Engineering Bot 65a7ffe390 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-09-23 00:04:21 +00:00
Daniel J Walsh 375d8c8607
Merge pull request #766 from fabiendupont/nvidia-bootc-shared-container-storage
Share the additional container storage
2024-09-18 17:06:26 -04:00
Daniel J Walsh f20594edf3
Merge pull request #787 from enriquebelarte/fix-script-perms
Add exec permissions for script
2024-09-18 11:21:34 -04:00
Fabien Dupont fe98baf05e Share the additional container storage
We need to share container image storage between rootless users, so that
we don't need `sudo` and we don't duplicate the `instructlab` image.
This change follows the Red Hat solution to
[create additional image store for rootless users](https://access.redhat.com/solutions/6206192).

The `/usr/lib/containers/storage` folder can be read by anyone and new
users will inherit a default configuration via `/etc/skel` that
configures the additional storage.

The `ilab` wrapper is also modified to remove the impersonation code and
not use `sudo` anymore.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-09-18 11:13:41 -04:00
Enrique Belarte Luque 63775c9299
Add exec permissions for script
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-18 10:06:15 -05:00
Enrique Belarte Luque bc1c5896bc
Add exec permissions for script
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-18 10:01:42 -05:00
Daniel J Walsh c2f41788d5
Merge pull request #785 from Okoyl/driver-toolkit-fromimage
driver-toolkit make target fixes.
2024-09-18 09:07:00 -04:00
Daniel J Walsh 2149b2cc32
Merge pull request #786 from enriquebelarte/intel-1.17
Add intel-bootc multistage Containerfile
2024-09-18 09:05:26 -04:00
Enrique Belarte Luque a935767405
Remove devel packages
Remove -devel packages and bits not needed for runtime

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-18 07:41:35 -05:00
Enrique Belarte Luque 09f1638c3c
Add intel-bootc multistage Containerfile
Adds different steps for building required libraries, packages and dependencies for Intel Habanalabs

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-18 04:47:22 -05:00
Eli Elgaev ddb0be4b2f Added BASEIMAGE argument to driver-toolkit make target.
Signed-off-by: Eli Elgaev <eelgaev@redhat.com>
2024-09-17 16:56:39 +03:00
Eli Elgaev 838140abff Fixed a typo on driver-toolkit make target.
Signed-off-by: Eli Elgaev <eelgaev@redhat.com>
2024-09-17 16:56:39 +03:00
Daniel J Walsh 53ef429704
Merge pull request #780 from enriquebelarte/intel-bootc
Add workaround and update for intel-bootc
2024-09-16 11:37:42 -04:00
Daniel J Walsh 0d6072203b
Merge pull request #783 from containers/renovate/auto-merged-updates
chore(deps): update dependency urllib3 to v2.2.3
2024-09-16 11:36:42 -04:00
Daniel J Walsh bb78ca7669
Merge pull request #784 from relyt0925/python-ssl-control
Update environment preservation for Podman with python https ca control variables
2024-09-16 11:36:13 -04:00
Daniel J Walsh c690357f2f
Merge pull request #782 from fabiendupont/bootc-add-git-package
Bootc - Add git and git-lfs packages
2024-09-16 11:34:14 -04:00
Daniel J Walsh 04bbc25990
Merge pull request #781 from javipolo/cleanup_clouds
Remove duplicate packages
2024-09-16 11:33:27 -04:00
Tyler Lisowski 160997482a Update environment preservation for Podman with python https ca control variables
Add SSL_CERT_FILE and SSL_CERT_DIR to the preserved environment variables and ensure they are passed to Podman. This change ensures that SSL certificates are correctly handled within the container environment.

Signed-off-by: Tyler Lisowski <lisowski@us.ibm.com>
2024-09-16 09:59:31 -04:00
Platform Engineering Bot 423c4f52cf chore(deps): update dependency urllib3 to v2.2.3
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-09-16 00:04:29 +00:00
Fabien Dupont 3c6b84b12f Bootc - Add git and git-lfs packages
When working with AI/ML recipes, it is frequent to pull versioned
software and data from Git repositories. This change adds the `git`
and `git-lfs` packages.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-09-13 02:18:20 -04:00
Javi Polo 2fc29101d0
Remove duplicate packages
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-11 13:43:08 +02:00
Enrique Belarte Luque 1b55651d51
Add workaround and update for intel-bootc
Added workaround for libdnf,hl-smi binary and ilab wrapper.
Also added duplicated directory for common files working with Konflux CI.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-09-10 07:39:43 -05:00
Daniel J Walsh 185a957ec6
Merge pull request #779 from containers/renovate/auto-merged-updates
chore(deps): update dependency safetensors to v0.4.5
2024-09-09 08:41:14 -04:00
Platform Engineering Bot 2a3f188e43 chore(deps): update dependency safetensors to v0.4.5
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-09-09 02:43:35 +00:00
Javi Polo 2800b24ece
Merge pull request #778 from javipolo/cleanup_clouds
Remove already present symlinks for cloud services
2024-09-07 21:59:27 +02:00
Javi Polo b8bb85f840
Remove already present symlinks for cloud services
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-06 15:49:14 +02:00
Gregory Pereira ca3e16910b
Merge pull request #777 from pastequo/fix/cloud-build
fix(cloud): Workaround to avoid permission denied while building
2024-09-05 08:26:13 -07:00
Matthieu Bernardin d59dd733c9
fix(cloud): Workaround to avoid permission denied while building
Signed-off-by: Matthieu Bernardin <mbernard@redhat.com>
2024-09-05 16:08:54 +02:00
Daniel J Walsh 07a62ba8c7
Merge pull request #776 from javipolo/add_azure_to_examples
List all supported clouds in the README
2024-09-04 09:42:51 -04:00
Javi Polo 4096313598
List all supported clouds in the README
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-04 15:17:36 +02:00
Daniel J Walsh c05cd05d4a
Merge pull request #775 from javipolo/ibmcloud
Add cloud image for IBM Cloud
2024-09-04 08:53:08 -04:00
Javi Polo 85fc8275bd
Add cloud image for IBM Cloud
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-04 12:54:42 +02:00
Liora Milbaum d0bb62cc9e
Merge pull request #773 from containers/renovate/auto-merged-updates
Update Auto merged updates
2024-09-04 10:28:25 +03:00
Platform Engineering Bot 6066dd485b Update Auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-09-03 21:03:45 +00:00
Daniel J Walsh e96a0a94a5
Merge pull request #772 from javipolo/cloud-providers
Add customizations per cloud provider
2024-09-03 16:34:41 -04:00
Daniel J Walsh 2d03084179
Merge pull request #774 from fabiendupont/amd-bootc-update-to-rocm-6.2
Update amd-bootc to AMD ROCm 6.2
2024-09-03 10:54:17 -04:00
Javi Polo e7e7c96f59
Add customizations per cloud provider
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-09-03 12:39:41 +02:00
Fabien Dupont 21d985fd76 Update amd-bootc to AMD ROCm 6.2
This change updates the version of AMD ROCm to 6.2 in the amd-bootc
image for training. With this new version, the `rocm-smi` package is
replaced by the `amd-smi` package.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-09-03 02:55:51 -04:00
Daniel J Walsh fc758b5b8d
Merge pull request #767 from yevgeny-shnaidman/yevgeny/amd-bootc-6.1.2
updating AMD  bootc image
2024-08-29 06:43:44 -04:00
Daniel J Walsh 9f06613189
Merge pull request #768 from tiran/update-gaudi-1.17.1-40
Update Gaudi to latest release 1.17.1-40
2024-08-28 13:42:52 -04:00
Yevgeny Shnaidman 8c51b1bcd3
Merge pull request #1 from fabiendupont/amd-bootc-use-out-of-tree-drivers
Remove source stage for amd-bootc
2024-08-28 10:45:30 +03:00
Christian Heimes 519a59b89c Update Gaudi to latest release 1.17.1-40
1.17.1-40 was released on 2024-08-23.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
2024-08-27 17:23:01 +02:00
Fabien Dupont d33c8cba3b Remove source stage for amd-bootc
The multi-stage build has too many stages. During the installation of
the `amggpu-dkms` package, the modules are built and installed in
`/lib/modules/${KERNEL_VERSION}`. If the installation of the package is
done in the `driver-toolkit` image, the extra dependencies are very
limited. This change removes the `source` stage and installs the
`amdgpu-dkms` package on top of `driver-toolkit`.

The `amdgpu-dkms` packages installs the modules in
`/lib/modules/${KERNEL_VERSION}/extra` and these are the only modules in
that folder. The `amdgpu-dkms-firmware` package is installed as a
dependency of `admgpu-dkms` and it installs the firwmare files in
`/lib/firmware/updates/amdgpu·`. So, this change removes the in-tree
`amdgpu` modules and firmware, then copies the ones generated by DKMS in
the `builder` stage.

The change also moves the repository definitions to the `repos.d` folder
and adds the AMD public key to verify the signatures of the AMD RPMs.

The users call a wrapper script called `ilab` to hide the `instructlab`
container image and the command line options. This change copies the
file from `nvidia-bootc` and adjusts the logic. The main change is that
`/dev/kfd` and `/dev/dri` devices are passed to the container, instead
of `nvidia.com/gpu=all`. The `ilab` wrapper is copied in the `amd-bootc`
image.

The Makefile is also modified to reflect these changes.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-27 08:23:46 -04:00
Yevgeny Shnaidman 062841f724 updating AMD bootc image
1) using OOT driver and firmware instead of in-tree
2) moving to DKMS and ROCM 6.1.2 version

Signed-off-by: Yevgeny Shnaidman <yshnaidm@redhat.com>
2024-08-26 19:50:42 +03:00
Daniel J Walsh 87be4b4e0c
Merge pull request #765 from omertuc/main
ilab-wrapper: remove outdated comment
2024-08-21 06:41:21 -04:00
Omer Tuchfeld cf8d5fa716 ilab-wrapper: remove outdated comment
The comment is no longer relevant since we changed the way we pass
environment variables to the container.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-08-21 12:04:47 +02:00
Jason T. Greene 954071b9d1
Merge pull request #764 from javipolo/revert-derived-container 2024-08-20 06:45:10 -05:00
Javi Polo d89ad9dede
RHELAI-969: Revert "Fix long container startup times"
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-20 11:36:48 +02:00
melodyliu1986 e82e739618
Add the huggingface token parameter, and modify the file path in llama.cpp repo. (#761)
Signed-off-by: Song Liu <soliu@redhat.com>
Co-authored-by: Song Liu <soliu@redhat.com>
2024-08-19 11:31:40 -04:00
Daniel J Walsh f6042944c2
Merge pull request #763 from n1hility/launch-perf
Fix long container startup times
2024-08-19 08:36:10 -04:00
Jason T. Greene 2f2d608f71 Fix long container startup times
The use of a uid map leads to a new layer with all files chowned.
This takes several seconds due to the size of the instructlab
container (26GB). Normally this would be a one time cost where
the idmap layer is cached and reusued accross container creations;
however, since the container is stored on a read-only additional
image store, no caching is performed.

Address the problem by creating a derived empty contianer in
mutable container storage. This allows the 1k idmap layer to be
created in the smae area, yet reuses the layers in additional
image store.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-08-19 02:08:08 +00:00
Daniel J Walsh b9aaba60c2
Merge pull request #757 from enriquebelarte/remove-retag
Remove retagging from ilab image
2024-08-16 06:15:48 -04:00
Daniel J Walsh 925607f9b3
Merge pull request #760 from axel7083/fix/update-backend-field
fix: backend property value
2024-08-16 06:14:58 -04:00
Liora Milbaum b90b59de2a
Merge pull request #759 from fabiendupont/nvidia-bootc-modify-fabricmanager-condition
Modify condition on NVIDIA FabricManager service
2024-08-14 16:09:34 +03:00
Fabien Dupont 9e8e131e29 Modify condition on NVIDIA FabricManager service
The `/dev/nvswitchctl` device is created by the NVIDIA Fabric Manager
service, so it cannot be a condition for the `nvidia-fabricmanager`
service.

Looking at the NVIDIA driver startup script for Kubernetes, the actual
check is the presence of `/proc/driver/nvidia-nvswitch/devices` and the
fact that it's not empty [1].

This change modifies the condition to
`ConditionDirectoryNotEmpty=/proc/driver/nvidia-nvswitch/devices`, which
verifies that a certain path exists and is a non-empty directory.

[1] https://gitlab.com/nvidia/container-images/driver/-/blob/main/rhel9/nvidia-driver?ref_type=heads#L262-269

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-14 08:26:16 -04:00
axel7083 2afdf5791a
fix: restore backend as an array for compatibility
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-14 14:25:59 +02:00
axel7083 2d16c137e6
fix: backend property value
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-14 14:10:47 +02:00
Daniel J Walsh 0ba38e07b1
Merge pull request #749 from axel7083/chore/tag-on-release
chore: tag model_servers images on release
2024-08-13 06:19:33 -04:00
Daniel J Walsh 346e1a1d57
Merge pull request #755 from javipolo/image_builder_remove_arch
Move --target-arch to image builder args
2024-08-13 06:16:04 -04:00
Enrique Belarte Luque ddda98a7f5
Remove retagging from ilab image
Retag is not needed as we are using static tags

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-08-13 04:10:37 -05:00
Javi Polo d2b6e806f2
Move --target-arch to image builder args
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-12 22:24:02 +02:00
Daniel J Walsh 18a6ad601e
Merge pull request #754 from javipolo/hardcode_xdg_runtime_dir_path
RHELAI-869: Hardcode XDG_RUNTIME_DIR path in case the variable does not exist
2024-08-12 13:41:26 -04:00
axel7083 2130f92cc6
chore: tag model_servers images on release
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>

fix: missing $

Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-12 15:38:10 +02:00
Daniel J Walsh 6c088a00b1
Merge pull request #750 from maysunfaisal/update-rag-2
Configure model for the rag recipe
2024-08-12 09:31:15 -04:00
Daniel J Walsh 5671010776
Merge pull request #753 from axel7083/chore/adding-markdown-file-input
chore(summarizer): adding markdown type file input
2024-08-12 09:29:43 -04:00
Javi Polo 6ad879874a
RHELAI-869: Hardcode XDG_RUNTIME_DIR path in case the variable does not exist
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-12 12:39:08 +02:00
axel7083 4f0ecc8f6a
fix: file type check
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-12 10:15:37 +02:00
axel7083 ce2ccb1fbc
chore(summarizer): adding markdown type file input
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-12 09:48:48 +02:00
Liora Milbaum b61c9089f7
Merge pull request #751 from fabiendupont/nvidia-add-package-with-firmwares
NVIDIA - Add the nvidia-driver package
2024-08-12 09:06:30 +03:00
Liora Milbaum 7f1d79d11a
Merge pull request #752 from n1hility/pids-limit
fix: resolve fork failures during training runs
2024-08-12 07:53:15 +03:00
Jason T. Greene ac7a55df4d fix: resolve fork failures during training runs
torchrun jobs create a number of children per GPU which can
often exceed the 2k limit.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-08-12 04:42:57 +00:00
Fabien Dupont 9cc28ca720 NVIDIA - Add the nvidia-driver package
The `nvidia-driver` package provides the firmware files for the given
driver version. This change removes the copy of the firmware from the
builder step and install the `nvidia-driver` package instead. This also
allows a better tracability of the files in the final image.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-10 02:27:02 -04:00
Maysun J Faisal 3a25158aa3 Configure model for rag recipe
Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
2024-08-09 17:51:01 -04:00
Gregory Pereira 224988970a
Merge pull request #747 from axel7083/patch-2
fix(whispercpp): adding missing ownership to user 1001 in app directory
2024-08-08 16:34:44 -07:00
Daniel J Walsh e0983807cf
Merge pull request #740 from fabiendupont/update-gaudi-to-1.17-0-495
Intel bootc - Update Gaudi drivers to 1.17.0-495
2024-08-08 16:28:12 -04:00
Daniel J Walsh 198d839a6c
Merge pull request #744 from lstocchi/fixTypo
fix: fix image name on chatbot ai-lab.yaml
2024-08-08 16:27:02 -04:00
Daniel J Walsh 42e77cb94f
Merge pull request #745 from javipolo/enforce_insights
RHELAI-838 Enforce insights registration in ilab wrapper
2024-08-08 16:25:51 -04:00
Liora Milbaum ddad8904d7
Merge pull request #746 from pastequo/nvidia-bootc/retag-instructlab-image
feat(nvidia-bootc): Retag instructlab image if INSTRUCTLAB_IMAGE_RETAG is specified
2024-08-08 19:57:46 +03:00
Javi Polo 25b36d83fd
RHELAI-838 Enforce insights registration in ilab wrapper~
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-08 18:04:12 +02:00
axel7083 beb3b12de7
fix(whisper_cpp): missing ownership
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-08 16:08:25 +02:00
axel7083 593bed4eb0
fix(whispercpp): set app ownership to user 1001
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-08 16:08:25 +02:00
Matthieu Bernardin 3d588a6ded
feat(nvidia-bootc): Retag instructlab image if INSTRUCTLAB_IMAGE_RETAG is specified
Signed-off-by: Matthieu Bernardin <mbernard@redhat.com>
2024-08-08 15:34:57 +02:00
lstocchi 5aed7d3a56
fix: fix image name on chatbot ai-lab.yaml
Signed-off-by: lstocchi <lstocchi@redhat.com>
2024-08-08 14:17:42 +02:00
Fabien Dupont 0d6716c583 Intel bootc - Update Gaudi drivers to 1.17.0-495
Intel has released the version `1.17.0-495` of their Gaudi drivers. They
are available explicitly for RHEL 9.4 with a new `9.4` folder in the RPM
repository. This change updates the arguments to use the new version
from the new repository folder.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-08 05:10:01 -04:00
Javi Polo acb2b5d2e7
Merge pull request #736 from fabiendupont/get-kernel-version-from-bootc-image
Driver Toolkit: Get kernel version from bootc image
2024-08-08 10:57:03 +02:00
Fabien Dupont 78c57fecdf Driver Toolkit: Get kernel version from bootc image
When building the `driver-toolkit` image, It is cumbersome to find kernel
version that matches the future `nvidia-bootc` and `intel-bootc` images.
However, the kernel version is stored as a label on the `rhel-bootc`
images, which are exposed as the `FROM` variable in the Makefile.

This change collects the kernel version using `skopeo inspect` and `jq`.

The `DRIVER_TOOLKIT_BASE_IMAGE` variable is introduced in the Makefile
to dissociate it from the `FROM` variable that is used as the `nvidia-bootc`
and `intel-bootc` base image.

The user can now specify something like:

```shell
make nvidia-bootc \
    FROM=quay.io/centos-bootc/centos-bootc:stream9 \
    DRIVER_TOOLKIT_BASE_IMAGE=quay.io/centos/centos:stream9
```

Also, the `VERSION` variable in `/etc/os-release` is the full version, so
this change modifies the command to retrieve the `OS_VERSION_MAJOR`
value.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-08 02:56:27 -04:00
Gregory Pereira 198a13fdfc
Merge pull request #738 from javipolo/revert_insights_check
Revert "Enforce users to use insights"
2024-08-07 09:34:56 -07:00
Javi Polo 8c95438858
Revert "Enforce users to use insights"
This reverts commit d11890afb0.

Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-07 18:27:02 +02:00
Daniel J Walsh 102dc0106a
Merge pull request #734 from javipolo/insights-check
Enforce users to use insights
2024-08-07 11:51:38 -04:00
Daniel J Walsh ec7de55459
Merge pull request #735 from fabiendupont/fix-nvidia-bootc-driver-build
Fix the retrieval of kernel version, release and dist
2024-08-07 11:50:19 -04:00
Daniel J Walsh 04bccc6162
Merge pull request #730 from omertuc/bash
ilab-wrapper: Improve non-single subuid ranges error handling
2024-08-07 11:48:49 -04:00
Fabien Dupont 8dd087b9b3 Fix the retrieval of kernel version, release and dist
During the build of the out-of-tree drivers, the base image will always
have the `kernel-core` package installed. And the `Makefile` doesn't
pass the `KERNEL_VERSION` argument to the build command. So, it's
simpler to rely on the `kernel-core` package info.

The commands to get the `KREL` and `KDIST` were not working with RHEL
9.4 kernel. The new set of commands has been tested with `ubi9/ubi:9.4`
and `centos/centos:stream9` based driver toolkit image and they return
the correct value. For example, the values returned for the following
kernels are:

* `5.14.0-427.28.1.el9_4` (`ubi9:ubi:9.4`):
 * `KVER`: `5.14.0`
 * `KREL`: `427.28.1`
 * `KDIST`: `.el9_4`
* `5.14.0-427.el9` (`centos/centos:stream9`):
 * `KVER`: `5.14.0`
 * `KREL`: `427`
 * `KDIST`: `.el9`

The `OS_VERSION_MAJOR` argument is also not passed by the `Makefile`,
but we can get it from the `/etc/os-release` file. I'm switching to
grep+sed, because I don't want to load all the other variables.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-07 11:13:19 -04:00
Javi Polo d11890afb0
Enforce users to use insights
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-07 16:23:07 +02:00
Gregory Pereira b2c21f8174
Merge pull request #733 from fabiendupont/fix-nvidia-fabric-manager
Fix NVIDIA FabricManager unit file
2024-08-07 06:29:15 -07:00
Fabien Dupont 7363de42f7 Fix NVIDIA FabricManager unit file
In the `nvidia-bootc` Containerfile, the condition on the existence of
`/dev/nvswitchctl` in the `nvidia-fabricmanager` unit file is not
persisted, because we don't use the `-i` option of `sed`, so the final
image still always tries to load the service. This change adds the `-i`
option to fix this.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-07 07:37:59 -04:00
Omer Tuchfeld ae00e9e8c7 ilab-wrapper: Improve non-single subuid ranges error handling
# Background

df8885777d

# Issue

The current error handling for multiple subuid ranges is broken due to
surprising behavior of `wc -l` which always returns `1` even when the
input is empty.

# Solution

More carefully count the number of lines in the
`CURRENT_USER_SUBUID_RANGE` variable

# Additional changes

50fb00f26f had a small merge error, this
commit fixes that.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-08-07 12:50:24 +02:00
Daniel J Walsh 188aaca941
Merge pull request #732 from omertuc/hooks
hooks: pre-commit hook to duplicate file
2024-08-07 06:39:09 -04:00
Omer Tuchfeld 1892603231 hooks: pre-commit hook to duplicate file
We have a file that's always a duplicate of another file, until we can
get rid of this requirement a pre-commit hook to take care of it would
be nice

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-08-07 12:24:24 +02:00
Daniel J Walsh 55fde6e527
Merge pull request #731 from n1hility/fix-vllm
Fix env passing that leads to failures
2024-08-07 06:19:33 -04:00
Jason T. Greene 83fb0cc3c5 Fix env passing that leads to failures
vLLM fails with empty set values. Adjust the model of env passing to
only set a value if it is defined.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-08-07 08:01:52 +00:00
Daniel J Walsh 15a3dc8d0b
Merge pull request #725 from jhutar/main
feat(KONFLUX-3933): Use rpm to get the value
2024-08-06 06:30:10 -04:00
Daniel J Walsh 66629562fe
Merge pull request #729 from omertuc/norootmap
ilab-wrapper: don't map UIDs if we're already running as root
2024-08-06 06:29:01 -04:00
Omer Tuchfeld 50fb00f26f ilab-wrapper: don't map UIDs if we're already running as root
# Background

See df8885777d

# Issue

Introduced a regression [1] where it's no longer possible to run the script
as root, as the subuid map ends up being empty and this causes an error:

```
Error: invalid empty host id at UID map: [1  1]
```

# Solution

Avoid UID mapping if we're already running as root.

# Motivation

We want to also be able to run the script as root, for example as part
of a systemd service.

[1] RHELAI-798

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-08-06 12:17:18 +02:00
Jan Hutar 49181d2c9b feat(KONFLUX-3933): Use rpm to get the value faster
Signed-off-by: Jan Hutar <jhutar@redhat.com>
2024-08-05 15:07:19 +02:00
Daniel J Walsh cc2447ea86
Merge pull request #726 from javipolo/ilab-auth
RHELAI-787: Mount auth.json into ilab container
2024-08-05 09:00:58 -04:00
Javi Polo 20d7d9ab2d
RHELAI-787: Mount auth.json into ilab container
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-05 14:33:17 +02:00
Daniel J Walsh 701564e62e
Merge pull request #718 from fabiendupont/simplify-driver-toolkit
Require KERNEL_VERSION argument in driver-toolkit
2024-08-05 07:00:13 -04:00
Daniel J Walsh 6edaa8447a
Merge pull request #723 from javipolo/coding_style
Comply with bashate style rules and remove exports
2024-08-05 06:58:46 -04:00
Daniel J Walsh 023faf132e
Merge pull request #703 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-08-05 06:39:38 -04:00
Fabien Dupont 1a16a7afb3 Require KERNEL_VERSION argument in driver-toolkit
The default base image for the Driver Toolkit image is `centos:stream9`.
The original work for Driver Toolkit is in OpenShift and the base image
is `ubi9/ubi`. In bother cases, the images don't have the `kernel`
package installed.

This change adds a test on the `KERNEL_VERSION` argument and exits if
it's not provided at build time. This also ensure that only the
relevant kernel is present when using `centos:stream9` or `ubi9/ubi`
as the base image. And this realigns a bit with the original Driver
Toolkit.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-08-05 06:07:07 -04:00
Javi Polo d238984ce6
Comply with bashate style rules and remove exports
- Set all indenting to 4 spaces (no tabs)
- Use POSIX style function definition in oneliner functions
- Remove unneeded exports on env variables

Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-04 17:16:37 +02:00
Platform Engineering Bot 7e9144deb7 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-08-04 11:03:40 +00:00
Daniel J Walsh f767b292c5
Merge pull request #722 from relyt0925/fix-shm-size
Add environment variables for ilab container and increase shm size for vllm
2024-08-04 06:16:45 -04:00
Tyler Lisowski ea64b863ea Add environment variables for ilab container and increase shm size for vllm to 10GB
Include ILAB_GLOBAL_CONFIG, VLLM_LOGGING_LEVEL, and NCCL_DEBUG as environment variables when starting the ilab container. Also add shared memory size of 10G to enable vllm execution. Resolves: https://github.com/containers/ai-lab-recipes/issues/721

Signed-off-by: Tyler Lisowski <lisowski@us.ibm.com>
2024-08-04 00:25:49 -05:00
Daniel J Walsh 7eae618e81
Merge pull request #713 from omertuc/sudo
ilab-wrapper: Run podman with sudo
2024-08-02 11:23:37 -04:00
Daniel J Walsh 7184630e53
Merge pull request #719 from javipolo/ilab_no_path
Do not hardcode the path to ilab executable
2024-08-02 09:51:27 -04:00
Ryan Cook 1450e588be
Merge pull request #716 from maysunfaisal/update-rag-1
Set group permissions on the /rag/models/ dir
2024-08-02 09:47:07 -04:00
Javi Polo 3c156dceab
Do not hardcode the path to ilab executable
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-08-02 15:27:33 +02:00
Omer Tuchfeld df8885777d ilab-wrapper: Run podman with sudo
# Background

The ilab command is wrapped by an `ilab` script which launches ilab
inside a podman container.

# Issue

Since the ilab container image is pulled during the bootc image build
process using the root user, the image is not accessible to non-root
users.

# Solution

We run the container as sudo in order to be able to access the root
container storage. But for security reasons we map root UID 0 inside the
container to the current user's UID (and all the other subuids to the
user's /etc/subuid range) so that we're effectively running the
container as the current user.

# Additional changes

Changed `"--env" "HOME"` to `"--env" "HOME=$HOME"` to pass the HOME
environment variable from the current shell and not from the sudo
environment.

# Future work

In the future, we will run podman as the current user, once we figure a
reasonable way for the current user to access the root's user container
storage

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-08-02 11:56:28 +02:00
Maysun J Faisal a7b49e6475 Set group permissions on /rag/models/ dir
Signed-off-by: Maysun J Faisal <maysunaneek@gmail.com>
2024-08-01 19:14:00 -04:00
Daniel J Walsh 151cc3bcf1
Merge pull request #714 from rhatdan/content
Update Containerfile
2024-08-01 11:15:26 -04:00
braultatgithub 4b3e572b24
Update Containerfile
small typo.

Thanks to @braultatgithub for pointing this out.

Replaces: https://github.com/containers/ai-lab-recipes/pull/702

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-08-01 11:13:49 -04:00
Daniel J Walsh ee0ac360bd
Merge pull request #708 from omertuc/volume
ilab wrapper: add support for additional mounts
2024-08-01 11:08:45 -04:00
Daniel J Walsh 97e781fe9f
Merge pull request #712 from axel7083/fix/env-prefix-missing
fix(model_server): missing prefix env
2024-08-01 11:06:47 -04:00
Daniel J Walsh a1525396db
Merge pull request #709 from javipolo/ilab_home_override
RHELAI-744 - Use environment variable to override HOME in ilab wrapper
2024-08-01 09:29:52 -04:00
axel7083 5c31bb5acf
fix(model_server): missing prefix env
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-08-01 10:37:02 +02:00
Javi Polo 107f8a9508
RHELAI-744 - Use environment variable to override HOME in ilab wrapper
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-31 16:59:47 +02:00
Omer Tuchfeld 8f71535e1b ilab wrapper: add support for additional mounts
# Background

We have an ilab wrapper script that users will use to launch the ilab
container.

Users may want to mount additional volumes into the container, as they
could possibly have e.g. large models stored in some external storage.

# Problem

Users cannot simply edit the script to add the mounts to the podman
command as it is read-only.

# Solution

Add support for an environment variable that users can set to specify
additional mounts to be added to the podman command. This will allow
users to specify additional mounts without having to modify the script.

# Implementation

The script will now check for the `ILAB_ADDITIONAL_MOUNTS` environment
variable. If it is set, the script will parse the variable as evaluated
bash code to get the mounts. The mounts will then be added to the podman
command.

Example `ILAB_ADDITIONAL_MOUNTS` usage:

```bash
ILAB_ADDITIONAL_MOUNTS="/host/path:/container/path /host/path2:/container/path2"`
```

If your path contains spaces, you can use quotes:

```bash
ILAB_ADDITIONAL_MOUNTS="/host/path:/container/path '/host/path with spaces':/container/path"
```

The latter works because the script uses `eval` to parse the mounts.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-07-31 11:47:17 +02:00
Daniel J Walsh 7409fdca6b
Merge pull request #704 from axel7083/fix/cuda-build
fix(modell_server): deprecated make arguments for llamacpp server
2024-07-30 09:52:59 -04:00
Daniel J Walsh e273eaec86
Merge pull request #707 from omertuc/formatting
ilab wrapper: fix formatting
2024-07-30 09:51:54 -04:00
Omer Tuchfeld 34e60b1702 ilab wrapper: fix formatting
The wrapper had a mixed used of tabs/spaces, making it annoying to edit

Formatted with shfmt to switch to spaces

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-07-30 15:45:51 +02:00
axel7083 f60606d667
Apply suggestion from @Gregory-Pereira
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-07-30 13:11:42 +02:00
axel7083 4054ee7f4b
revert: requirements.txt
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-07-30 13:11:42 +02:00
axel7083 d32a55ebcf
chore: update pip package
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-07-30 13:11:42 +02:00
axel7083 36a32983ea
fix: replace deprecated LLAMA_CUBLAS with GGML_CUDA argument
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-07-30 13:11:41 +02:00
Daniel J Walsh f9ed8bbcbd
Merge pull request #693 from axel7083/patch-1
fix(run.sh): invalid bash formatting
2024-07-26 11:14:50 -04:00
Daniel J Walsh a508f36373
Merge pull request #691 from yangcao77/main
fix the photo upload issue in object detection app
2024-07-25 19:39:15 -04:00
Gregory Pereira 340d7f538b
Merge pull request #701 from pastequo/nvidia-bootc/fix/pull-secret-command
fix(nvidia-bootc): Use INSTRUCTLAB_IMAGE_PULL_SECRET in podman pull command
2024-07-25 10:49:57 -07:00
Matthieu Bernardin c05f23aad5
fix(nvidia-bootc): Use INSTRUCTLAB_IMAGE_PULL_SECRET in podman pull command
Signed-off-by: Matthieu Bernardin <mbernard@redhat.com>
2024-07-25 19:47:16 +02:00
Daniel J Walsh 85249c0d6b
Merge pull request #699 from pastequo/nvidia-bootc/fix/pull-secret
feat(nvidia-bootc): Introduce INSTRUCTLAB_IMAGE_PULL_SECRET
2024-07-25 11:29:12 -04:00
Daniel J Walsh f3cd9b5e5b
Merge pull request #700 from javipolo/split-bootc-targets
Split main targets into instructlab + bootc target
2024-07-25 11:27:59 -04:00
Matthieu Bernardin 735c8bd907
feat(nvidia-bootc): Introduce INSTRUCTLAB_IMAGE_PULL_SECRET as build-arg for Konflux build
Signed-off-by: Matthieu Bernardin <mbernard@redhat.com>
2024-07-25 17:24:10 +02:00
Gregory Pereira a7b41d1130
Merge pull request #696 from pastequo/nvidia-bootc/feat/remove-makefile-step
nvidia-bootc: Duplicate common lib & ilab, to avoid an intermediate makefile target
2024-07-25 08:19:28 -07:00
Javi Polo 0e8db9f2d2
Split main targets into instructlab + bootc target
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-25 17:01:57 +02:00
Matthieu Bernardin cc5c4d7ffe
chore(nvidia-bootc): Dupplicate ilab & common usr/lib to build in Konflux without running makefile targets 2024-07-25 16:48:13 +02:00
Daniel J Walsh f6ed0b31fc
Merge pull request #695 from kwozyman/rpm-args
Add support for changing Vendor and Buildhost for the driver RPM
2024-07-25 09:54:00 -04:00
Daniel J Walsh 7df349f701
Merge pull request #697 from omertuc/exec
ilab wrapper: `exec` for better signal handling / termination
2024-07-25 09:53:04 -04:00
Omer Tuchfeld 0f42ca1ca0 ilab wrapper: `exec` for better signal handling / termination
If the wrapper script is killed, the container will be left running.
Instead of just running the command, use `exec` to replace the
wrapper script with the command, so that the command will receive
the same signals as the wrapper script and the container will be
terminated as expected.

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-07-25 15:28:14 +02:00
Costin Gamenț 57a9745c1f Add support for changing Vendor and Buildhost for the driver RPM
Signed-off-by: Costin Gamenț <cgament@redhat.com>
2024-07-25 15:15:21 +02:00
axel7083 5745071374
Update run.sh
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-07-24 18:28:10 +02:00
Stephanie 860393ea8b fix the photo upload issue
Signed-off-by: Stephanie <yangcao@redhat.com>
2024-07-24 10:53:36 -04:00
Daniel J Walsh 55610a8c90
Merge pull request #689 from javipolo/upgrade-informer-service
RHELAI-429: Adding upgrade informer service
2024-07-23 15:09:57 -04:00
Daniel J Walsh 577248bdee
Merge pull request #688 from rhatdan/skopeo
add skopeo so that ilab model download will work
2024-07-23 15:07:32 -04:00
Igal Tsoiref 5362188b72
RHELAI-429: Adding upgrade informer service
Upgrade informer will run every couple of our and will be triggered by
systemd timer.

In order to start it on boot and run once i enabled it and timer.
Disabling auto upgrade service in order to remove unexpected reboots.

Service will run "bootc upgrade --check" and in case new version exists
it will create motd file with upgrade info.

Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-23 20:18:38 +02:00
Daniel J Walsh 22889a2fd4
Merge pull request #690 from javipolo/remove-bootc-generic-growpart
RHEL-33208: Remove custom bootc-generic-growpart
2024-07-23 14:14:16 -04:00
Javi Polo 2e57b358ab
RHEL-33208: Remove custom bootc-generic-growpart
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-23 15:07:54 +02:00
Daniel J Walsh 1b044088a9
Merge pull request #687 from rhatdan/ilab
We do not use the ilab target in Containerfiles
2024-07-22 12:22:02 -04:00
Jeremy Eder aa1ede8f89 add skopeo so that ilab model download will work
While skopeo maybe part of the base image, there is no
guarantee, and as long as ilab requires it, we should
make sure it is installed.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-07-22 11:21:21 -04:00
Dan Walsh 0b5a769525 We do not use the ilab target in Containerfiles
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-07-22 11:11:53 -04:00
Daniel J Walsh 0c5d7f71c3
Merge pull request #685 from containers/renovate/auto-merged-updates
Update dependency numpy to v2.0.1
2024-07-22 08:21:01 -04:00
Platform Engineering Bot c38316de23 Update dependency numpy to v2.0.1
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-07-22 11:16:02 +00:00
Daniel J Walsh 2202bd6b77
Merge pull request #686 from eranco74/home
ilab wrapper script adjustments
2024-07-22 05:46:01 -04:00
Daniel J Walsh 38092ab1dd
Merge pull request #681 from johnmcollier/whispercppgid
Set group permissions on whispercpp app folder
2024-07-22 05:43:40 -04:00
Eran Cohen 9de79e561a ilab wrapper script adjustments
Background

RHEL AI ships with a script in `/usr/bin` called `ilab` which
makes running `ilab` commands feel native even though they're actually
running in a podman container

Issues

The abstraction becomes leaky once you start dealing with paths.
The user thinks it's local paths, but it's actually paths inside the pod,
and if the user is doing any action with a path that's not mounted inside the pod,
files persisted to that path will not persist across ilab wrapper invocations

Examples:
1. ilab config init outputs:
Generating `/root/.config/instructlab/config.yaml`...
Initialization completed successfully, you're ready to start using `ilab`. Enjoy!
But:
ls /root/.config/instructlab/config.yaml
ls: cannot access '/root/.config/instructlab/config.yaml': Permission denied

2. User provided paths e.g.:
ilab config init --model-path...
ilab model download --model-dir=...

The path may not be mounted to the host and the data is written to overlay fs and gone when the conatiner dies

Solution

Mount the user HOME direcotry and set the HOME inside the conainer
This seems to resolve the abouve issues as long the user provided paths
are nested under the user HOME direcotry

Signed-off-by: Eran Cohen <eranco@redhat.com>
2024-07-22 12:03:58 +03:00
Daniel J Walsh 5378fb0365
Merge pull request #682 from tsorya/igal/disable
RHELAI-524: Disable bootc auto upgrade service
2024-07-21 07:00:33 -04:00
Daniel J Walsh ca35deb154
Merge pull request #683 from javipolo/allow_instructlab_override
Allow INSTRUCTLAB_IMAGE value override
2024-07-21 06:59:11 -04:00
Daniel J Walsh 7aee0bb5ff
Merge pull request #651 from containers/renovate/auto-merged-updates
Update Auto merged updates
2024-07-20 06:24:23 -04:00
Platform Engineering Bot 1819201b50 Update Auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-07-20 09:04:15 +00:00
Javi Polo 15a8da9b83
Allow INSTRUCTLAB_IMAGE value override
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-19 13:35:11 +02:00
John Collier 86433985f0 Use COPY --chown instead
Signed-off-by: John Collier <jcollier@redhat.com>
2024-07-18 09:49:45 -04:00
Igal Tsoiref 0d352b0712 RHELAI-524: Disable bootc auto upgrade service
Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-18 13:15:07 +03:00
Liora Milbaum 48eabdd864
Merge pull request #680 from omertuc/wrapper
`ilab` wrapper script adjustments
2024-07-18 12:29:57 +03:00
Liora Milbaum a6dd048193
Merge pull request #679 from tsorya/igal/rhel_ai_version
Changing os-release file parameter from BUILD_ID to RHEL_AI_VERSION
2024-07-17 21:26:43 +03:00
John Collier d029ebacb0 Set group permissions on whispercpp app folder
Signed-off-by: John Collier <jcollier@redhat.com>
2024-07-17 12:54:14 -04:00
Omer Tuchfeld 262758829a `ilab` wrapper script adjustments
Ticket [RHELAI-442](https://issues.redhat.com/browse/RHELAI-442)

# Background

RHEL AI ships with a script in `/usr/local/bin` called `ilab` which
makes running `ilab` commands feel native even though they're actually
running in a podman container

# Issues

* The script is outdated / used several different container images for
different purposes, while it should be just using the single instructlab
image

* The volume mounts were incorrect, as instructlab now uses XDG paths

* Unnecessary directory creation for `HF_CACHE`

* Unnecessary GPU count logic

* Script has unnecessary fiddling of `ilab` parameters, essentially creating a
  UX that deviates from the natural `ilab` CLI

# Solutions

* Changed script to use the single container image `IMAGE_NAME` (this
  was already the case mostly, except for old references to `LVLM_NAME`
  and `TRAIN_NAME` which no longer get replaced leading to a broken `PODMAN_COMMAND_SERVE`.
  Also adjusted entrypoint to use the `ilab` executable in the pyenv

* Will now mount the host's `~/.config` and `~/.local` into the
  container's corresponding directories, for `instructlab` to use
  and for its config / data to persist across invocations

* Will now mount `~/.cache` into the container's corresponding `.cache`
  directory, so that the information stored in the default `HF_CACHE` is
  also persisted across invocations

* Removed unnecessary GPU count logic

* Removed all parameter parsing / fiddling

# Other changes

Added secret/fake "shell" `ilab` subcommand which opens a shell in the
wrapper's container, useful for troubleshooting issues with the wrapper
itself

Signed-off-by: Omer Tuchfeld <omer@tuchfeld.dev>
2024-07-17 17:09:33 +02:00
Igal Tsoiref 9d175ab5d9 Changing os-release file parameter from BUILD_ID to RHEL_AI_VERSION_ID as
it matches much better.
Changing the way we set image_version_id label, in order for it to work in
konflux we should use LABEL in container file

Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-17 16:54:00 +03:00
Gregory Pereira 28ee9a81df
Merge pull request #675 from tsorya/igal/rhel_ai_version
In order set release version on upgrade we must override /usr/lib/os-release
2024-07-14 09:52:24 -07:00
Igal Tsoiref 0fa8d5db67 In order set release version on upgrade we must override
/usr/lib/os-release file and not /etc/os-release that is symlink to /usr/lib/os-release

Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-14 18:35:01 +03:00
Liora Milbaum aa7d470ee4
Merge pull request #673 from tsorya/igal/rhel_ai_version
Fixing nvidia container file
2024-07-14 16:36:48 +03:00
Igal Tsoiref b497531c12 Fixing nvidia container file
Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-14 15:16:43 +03:00
Liora Milbaum 3168496f83
Merge pull request #665 from tsorya/igal/rhel_ai_version
RHELAI-473: Adding rhel ai version
2024-07-14 14:31:26 +03:00
Michael Dawson b057fb0efe feat: add JavaScript/Node.js based chatbot recipe
Signed-off-by: Michael Dawson <mdawson@devrus.com>
2024-07-12 18:07:18 -04:00
Daniel J Walsh 3cab84caa3
Merge pull request #672 from ralphbean/whats-in-a-name
Switch PROVIDER name to HARDWARE
2024-07-12 13:58:51 -04:00
Ralph Bean cf0b33ec86
Switch PROVIDER name to HARDWARE
This better reflects its role.

Signed-off-by: Ralph Bean <rbean@redhat.com>
2024-07-12 12:28:12 -04:00
Daniel J Walsh 56ba5657db
Merge pull request #671 from ralphbean/label-args
Add vendor label and arg to all containerfiles
2024-07-12 10:09:37 -04:00
Ralph Bean 3f010293e0
Provide mechanism through Makefiles to set vendor label
Of note, there was already a use of a "VENDOR" word to describe the
accelerator or provider (amd, intel, nvidia, etc..). I renamed that
in order to make room for this new use of VENDOR.

Signed-off-by: Ralph Bean <rbean@redhat.com>
2024-07-12 10:04:34 -04:00
Ralph Bean ad2d008314
Reformat to make future edits more straightforward
Signed-off-by: Ralph Bean <rbean@redhat.com>
2024-07-12 10:04:29 -04:00
Igal Tsoiref e7bd5e3c62 Adding rhel ai version
Set github hash by defautl as image version.
Add RHEL_AI_VERSION into /etc/os-release in order to use it in
insights

Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-12 15:46:19 +03:00
Ralph Bean f298fb684a
Add vendor label and arg to all containerfiles
So that downstream vendors can indicate themselves on their builds.

Signed-off-by: Ralph Bean <rbean@redhat.com>
2024-07-11 18:45:04 -04:00
Daniel J Walsh 6deab0f6b8
Merge pull request #669 from javipolo/fix_ssh_key
Fix SSH_PUBKEY expansion into build-arg
2024-07-11 14:42:13 -04:00
Javi Polo 2bafcd529e
Fix SSH_PUBKEY expansion into build-arg
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-11 20:27:06 +02:00
Gregory Pereira 5f5e6d0c25
Merge pull request #668 from javipolo/kernel_version_check
Check for driver and kernel version mismatch
2024-07-11 10:50:49 -07:00
Javi Polo 0ae96f7df1
Check for driver and kernel version mismatch
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-11 19:15:26 +02:00
Daniel J Walsh 3d1ae62b07
Merge pull request #667 from enriquebelarte/dtk-workaround
Add temp workaround for libdnf
2024-07-11 11:33:19 -04:00
Enrique Belarte Luque fdc948ac98
Add temp workaround for libdnf
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-07-11 10:20:44 -05:00
Daniel J Walsh 241e0e4465
Merge pull request #662 from fabiendupont/make-fabricmanager-conditional
Enable NVIDIA services in the bootc image
2024-07-10 06:37:37 -04:00
Daniel J Walsh 266831d92c
Merge pull request #661 from javipolo/ilab_wrapper_executable
Make sure ilab wrapper is executable and in path
2024-07-10 06:35:45 -04:00
Daniel J Walsh c989117ca4
Merge pull request #660 from containers/fix-testing-framework
fix testing-framework
2024-07-10 06:34:55 -04:00
Daniel J Walsh a2977733f2
Merge pull request #664 from jeffmaury/GH-654
fix: typo in object detection README
2024-07-10 06:34:34 -04:00
Jeff MAURY 0782f7e0ff
fix: typo in object detection README
Fixes #654

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-07-10 11:59:01 +02:00
sallyom 1ed1d0d61e fix testing-framework
Signed-off-by: sallyom <somalley@redhat.com>
2024-07-09 08:36:52 -04:00
Fabien Dupont 2b6cac5c3f Enable NVIDIA services in the bootc image
The `nvidia-persistenced` and `nvidia-fabricmanager` services should be
started on machines with NVIDIA devices. Fabric Manager is only needed
on machines with an NVLink switch, so we patch it to start only if
/dev/nvswitchctl is present.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-07-09 05:37:20 -04:00
Javi Polo 2d269cfbf6
Make sure ilab wrapper is executable and in path
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-07-08 20:21:39 +02:00
Daniel J Walsh 94651295b9
Merge pull request #659 from tsorya/igal/insights
Adding rhc for telemetry
2024-07-08 12:40:04 -04:00
Igal Tsoiref 274a840c89 Adding rhc connect for telemetry
Signed-off-by: Igal Tsoiref <itsoiref@redhat.com>
2024-07-07 17:21:19 +03:00
Liora Milbaum 67e8135002
Merge pull request #653 from fabiendupont/nvidia-align-driver-and-cuda
Update NVIDIA driver and CUDA in nvidia-bootc
2024-07-04 15:33:00 +03:00
Liora Milbaum 610d8ece3b
Merge pull request #656 from ralphbean/pull-with-auth
Pull instructlab image with auth, if provided
2024-07-03 15:34:03 +03:00
Ralph Bean 9494909d6c
Pull instructlab image with auth, if provided
Upstream, this image can be pulled unauthenticated, but in other
environments a user might want to include an image that exists in some
repository that requires authentication to pull.

The person building the image needs to provide
`--secret=id=instructlab-nvidia-pull/.dockerconfigjson,src=instructlab-nvidia-pull/.dockerconfigjson`
when building the image in order to make the secret available.

Signed-off-by: Ralph Bean <rbean@redhat.com>
2024-07-02 15:38:02 -04:00
Fabien Dupont 0548faf9b5 Update NVIDIA driver and CUDA in nvidia-bootc
For the InstructLab image, we use NVIDIA driver version `550.90.07` with
CUDA `12.4.1`, so this change updates the versions in the bootc image to
align the stack.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-07-02 08:52:44 -04:00
Daniel J Walsh aee1c80b7c
Merge pull request #652 from Gregory-Pereira/add-ai-lab-recipes-logo
adding logo to assets and readme
2024-07-02 05:40:23 -04:00
greg pereira f16215655f
adding logo to assets and readme
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-07-01 19:05:53 -07:00
Daniel J Walsh acc9a34ab0
Merge pull request #650 from cgwalters/workaround-link
Workaround hardlinked /etc changes
2024-07-01 05:55:16 -04:00
Colin Walters 0b5b374537 Workaround hardlinked /etc changes
This (not tested locally) change should work around
https://github.com/containers/bootc/issues/637

It's all tricky because you'll only again see this when using
the `vfs` backend. The `overlay` backend always breaks hardlinks.
For more, see e.g. https://github.com/ostreedev/ostree-rs-ext/pull/408

Signed-off-by: Colin Walters <walters@verbum.org>
2024-06-30 10:50:35 -04:00
Gregory Pereira 5875d908ea
Merge pull request #648 from containers/fixing-testing-framework
remove checkout with path so pathing is fixed
2024-06-27 18:21:24 -07:00
greg pereira a4bbf6cd55
remove checkout with path so pathing is fixed
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-27 18:20:23 -07:00
Daniel J Walsh 5462be9632
Merge pull request #634 from lstocchi/fixMakefile
fix: add build_vulkan commands for amd64/arm64 on Makefile
2024-06-27 14:45:04 -04:00
Daniel J Walsh aa0e2e4cd6
Merge pull request #642 from rhatdan/makefile
Primary training Makefile should not include common
2024-06-27 14:42:09 -04:00
Daniel J Walsh b1bd183b3f
Merge pull request #647 from rhatdan/bootc
Remove training images from ailab-images.md
2024-06-27 14:41:49 -04:00
Daniel J Walsh 71224cec78
Remove training images from ailab-images.md
We are not currently making these images available.

Fixes: https://github.com/containers/ai-lab-recipes/issues/643

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-27 12:01:27 -04:00
Gregory Pereira 624155c699
Merge pull request #646 from javipolo/fix_RUN_in_containerfiles
Remove comment from chained commands in RUN statement
2024-06-27 08:08:12 -07:00
Javi Polo 21c32e4e85
Remove comment from chained commands in RUN statement
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-27 16:26:16 +02:00
Dan Walsh d830a37cc0 Primary training Makefile should not include common
Along with some other cleanups.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-27 09:15:04 -04:00
Daniel J Walsh e8c3f16fee
Merge pull request #637 from javipolo/fix_dtk
Exclude kernel packages from dnf update
2024-06-27 08:47:50 -04:00
Daniel J Walsh e7a56081e0
Merge pull request #639 from n1hility/slim-models
Slim models to Granite LAB
2024-06-27 07:43:39 -04:00
lstocchi 379418666c
fix: add build_vulkan commands for amd64/arm64 on Makefile
Signed-off-by: lstocchi <lstocchi@redhat.com>
2024-06-27 09:51:15 +02:00
Javi Polo 8a185aee61
Exclude kernel packages from dnf update
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-27 09:45:59 +02:00
Jason T. Greene 2b1ca94c31 Slim models to Granite LAB
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-06-27 02:29:37 -05:00
Daniel J Walsh ae4b4510c5
Merge pull request #638 from javipolo/fix_backslash
Add missing trailing backslash
2024-06-26 15:48:11 -04:00
Javi Polo fa60e10f40
Add missing trailing backslash
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-26 21:17:17 +02:00
Ryan Cook 629c3e59c7
Merge pull request #635 from enriquebelarte/add-check-dtk
Add check for installed kernel-core
2024-06-26 11:38:51 -04:00
Enrique Belarte Luque ff8b344bf9
Add check for installed kernel-core
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-26 10:30:33 -05:00
Daniel J Walsh 321653e3fd
Merge pull request #633 from n1hility/drop-cloud-targets
Drop cloud targets which were unintentionally resurrected
2024-06-26 10:12:15 -04:00
Jason T. Greene fef3d87459 Drop cloud targets which were unintentionally resurrected
Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-06-26 08:34:16 -05:00
Gregory Pereira 3d2643048b
Merge pull request #611 from n1hility/model-improvements
Fix model targets and add additional improvements
2024-06-26 06:18:46 -07:00
Jason T. Greene b629739155 Fix model targets and add additional improvements
- Fix model download container and targets
- Add prometheus model for eval
- Improve caching in instructlab container
- Add additional "models" targets for all permutations
- Introduce build chaining so that you can build everthing in one step
- Small update to conform to $(MAKE) convention for submakes

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-06-26 08:13:18 -05:00
Daniel J Walsh 75e03f3def
Merge pull request #623 from containers/otel-trace-workflow
udpate otel-collector workflow config
2024-06-26 06:53:22 -04:00
Daniel J Walsh 85da91dfbf
Merge pull request #631 from javipolo/fix-model-targets
Fix model targets
2024-06-26 06:53:06 -04:00
Daniel J Walsh 98b01c6fb3
Merge pull request #632 from enriquebelarte/fix-amd-typo
Fix typo in Containerfile workaround
2024-06-26 06:51:32 -04:00
Enrique Belarte Luque e89f1d2219
Fix typo in Containerfile workaround
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-26 05:39:53 -05:00
Gregory Pereira 70c32cfd63
Merge pull request #630 from enriquebelarte/amd-selinux-tmp-fix
Temp workaround for amd-bootc
2024-06-25 11:15:55 -07:00
Enrique Belarte Luque 9409e63da4
Temp workaround for amd-bootc
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-25 13:11:50 -05:00
Javi Polo c290eb19d7
Force entrypoint when running generate-model-cfile
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-25 19:54:34 +02:00
Javi Polo 5245d5b008
Fix model-downloader container
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-25 19:54:27 +02:00
Daniel J Walsh ccc3cad081
Merge pull request #628 from javipolo/kernel-core-installed
Use --installed to get kernel version for packages to be installed
2024-06-25 13:53:52 -04:00
Daniel J Walsh a795bdaaaa
Merge pull request #629 from javipolo/cloud-init-default
Install and enable cloud-init by default
2024-06-25 13:52:26 -04:00
sallyom d45439bf2e debug workflows otel trace
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-25 12:17:35 -04:00
Javi Polo e0dba4476e
Install and enable cloud-init by default
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-25 17:16:25 +02:00
Javi Polo 03a385833f
Use --installed to get kernel version for packages to be installed
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-25 16:58:46 +02:00
Ryan Cook 236bc2e823
Merge pull request #627 from containers/ami
ami switch for nvidia
2024-06-25 09:26:39 -04:00
Ryan Cook 035d4adc67 ami switch for nvidia
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-25 09:25:37 -04:00
Ryan Cook ee1acc7fa1
Merge pull request #626 from containers/wait_nvidia
wait until the nvidia bootc tasks is complete before deletion
2024-06-25 08:30:57 -04:00
Ryan Cook 06e2b4ae65 wait until the nvidia bootc tasks is complete before deletion
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-25 08:30:35 -04:00
Daniel J Walsh 85f4b865b5
Merge pull request #624 from enriquebelarte/oci-mount-fix-konflux
Add changes to podman oci mount
2024-06-25 08:12:13 -04:00
Enrique Belarte Luque 98c03d6760
Add changes to podman oci mount
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-25 06:33:45 -05:00
Daniel J Walsh cabac566a5
Merge pull request #625 from javipolo/osbuild-selinux-note
Add note about osbuild-selinux required to build disk images
2024-06-25 07:25:47 -04:00
Enrique Belarte Luque a9f888e607
Add changes to podman oci mount
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-25 05:03:50 -05:00
Javi Polo 3db000141e
Add note about osbuild-selinux required to build disk images
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-25 11:32:36 +02:00
Enrique Belarte Luque cb4cd25ab6
Add changes to podman oci mount
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-25 04:15:04 -05:00
sallyom e6f4a7430f update tracegen script
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-24 23:48:39 -04:00
sallyom 81922dec29 udpate otel-collector workflow config
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-24 22:55:17 -04:00
Ryan Cook 5e418481df
Merge pull request #622 from containers/when_run
need to provide nvidia with oci artifacts
2024-06-24 17:48:54 -04:00
Ryan Cook e967ee1700 need to provide nvidia with oci artifacts
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 16:49:22 -04:00
Ryan Cook 50a058dacc
Merge pull request #621 from containers/when_run
need to set the arch for instructlab image
2024-06-24 16:10:09 -04:00
Ryan Cook 9eb0d5f3cd need to set the arch for instructlab image
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 16:09:45 -04:00
Daniel J Walsh 9585310997
Merge pull request #616 from rhatdan/bootc
Make output a subdir of build, to allow chown to work
2024-06-24 15:17:23 -04:00
Ryan Cook a356198117
Merge pull request #620 from containers/when_run
fixes of image tagging
2024-06-24 15:04:01 -04:00
Ryan Cook a5399bdda7 fixes of image tagging
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 15:03:16 -04:00
Ryan Cook c2c7576493
Merge pull request #619 from containers/when_run
when to run the testing
2024-06-24 14:47:05 -04:00
Ryan Cook e28d1ff453 when to run the testing
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 14:46:29 -04:00
Ryan Cook 27d3d80201
Merge pull request #618 from containers/needs_fix
needs runner information
2024-06-24 14:26:12 -04:00
Gregory Pereira 6d7ffa737b
Merge pull request #615 from rhatdan/makefile
Must lowercase the IMAGE name
2024-06-24 11:09:25 -07:00
Ryan Cook 72ebe7cb32 needs runner information
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 13:26:19 -04:00
Daniel J Walsh bc863008d2
Merge pull request #610 from containers/renovate/auto-merged-updates
Update Auto merged updates
2024-06-24 12:53:29 -04:00
Daniel J Walsh b1dd1cb9e6
Merge pull request #614 from containers/run-bootc-builds-on-non-mirror
moving tests from mirror to regular
2024-06-24 12:52:44 -04:00
Ryan Cook ac557caf52 for some reason the intel test needs this image or it will fail
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-24 12:33:52 -04:00
Gregory Pereira 2707f87fd2
Merge pull request #617 from enriquebelarte/fix-ilab
Fix ilab
2024-06-24 09:05:17 -07:00
Enrique Belarte Luque 8c43552fd6
Syntax fix
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 10:57:48 -05:00
Platform Engineering Bot 2061db5fa0 Update Auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-06-24 15:44:15 +00:00
Dan Walsh ee81fafaa7 Make output a subdir of build, to allow chown to work
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-24 11:41:34 -04:00
Dan Walsh 735d7ab0be Must lowercase the IMAGE name
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-24 11:36:35 -04:00
Enrique Belarte Luque 21dd1a23ca
Syntax fix
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 10:17:01 -05:00
greg pereira f0a607271b
moving tests from mirror to regular
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-24 06:26:39 -07:00
Gregory Pereira a012c67270
Merge pull request #613 from containers/fix-bootc-build-workflow-stop
fixing aws region on tf stop
2024-06-24 06:18:28 -07:00
Daniel J Walsh 23b70bf156
Merge pull request #612 from enriquebelarte/fix-ilab-script
Workaround for ilab script source
2024-06-24 09:16:20 -04:00
greg pereira f7238fb9e5
fixing aws region on tf stop
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-24 06:15:27 -07:00
Daniel J Walsh 61d6bb1851
Merge pull request #598 from prarit/fix-amd-target
training/Makefile: Fix top level vendor targets
2024-06-24 09:14:16 -04:00
Daniel J Walsh e36d53ef8b
Merge pull request #607 from containers/otel-trace-workflow
Otel trace workflow
2024-06-24 09:13:12 -04:00
greg pereira 5877759317
triggering bootc builds
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-24 06:06:58 -07:00
Enrique Belarte Luque 12c2e6dae9
Workaround for ilab script source
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 07:58:39 -05:00
Enrique Belarte Luque bdec51299a
Workaround for ilab script source
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 07:42:16 -05:00
Enrique Belarte Luque d084de4faa
Workaround for ilab script source
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 07:14:47 -05:00
Enrique Belarte Luque 74de44f3aa
Workaround for ilab script source
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 04:30:07 -05:00
Enrique Belarte Luque 786b221bdd
Workaround for ilab script source
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-24 04:19:55 -05:00
Gregory Pereira e75e1856d8
Merge pull request #608 from containers/fix-deter-resnet-ms
allowing pip to install requirements
2024-06-23 17:59:33 -07:00
Ryan Cook 261d5e60d3
Merge pull request #609 from containers/self_hosted_runner
self hosted runner capabilties
2024-06-23 20:58:30 -04:00
Ryan Cook d94c373611 self hosted runner capabilties
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-23 20:45:06 -04:00
greg pereira 60eb979527
allowing pip to install requirements
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-23 17:39:04 -07:00
sallyom 4e36394c17 another try
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-23 01:35:27 -04:00
sallyom 1f0f1f9ca6 update workflow
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-22 23:02:14 -04:00
Daniel J Walsh 330df095f8
Merge pull request #602 from axel7083/feature/support-hf-pretrained-model
feat: adding support for hf_pretrained_model option
2024-06-22 08:23:26 -04:00
Jason T. Greene 40e1538c08
Merge pull request #606 from n1hility/revert-599
Revert "Change source from ilab wrapper"
2024-06-22 02:02:43 -05:00
Jason T. Greene bf965d38e2 Revert "Change source from ilab wrapper"
This reverts commit 528ae444c0.

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-06-22 02:00:27 -05:00
Gregory Pereira 82bcb8cf91
Merge pull request #599 from enriquebelarte/change-ilab-wrapper 2024-06-21 19:12:07 -07:00
Jason T. Greene f7f69635ec
Merge pull request #596 from containers/top-level-bootc-with-images
Top level bootc with images
2024-06-21 20:26:42 -05:00
Gregory Pereira 322ebc4562
Merge pull request #605 from containers/network_tool
netavark tool required
2024-06-21 13:30:07 -07:00
Ryan Cook 13aa5dce20 netavark tool required
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-21 16:19:01 -04:00
Ryan Cook c6c55a3a43
Merge pull request #604 from containers/nvidia_key
get through testing and allow for users to inject their own key with …
2024-06-21 15:41:18 -04:00
Ryan Cook 9b39f6f81d get through testing and allow for users to inject their own key with this image
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-21 15:37:33 -04:00
Ryan Cook 9f3fda19ba
Merge pull request #603 from cooktheryan/bring_podman
Bring your own podman 5
2024-06-21 15:08:40 -04:00
Ryan Cook 816eb2f112 Bring your own podman 5
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-21 14:01:08 -04:00
greg pereira 0d4249d732
refactor for consistency
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-21 09:04:08 -07:00
axel7083 1f1125a745
feat: adding support for hf_pretrained_model option
Signed-off-by: axel7083 <42176370+axel7083@users.noreply.github.com>
2024-06-21 17:11:56 +02:00
greg pereira 52fb03a868
refactor model to work with env variable + absolute paths
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-21 06:45:12 -07:00
greg pereira 4edf5f594e
add HF token as ENV var + check if exists
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-21 06:45:12 -07:00
Gregory Pereira 452795eaa9
Merge pull request #600 from containers/create-new-bootc-variant-with-models-targets
adding new top level variant bootc + models targets
2024-06-21 06:44:16 -07:00
greg pereira d55ec98168
adding new top level variant bootc + models targets
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-21 06:43:19 -07:00
Enrique Belarte Luque 528ae444c0
Change source from ilab wrapper
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-21 08:43:05 -05:00
Prarit Bhargava 5e492cae4a training/Makefile: Fix top level vendor targets
The top level vendor targets (amd, intel, nvidia) fail with

"podman" build \
	 \
	--file /root/ai-lab-recipes/training/model/../build/Containerfile.models \
	--security-opt label=disable \
	--tag "quay.io/ai-lab/-bootc-models:latest" \
	-v /root/ai-lab-recipes/training/model/../build:/run/.input:ro
Error: tag quay.io/ai-lab/-bootc-models:latest: invalid reference format
make[1]: *** [Makefile:41: bootc-models] Error 125
make[1]: Leaving directory '/root/ai-lab-recipes/training/model'
make: *** [Makefile:70: bootc-models] Error 2

because VENDOR is not defined when the bootc-models target is called.

Modify the makefile to set VENDOR for each target.

Signed-off-by: Prarit Bhargava <prarit@redhat.com>
2024-06-21 08:19:38 -04:00
sallyom dc012ed809 debug curl
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-20 19:00:44 -04:00
Daniel J Walsh 5ff1da8d80
Merge pull request #595 from containers/bump-standard-runners
bump std runners from 22.04 to 24.04
2024-06-20 16:41:14 -04:00
Daniel J Walsh 5f0505e3e0
Merge pull request #594 from rhatdan/makefile
Fix up pulling images
2024-06-20 16:40:13 -04:00
greg pereira abe7c2129d
fixing dependency versions for model servers
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-20 13:18:55 -07:00
greg pereira 07cbb1dd99
bump std runners from 22.04 to 24.04
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-20 13:03:33 -07:00
Dan Walsh 7cf692b26b Fix up pulling images
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-20 15:54:09 -04:00
Daniel J Walsh 0e149be067
Merge pull request #588 from rhatdan/makefile
Fix instruct-intel target
2024-06-20 15:30:27 -04:00
Dan Walsh f3a58f292f fix instruct-intel target
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-20 13:20:41 -04:00
Daniel J Walsh f47422e93f
Merge pull request #591 from rhatdan/vllm
No longer using vllm and deepspeed images for AI bootc images
2024-06-20 12:03:16 -04:00
Daniel J Walsh aa7b8b8c8d
Merge pull request #589 from rhatdan/growfs
Eliminate growfs from training containers
2024-06-20 11:54:25 -04:00
Daniel J Walsh 04c70593a7
Merge pull request #590 from javipolo/osbuild-fix-order
Fix image builder
2024-06-20 11:54:09 -04:00
Dan Walsh daf4b634ef No longer using vllm and deepspeed images for AI bootc images
Instructlab will include these executables inside of its container
rather then using external containers.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-20 11:50:15 -04:00
Javi Polo 1f869bfbcb
Fix image builder
- Properly separate and order podman and bootc-image-builder arguments
- Move all the `selinux.tmp` workaround to the same layer, so bootc
  install wont complain about missing files

Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-20 17:41:37 +02:00
Dan Walsh 5e4e74a4a9 Eliminate growfs from training containers
Training images will not be installed in the cloud by default so should
not include growfs.

Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-20 11:40:37 -04:00
Daniel J Walsh 84c8acd656
Merge pull request #584 from javipolo/ilab_use_variables
Allow custom instructlab image url via env variables
2024-06-20 11:19:37 -04:00
Daniel J Walsh a44d59b3f0
Merge pull request #587 from tiran/gaudi-comment
Add note about Gaudi updates
2024-06-20 11:17:50 -04:00
Gregory Pereira 13b721d088
Merge pull request #586 from containers/nvidia-builder-to-builer
move bootc builder (dtk) to common
2024-06-20 06:59:43 -07:00
Christian Heimes 931c14a3ed Add note about Gaudi updates
Any Gaudi update must be synchronized with all stakeholders. For now,
all packages from Kernel OOT drivers over firmware and SynapseAI to
PyTorch stack must have the same version. `habana-torch-plugin` version
`1.16.0.526` does not work with Kernel drivers `1.16.1-7`.

Signed-off-by: Christian Heimes <cheimes@redhat.com>
2024-06-20 13:05:04 +02:00
sallyom 3af8da0522 mTLS & configure otel-collector to ROSA-ET
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 22:47:24 -04:00
sallyom 6a72550c6e add traces to chatbot workflow
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 21:45:34 -04:00
sallyom 0a27f9f80c fix indent
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 21:45:34 -04:00
sallyom 8089c22281 update workflow triggers
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 21:45:34 -04:00
sallyom f37bebeeba add traces to testing_framework
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 21:45:34 -04:00
sallyom 4792aa172e test workflow with otel traces
Signed-off-by: sallyom <somalley@redhat.com>
2024-06-19 21:45:34 -04:00
greg pereira 36f3a9a406
rename dir
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-19 15:08:10 -07:00
greg pereira 8b6f702f43
move bootc builder to common
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-19 14:35:58 -07:00
Javi Polo 2d185795ac
Allow custom instructlab image url via env variables
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-06-19 22:49:41 +02:00
Gregory Pereira fcd7e7a7e1
Merge pull request #585 from fabiendupont/bootc-intel-multistage
Use multi-stage to build the Intel bootc image
2024-06-19 12:53:55 -07:00
Fabien Dupont 744a03e18c Use multi-stage to build the Intel bootc image
The NVIDIA bootc container is using multi-stage to avoid shipping build
dependencies in the final image, making it also smaller. This change
implements the same build strategy for the Intel bootc image.

The builder image is the same as for NVIDIA bootc. It is currently named
after NVIDIA, but should be renamed in a follow-up change. The benefit
is that a single builder image is maintained for all bootc images that
require out-of-tree drivers.

The number of build arguments is also reduced, since most of the
information is already present in the builder image. There is only one
kernel package per builder image and one image per architecture, so we
can retrieve the `KERNEL_VERSION` and `TARGET_ARCH` variables by
querying the RPM database. The OS information is retrieved by sourcing
the `/etc/os-release` file.

The extraction of the RPMs doesn't require storing the files, as
`rpm2cpio` supports streaming the file over HTTP(S). This number of
commands is smaller and the downloads happened already for each build,
since the download was not in a separate `RUN` statement.

It is not necessary to copy the source of the drivers in `/usr/src\, since
we don't need to keep it in the final image. The Makefiles accept a
`KVERSION` variable to specify the version of the kernel and resolve its
path. The other benefit is to build as non-root.

The `.ko` files can then be copied to the final image with `COPY
--from=builder`. The change also ensures that the firmware files are
copied to the final image.

This change also adds support for `EXTRA_RPM_PACKAGES`.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-06-19 13:00:12 -04:00
Jason T. Greene cb8cc3c08d
Merge pull request #583 from n1hility/add-images
Adds models to bootc-models image
2024-06-19 11:37:46 -05:00
Jason T. Greene ef9b838041 Fix build issues and add models to new bootc image
- Fix wrong script install (container lab used over wrapper [wont run on its own])
  + Restores elements that were unintentionally removed
- Fix quay tags
- Introduce "$ARCH-bootc-models" images in addition to bootc that include models

Signed-off-by: Jason T. Greene <jason.greene@redhat.com>
2024-06-19 04:17:19 -05:00
Gregory Pereira ab7465198d
Merge pull request #581 from containers/gpu
wrong var used new var introduced
2024-06-18 13:41:55 -07:00
Ryan Cook 806c11fec6 wrong var used new var introduced
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-18 16:37:12 -04:00
Ryan Cook 86d74b7705
Merge pull request #579 from containers/oci_art
need to bring in oci artifacts to build
2024-06-18 16:13:25 -04:00
Ryan Cook 00cdd48758 need to bring in oci artifacts to build
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-18 16:11:36 -04:00
Gregory Pereira 41a8bed497
Merge pull request #578 from containers/amd_fix
WIP: resolve build issues with bootc and amd
2024-06-18 12:32:57 -07:00
Ryan Cook f25197f7a8 allow for images to built and pushed to quay
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-18 15:29:01 -04:00
Ryan Cook ed5d7bb3e6 resolve build issues with bootc and amd
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-18 15:14:28 -04:00
Daniel J Walsh c95e9441e2
Merge pull request #570 from tiran/gaudi-1.16.0
Update Intel Gaudi to 1.16.0-526
2024-06-18 02:50:42 -04:00
Daniel J Walsh 302025027a
Merge pull request #571 from enriquebelarte/fix-intel
Fixes and improvements for Intel Containerfile
2024-06-18 02:50:03 -04:00
Daniel J Walsh 07997a72f9
Merge pull request #569 from containers/renovate/auto-merged-updates
Update Auto merged updates
2024-06-18 02:48:08 -04:00
Gregory Pereira cfde0b9d7e
Merge pull request #572 from enriquebelarte/conditional-growfs
Make growfs conditional
2024-06-17 21:28:14 -07:00
Platform Engineering Bot 9a6f9b2ce7 Update Auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-06-18 00:55:51 +00:00
Ryan Cook 5937d032ca
Merge pull request #573 from containers/typo
typo in server
2024-06-17 13:48:32 -04:00
Ryan Cook a1dbf9f6f7 typo in server
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-17 08:53:54 -04:00
Enrique Belarte Luque 3b7a78bcde
Make growfs conditional
growfs is created by Makefile and CI does not use it. Also if I'm not misktaken growfs is only used for disk images creation.
By changing this, growfs file will only be created when Makefile is runningso CI pipelines can build the Containerfile and growfs can be also used when needed.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-17 06:07:11 -05:00
Enrique Belarte Luque 39705e10f7
Fixes and improvements for Intel Containerfile
As per suggestions of @rhdatan some improvements made

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-17 02:41:04 -05:00
Christian Heimes ef3206bab3 Update Intel Gaudi to 1.16.0-526
Signed-off-by: Christian Heimes <cheimes@redhat.com>
2024-06-17 08:02:40 +02:00
Daniel J Walsh 7b1d2f9fac
Merge pull request #544 from rhatdan/build
Add support for BUILD_ARG_FILE
2024-06-14 20:49:14 -04:00
Daniel J Walsh b910e23cc9
Merge pull request #548 from containers/fix_chat
specify community package
2024-06-14 20:48:28 -04:00
Daniel J Walsh 0a6fab60a9
Merge pull request #564 from enriquebelarte/intel-nodkms
Remove DKMS from Intel drivers
2024-06-14 20:48:08 -04:00
Daniel J Walsh 86e4d0f5ed
Merge pull request #563 from enriquebelarte/add-base-arg
Add BASEIMAGE variable
2024-06-14 20:41:58 -04:00
Ryan Cook 52f75d3f28
Merge pull request #565 from containers/fix-llamacpp-default-chat-format
temp fix revert to llama-2 format by default
2024-06-14 17:13:52 -04:00
greg pereira a40bd357b7
temp fix revert to llama-2 format by default
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-14 13:50:54 -07:00
Ryan Cook a15d20ce0b test based on changes to requirements file or renovate
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-14 15:30:25 -04:00
Enrique Belarte Luque ddc7844af2
Fix harcoded kernel version
Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-14 07:28:42 -05:00
Enrique Belarte Luque 17187146b0
Remove DKMS from Intel drivers
To avoid the use of DKMS rpms are downloaded and then sources extracted and compiled.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-14 07:23:41 -05:00
Enrique Belarte Luque d6459526c7
Add BASEIMAGE variable
Adding BASEIMAGE to Containerfile.builder allows using different images for building

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-14 05:03:28 -05:00
Ryan Cook 137197b134
Merge pull request #557 from fabiendupont/add-tmux-to-bootc-image
Add tmux to the bootc image
2024-06-13 11:23:37 -04:00
Ryan Cook 948f303724
Merge pull request #559 from enriquebelarte/temp-fix-libdnf
Temporary fix for bootc CI builds
2024-06-13 11:15:00 -04:00
Ryan Cook 5e902faeba
Merge pull request #558 from fabiendupont/fix-typo-for-pciutils
Fix typo for pciutils in AMD bootc
2024-06-13 10:50:39 -04:00
Enrique Belarte Luque 3e3fbdaa12
Temporary fix for bootc CI builds
Konflux CI fails when building using bootc images as base throwing this error:
`Error: Cannot create repo temporary directory "/var/cache/dnf/baseos-044cae74d71fe9ea/libdnf.1jsyRp": Permission denied`
This temporary workaround is needed for build pipeline to work on Konflux CI until libdnf fix is merged to RHEL.

References:
https://issues.redhat.com/browse/RHEL-39796
https://github.com/rpm-software-management/libdnf/pull/1665

This should be removed once the permanent fix is merged.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-06-13 07:10:21 -05:00
Fabien Dupont a364524f73 Fix typo for pciutils in AMD bootc
Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-06-13 05:26:45 -04:00
Fabien Dupont 3991cb4123 Add tmux to the bootc image
Many commands that are run for SDG and training can take a lot of time,
so there is a risk to have a network disconnection during the task. With
`tmux`, users have the ability to detach the jobs from their SSH session
and let the tasks run for a very long time.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-06-13 03:55:42 -04:00
Daniel J Walsh 295a57c114
Merge pull request #555 from fabiendupont/add-pciutils-to-bootc-image
Add pciutils to the OS image
2024-06-12 13:01:06 -04:00
Ryan Cook 4890129d3c
Merge pull request #556 from containers/debug_pull
ansible -vvv is not helpful at this time
2024-06-12 12:40:08 -04:00
Ryan Cook 1ee2a72dfd ansible -vvv is not helpful at this time
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-12 12:39:32 -04:00
Daniel J Walsh 178f2c18c9
Merge pull request #550 from rhatdan/nvidia
Make more options optional
2024-06-12 11:44:15 -04:00
Fabien Dupont 21f12b7e5a Add pciutils to the OS image
The `lspci` command is frequently used to inspect the hardware on a
server. Adding it to the OS image would help users to troubleshoot
deployment and configuration issues.

Signed-off-by: Fabien Dupont <fdupont@redhat.com>
2024-06-12 11:23:24 -04:00
Ryan Cook 7e17de44a6
Merge pull request #554 from containers/debug_pull
init ilab before pull
2024-06-12 10:48:41 -04:00
Ryan Cook dadf808d87 init ilab before pull
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-12 10:47:55 -04:00
Ryan Cook cf2b01e67e
Merge pull request #552 from containers/debug_pull
attempting to pull model manually w ilab
2024-06-12 10:14:11 -04:00
Ryan Cook a2a3472913 attempting to pull model manually
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-12 10:13:19 -04:00
Ryan Cook bf845b9b08
Merge pull request #551 from containers/rollback_reboot
rollback
2024-06-11 15:20:00 -04:00
Ryan Cook 9b04792113 rollback
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 15:19:30 -04:00
Daniel J Walsh 24b4bbc414
Merge pull request #549 from containers/hacking_e2e_fix
trying to pass runtime var to allow for model pull
2024-06-11 14:35:47 -04:00
Ryan Cook 45dc5dd0fc roll back tag
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 14:35:09 -04:00
Daniel J Walsh 7f0793570e
Make more options optional
Remove unused _ID directives.

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-11 14:23:12 -04:00
Ryan Cook 643fd9910e remove message?
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 14:22:16 -04:00
Daniel J Walsh 5c923329b9
Merge pull request #545 from rhatdan/squash
podman build does not support --squash and --layers at same time
2024-06-11 13:57:17 -04:00
Ryan Cook bf3be8317d must make this faster
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 13:45:43 -04:00
Ryan Cook 4911ad30d5 further testing
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 12:59:03 -04:00
Daniel J Walsh 1704a5ab94
podman build does not support --squash and --layers at same time
Fixed: https://github.com/containers/podman/pull/22957

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-11 12:55:12 -04:00
Ryan Cook 18d8e8183c trying to pass runtime var to allow for model pull
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 12:19:08 -04:00
Ryan Cook 9a6e26fad7 changes based on feedback
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 12:06:30 -04:00
Ryan Cook ce2b0413d7 specify community package
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-11 09:24:48 -04:00
Daniel J Walsh f90a88cda6
Merge pull request #539 from containers/default-chat-template-to-model-meta
defaulting no option but allow override chat format
2024-06-10 13:28:32 -04:00
Daniel J Walsh cb742bb0c1
Add support for BUILD_ARG_FILE
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-10 13:26:37 -04:00
greg pereira 558ecafd2c
removing empty default option in containerfile
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-10 08:59:34 -07:00
Gregory Pereira c516758948
Merge pull request #543 from containers/renovate_bot
try to fix the renovate bot from breaking milvus
2024-06-10 08:53:44 -07:00
Ryan Cook d0e775eb9a Better patch version
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-10 10:28:30 -04:00
Ryan Cook 3584681985 try to fix the renovate bot from breaking milvus
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-10 10:28:30 -04:00
Daniel J Walsh e46a5105ed
Merge pull request #542 from rhatdan/build
Fix Makefiles to allow alternative container engines
2024-06-10 08:29:59 -04:00
Daniel J Walsh ef79d65a0d
Fix Makefiles to allow alternative container engines
Some users want to use buildah instead of podman to build
their container engines.

Buildah does not support --squash-all but after examining the podman
code --squash-all ends up just being the equivalent of "--squash --layers=false"

Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-06-09 07:50:34 -04:00
Daniel J Walsh 45cebdb961
Merge pull request #534 from rhatdan/makefile
Improve Makefiles
2024-06-09 07:46:29 -04:00
Gregory Pereira 62abb1711f
Merge pull request #541 from containers/llamacpp-python-vulkan-amd64
Llamacpp python vulkan amd64
2024-06-08 14:39:25 -07:00
greg pereira 65f265af07
defaulting no option but allow override chat format
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-08 14:26:53 -07:00
greg pereira 59e9cd6a8c
workflow and corresponding dir structure
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-08 14:25:57 -07:00
greg pereira 21d641d308
vulkan amd64 build
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-08 09:06:35 -07:00
Gregory Pereira 9b686a3df2
Merge pull request #537 from cooktheryan/unbreak
fixes break that was introduced
2024-06-08 07:16:02 -07:00
greg pereira 3bd1e38524
vulkan uses GPUs, workflow should run with GPU
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-08 07:01:40 -07:00
Ryan Cook 7e27567860 fixes break that was introduced
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-07 10:29:54 -04:00
Ryan Cook e959cd408d
Merge pull request #528 from containers/llamacpp-python-vulkan-arm64
lamacpp-python-vulkan for arm64
2024-06-07 09:34:06 -04:00
greg pereira 30bee42e16
lamacpp-python-vulkan for arm64
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-06 20:18:19 -07:00
Daniel J Walsh 9b611c4810
Merge pull request #535 from cooktheryan/epel
fix of broken install
2024-06-06 16:40:52 -04:00
Ryan Cook af6ae97853 fix of broken install
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-06 15:50:32 -04:00
Dan Walsh a0d528f140 Add support for SOURCE_DATE_EPOCH
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-06 15:25:47 -04:00
Dan Walsh 925ca1e8cb Sort build options
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-06 15:18:49 -04:00
Dan Walsh ab744c9700 Improve Makefiles
Signed-off-by: Dan Walsh <dwalsh@redhat.com>
2024-06-06 15:17:52 -04:00
Gregory Pereira eb011f3288
Merge pull request #532 from containers/revert-517-bump-all-python-base-images-to-312
Revert "bump python 3.11 to 3.12"
2024-06-06 09:04:11 -07:00
Gregory Pereira 8cb48bff41
Merge pull request #533 from cooktheryan/pin_version
need to pin version specific version of fedora
2024-06-06 08:22:09 -07:00
Ryan Cook 77739abad7 need to pin version specific version of fedora
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-06 11:06:31 -04:00
Gregory Pereira 44e4c70487
Revert "bump python 3.11 to 3.12"
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-06 08:05:40 -07:00
Daniel J Walsh 4cb9a41f0c
Merge pull request #517 from containers/bump-all-python-base-images-to-312
bump python 3.11 to 3.12
2024-06-05 20:12:52 -04:00
greg pereira 5dd5a5776c
bump python 3.11 to 3.12
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-05 13:46:54 -07:00
Daniel J Walsh 0dd18c34e5
Merge pull request #531 from containers/fix-chat-format-llamacpp
fix passing of chat_format to llamacpp ms
2024-06-05 16:27:03 -04:00
greg pereira 246912c61e
fix passing of chat_format to llamacpp ms
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-06-05 12:51:58 -07:00
Daniel J Walsh bd40fa9daa
Merge pull request #529 from cooktheryan/arm_fail
fix of arm err on previous run
2024-06-03 14:52:47 -04:00
Ryan Cook 462b22991c fix of arm err
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-06-03 14:17:27 -04:00
Daniel J Walsh a2f7761627
Merge pull request #518 from MichaelClifford/promptfoo
Add initial tool for creating custom eval sets
2024-06-03 11:46:08 -04:00
Daniel J Walsh 4471de3063
Merge pull request #519 from johnmcollier/configuremodel
Configure model for chatbot and codegen recipes
2024-06-03 11:44:52 -04:00
Daniel J Walsh b1823979b4
Merge pull request #521 from cooktheryan/renvoate
bump renovate
2024-06-01 07:03:04 -04:00
Gregory Pereira a4251c3967
Merge pull request #523 from containers/e2e-max-concurrency-1
adding single concurrency value to e2e
2024-05-31 13:28:41 -07:00
greg pereira a50b244757
adding single concurrency value to e2e
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-31 13:19:00 -07:00
Ryan Cook 60a7d60b4a bump renovate
Signed-off-by: Ryan Cook <rcook@redhat.com>
2024-05-31 15:37:37 -04:00
John Collier c25aac807d Configure model for chatbot and codegen recipes
Signed-off-by: John Collier <jcollier@redhat.com>
2024-05-31 12:14:53 -04:00
Michael Clifford 59d6e2caff add initial tool for creating custom eval sets
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-30 17:18:35 -04:00
Gregory Pereira 66c6a52307
Merge pull request #515 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-05-29 10:21:35 -07:00
greg pereira 7d94e22361
bump python to 3.12 version in containerfile
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-29 09:32:59 -07:00
Platform Engineering Bot dc0fba38a8 chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-05-29 08:55:15 +00:00
Daniel J Walsh 5fd2597aa9
Merge pull request #510 from gcolman/patch-1
Fix invalid instructions in README.md
2024-05-27 06:57:36 -04:00
Graeme Colman 2573e7d148 Fix invalid instructions in README.md
Fixed two instructions in the README.
1) the instruction to make model pointed to etr-resnet-50 rather than the etr-resnet-101 that the instructions use.
2) The client container start had a /detecion in the model address where it should not have.
added signoff

Signed-off-by: Graeme Colman <gcolman@redhat.com>
2024-05-26 12:55:18 +01:00
Daniel J Walsh 0dad0b5c4b
Merge pull request #508 from MichaelClifford/promptfoo
initial promptfoo commit
2024-05-25 06:30:41 -04:00
Daniel J Walsh 96f9181ec0
Merge pull request #512 from markmc/makefile-cleanup
Remove unused instructlab Makefile variables
2024-05-25 06:26:52 -04:00
Daniel J Walsh b7fdd642f8
Merge pull request #513 from markmc/gpu-count-check
ilab-wrapper: fix GPU_AMOUNT check
2024-05-25 06:26:10 -04:00
Mark McLoughlin 29759fce40 ilab-wrapper: fix GPU_AMOUNT check
No need to emit this warning on a 2x GPU system.

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2024-05-23 14:58:54 -04:00
Mark McLoughlin 2be14b67ff Remove unused instructlab Makefile variables
Unused since #427 - commit 6a42054

Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2024-05-23 13:44:52 -04:00
Liora Milbaum 3d5a294816
Merge pull request #511 from enriquebelarte/intel-ci
Simplify package installation
2024-05-23 17:01:13 +03:00
Enrique Belarte Luque c42d2a2265
Simplify package installation
Installs epel and CRB in a cleaner way.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-05-23 08:40:54 -05:00
Michael Clifford d8b4669671 Update eval/promptfoo/base/Containerfile
Co-authored-by: Gregory Pereira <grpereir@redhat.com>
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-22 18:36:18 -04:00
Daniel J Walsh 873184271d
Merge pull request #506 from enriquebelarte/bootc-baseimages
Add BASEIMAGE as argument to Containerfile
2024-05-22 17:35:28 -04:00
Michael Clifford 027c96075d initial promptfoo commit
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-22 16:40:59 -04:00
Jeff MAURY 9939d3bca8
fix: object_detection recipes error in Podman AI Lab (#505)
Fixes #504

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-05-22 09:28:26 -04:00
Enrique Belarte Luque a2bdde936a
Add BASEIMAGE as argument to Containerfile
Added BASEIMAGE as ARG so it can be used from build.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-05-22 07:27:16 -05:00
Gregory Pereira 70c990bc21
Merge pull request #502 from containers/downgrade-langchain-in-nlp-recipes
downgrade langchain to < 0.2.0 in nlp recipes
2024-05-21 10:09:51 -07:00
greg pereira 197d0fd2e0
downgrade langchain to < 0.2.0 in nlp recipes
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-21 10:08:18 -07:00
Liora Milbaum 4ba23af406
Merge pull request #501 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-05-20 11:37:15 +03:00
Platform Engineering Bot 9749b5a2ed chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-05-20 00:13:31 +00:00
Jeff MAURY d25371d390
fix: prevent multipes requests in chatbot recipe (#498)
Fixes #497

Signed-off-by: Jeff MAURY <jmaury@redhat.com>
2024-05-17 09:05:43 -04:00
Liora Milbaum 484d7f888c
Merge pull request #499 from lmilbaum/renovate-config
Renovate config
2024-05-17 15:16:35 +03:00
Liora Milbaum 1aadad326b Renovate config
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-17 15:16:04 +03:00
Daniel J Walsh 1bde81f7b1
Merge pull request #496 from MichaelClifford/fix-486
update readme's to clarify app ports used
2024-05-16 17:30:58 -04:00
Michael Clifford 90faadfa0d update readme's to clarify app ports used
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-16 17:11:10 -04:00
Daniel J Walsh ae88cd7beb
Merge pull request #334 from Shreyanand/milvus
Add Milvus database compatibility with the RAG recipe
2024-05-16 14:25:36 -04:00
Shrey ef4b6f0109
Update .github/workflows/rag.yaml
Co-authored-by: Gregory Pereira <grpereir@redhat.com>

Update recipes/natural_language_processing/rag/app/rag_app.py

Co-authored-by: Gregory Pereira <grpereir@redhat.com>

Update Readme and add review comments

Signed-off-by: Shreyanand <shanand@redhat.com>
2024-05-16 12:52:07 -04:00
Michael Clifford 0df104daee
lower ConversationBufferWindowMemory (#495)
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-15 18:51:35 -04:00
Michael Clifford 50a79740c1
add interrupt to llamacpp (#494)
Signed-off-by: Michael Clifford <mcliffor@redhat.com>
2024-05-15 18:51:06 -04:00
Gregory Pereira bae8b153b5
object detection recipe and MS tests (#278)
* object detection recipe and MS tests

Signed-off-by: greg pereira <grpereir@redhat.com>
Signed-off-by: Gregory-Pereira <grpereir@redhat.com>
Signed-off-by: greg pereira <grpereir@redhat.com>

* adding a object_detection_client workflow file

Signed-off-by: greg pereira <grpereir@redhat.com>

* addressing michael's comments

Signed-off-by: greg pereira <grpereir@redhat.com>

* properly name object detection client job + moving pip install to tests

Signed-off-by: greg pereira <grpereir@redhat.com>

---------

Signed-off-by: greg pereira <grpereir@redhat.com>
Signed-off-by: Gregory-Pereira <grpereir@redhat.com>
2024-05-14 13:54:58 -04:00
Liora Milbaum 9107f0cd35
Merge pull request #492 from containers/renovate/auto-merged-updates
Update Auto merged updates
2024-05-13 21:46:41 +03:00
redhat-renovate-bot 6d05f9ab12 Update Auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-05-13 02:07:36 +02:00
Liora Milbaum 2df4681cdc
Merge pull request #490 from enriquebelarte/intel-bc
Install habanalabs packages in containerfile
2024-05-09 18:59:45 +03:00
Enrique Belarte Luque ec05b07b17
Install habanalabs packages in containerfile
Added packages and dependencies to habanalabs and Gaudi support.

Signed-off-by: Enrique Belarte Luque <ebelarte@redhat.com>
2024-05-09 10:41:36 -05:00
Daniel J Walsh 35a75a6588
Merge pull request #489 from rhatdan/intel
Turn on instructlab for intel
2024-05-09 09:52:28 -04:00
Daniel J Walsh bf1158b6bf
Merge pull request #474 from rhatdan/instructlab
Error on umasks other then 022
2024-05-09 08:10:03 -04:00
Daniel J Walsh 3a79f37888
Merge pull request #470 from javipolo/bootc-image-builder-toml
Allow both json and toml as config files for bootc-image-builder
2024-05-09 08:09:17 -04:00
Daniel J Walsh 37e7bb686f
Merge pull request #488 from javipolo/newer-kernel-core
Use newer kernel version when there are multiple available
2024-05-09 08:07:16 -04:00
Daniel J Walsh b6e0feb72e
Turn on instructlab for intel
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-05-09 06:04:47 -06:00
Javi Polo 2fa420ac7c
Use newer kernel version when there are multiple available
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-05-09 11:54:45 +02:00
Liora Milbaum dbcdc38326 trainig_bootc workflow 2024-05-07 20:34:09 +03:00
Liora Milbaum 6fffb5e2b7 trainig_bootc workflow 2024-05-07 20:06:59 +03:00
Liora Milbaum 36632a6c1a trainig_bootc workflow 2024-05-07 19:28:37 +03:00
Liora Milbaum d6fd60a028 trainig_bootc workflow 2024-05-07 18:59:23 +03:00
Liora Milbaum 35bff85838 trainig_bootc workflow 2024-05-07 18:18:32 +03:00
Daniel J Walsh 997d39361f
Error on umasks other then 022
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-05-07 05:46:35 -06:00
Liora Milbaum 9eb06b660d trainig_bootc workflow 2024-05-07 14:15:30 +03:00
Liora Milbaum bfe26a5fdb trainig_bootc workflow 2024-05-07 14:10:03 +03:00
Liora Milbaum 381dc53abd trainig_bootc workflow 2024-05-07 14:02:19 +03:00
Liora Milbaum 8df738d3e3 trainig_bootc workflow 2024-05-07 13:52:28 +03:00
Liora Milbaum ed764f052b trainig_bootc workflow 2024-05-07 13:49:32 +03:00
Liora Milbaum 6bb845b77f trainig_bootc workflow 2024-05-07 13:42:27 +03:00
Liora Milbaum 8b4c1da8ca trainig_bootc workflow 2024-05-07 13:20:04 +03:00
Liora Milbaum 34132824cd trainig_bootc workflow 2024-05-07 12:56:12 +03:00
Liora Milbaum 8d7086319f trainig_bootc workflow 2024-05-07 12:38:26 +03:00
Liora Milbaum b38226f0ae trainig_bootc workflow 2024-05-07 12:08:21 +03:00
Liora Milbaum c16650affe trainig_bootc workflow 2024-05-07 11:53:04 +03:00
Liora Milbaum 4ae5f7e606 trainig_bootc workflow 2024-05-07 11:37:02 +03:00
Liora Milbaum 92624d12ff trainig_bootc workflow 2024-05-07 11:24:37 +03:00
Liora Milbaum 0436013bf9 trainig_bootc workflow 2024-05-07 11:08:12 +03:00
Liora Milbaum 9f82b2ef96
Merge pull request #484 from containers/split-training-bootc-workflow-build
split build and pull on bootc_training workflow
2024-05-07 10:56:26 +03:00
greg pereira caae984e76
containers-mirror --> containers
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-07 00:33:13 -07:00
Gregory Pereira 168471b068
Merge pull request #481 from containers/fix-model_converter-testing-paths
fixing run path for model_converter
2024-05-07 00:20:01 -07:00
greg pereira 814273515c
split build and pull
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-07 00:03:25 -07:00
Daniel J Walsh a2fdeca73c
Merge pull request #478 from containers/renovate/auto-merged-updates
chore(deps): update auto merged updates
2024-05-06 23:46:39 -04:00
Daniel J Walsh eaf619c8cf
Merge pull request #479 from containers/renovate/all
chore(deps): update all dependencies
2024-05-06 23:45:18 -04:00
greg pereira 968b2fa1ac
fixing run path for model_converter
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-06 09:06:15 -07:00
Liora Milbaum ec848381e2
Merge pull request #477 from containers/e2e-tests
Running e2e tests
2024-05-06 13:59:13 +03:00
Liora Milbaum 5faa6069e2 Running e2e tests
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-06 13:57:55 +03:00
Platform Engineering Bot 04f8c774cb chore(deps): update auto merged updates
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-05-06 10:03:54 +02:00
Platform Engineering Bot ca0b1f1677 chore(deps): update all dependencies
Signed-off-by: Platform Engineering Bot <platform-engineering@redhat.com>
2024-05-06 02:03:59 +02:00
Gregory Pereira 7ed50766af
Merge pull request #475 from containers/add-pull-task-to-e2e-workflow
Add pull task to e2e workflow
2024-05-05 14:02:42 -07:00
greg pereira 0a30fc231c
retry options on run
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 11:43:02 -07:00
greg pereira 0c8648dbf1
consolidate ansible.cfgs
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:11:27 -07:00
greg pereira 146584fa8a
trigger tests
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:10:45 -07:00
greg pereira 94a2ac15a3
pull policy never and dont push to quay
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:10:45 -07:00
greg pereira 3e087254bd
adding async
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:10:45 -07:00
greg pereira 768b90e40a
allow for escape testing with hold-tests label
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:10:45 -07:00
greg pereira a8cc8ac046
split build into pull and build
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:10:45 -07:00
Gregory Pereira 1eec2101e7
Merge pull request #476 from Gregory-Pereira/e2e-consolidate-ansible-cfgs
ansible cfg refactor for e2e training workflow
2024-05-05 10:09:38 -07:00
greg pereira a6c27ddaa0
ansible cfg refactor
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-05 10:06:26 -07:00
Liora Milbaum 627a2c6ef2
Merge pull request #471 from containers/e2e
instructlab e2e testing
2024-05-05 18:50:37 +03:00
Colin Walters 6e92310fea Remove extra quote from ssh_public_key
Nice find by Xiaofeng!

Signed-off-by: Colin Walters <walters@verbum.org>
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-05 18:50:09 +03:00
Jason T. Greene ef4ae1848b
Merge pull request #473 from romfreiman/hf_token
HF_TOKEN is not propagated to the podman command
2024-05-05 08:03:57 -05:00
Rom Freiman 5ffea41e82 HF_TOKEN is not propagated to the podman command
And hence mixtral download fails

Downloading model failed with the following Hugging Face Hub error: 401 Client Error. (Request ID: Root=1-6637576e-28a8c5cb049f1dbb35d46d83;86121860-3ce0-419b-aed0-4fc79c440da7)

Cannot access gated repo for url https://huggingface.co/api/models/mistralai/Mixtral-8x7B-Instruct-v0.1/tree/main?recursive=True&expand=False.
Access to model mistralai/Mixtral-8x7B-Instruct-v0.1 is restricted. You must be authenticated to access it.

Signed-off-by: Rom Freiman <rfreiman@gmail.com>
2024-05-05 15:21:46 +03:00
Colin Walters 9636f3dcab tests: increase ansible verbosity 2024-05-05 05:45:28 -04:00
Liora Milbaum 470e1ef78d instructlab e2e testing
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-05 11:14:09 +03:00
Liora Milbaum 839611fa51
Merge pull request #468 from containers/instructlab-testing-framework-6
adding Tmate session, and testing playbook
2024-05-05 08:49:23 +03:00
greg pereira 3a492d1672
moving tmate to after bootc install
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-04 17:00:04 -07:00
Javi Polo 091d7cd4a1
Allow both json and toml as config files for bootc-image-builder
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-05-04 23:20:35 +02:00
greg pereira 5d6def2263
removing wait for connection for port timeout issue
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-04 11:24:54 -07:00
greg pereira 26afe50b37
removing stuff to fix tmate session
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-04 09:25:04 -07:00
greg pereira 4b08e9ef89
adding tmate session, and testing playbook
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-04 08:38:23 -07:00
Liora Milbaum a98479cf57
Merge pull request #467 from containers/reboot
Reboot instance after bootc install
2024-05-04 18:10:20 +03:00
Liora Milbaum c3b132dc41 Reboot instance after bootc install
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-04 18:07:10 +03:00
Liora Milbaum 74c81b70fb
Merge pull request #464 from containers/build-and-install
Build and Install Bootc Image
2024-05-04 11:59:15 +03:00
Liora Milbaum 5eaa0b8ea0 Build and Install Bootc Image
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-04 11:11:32 +03:00
Gregory Pereira e9d5aa8847
Merge pull request #428 from containers/instructlab-testing-framework-4
bootc e2e workflow - run the e2e tests
2024-05-03 15:12:23 -07:00
greg pereira bcf522f80c removing ssh timeout and ansible.cfg
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-04 01:02:27 +03:00
greg pereira 0eba1abe57 removing ssh timeout and ansible.cfg
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-03 23:35:37 +03:00
greg pereira 16f383305d check access to ilab
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-03 23:35:37 +03:00
greg pereira 07027382b0 check access to ilab
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-03 23:35:37 +03:00
greg pereira 551ad9204a test I still have access to the box
Signed-off-by: greg pereira <grpereir@redhat.com>
2024-05-03 23:35:37 +03:00
Gregory Pereira e6298cda73
Merge pull request #463 from containers/schedule
Reschedule testing framework workflow to run once a day
2024-05-03 12:15:13 -07:00
Liora Milbaum 732c24fe83 Reschedule testing framework workflow to run once a day
Signed-off-by: Liora Milbaum <lmilbaum@redhat.com>
2024-05-03 22:12:56 +03:00
Shreyanand 705b5d172e
Add milvus vector database for rag recipe
Signed-off-by: Shreyanand <shanand@redhat.com>
Co-authored-by: Michael Clifford <mcliffor@redhat.com>
Co-authored-by: greg pereira <grpereir@redhat.com>
2024-05-03 12:30:29 -04:00
Daniel J Walsh e25128ee7e
Merge pull request #462 from rhatdan/instructlab
Maintain permissions when copying files into build directories
2024-05-03 12:28:29 -04:00
Daniel J Walsh 6eb5cdccc5
Merge pull request #455 from javipolo/bootc-image-builder
Add target for creating disk-images
2024-05-03 12:28:07 -04:00
Daniel J Walsh 5a6021384c
Maintain permissions when copying files into build directories
Signed-off-by: Daniel J Walsh <dwalsh@redhat.com>
2024-05-03 12:24:36 -04:00
Javi Polo 4cb23bbf1e
Add target for creating disk-images
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-05-03 17:56:16 +02:00
Daniel J Walsh d3ba2b62fb
Merge pull request #458 from javipolo/custom_instructlab_repo
Allow to use a different instructlab git repository via env vars
2024-05-03 11:03:10 -04:00
Daniel J Walsh e2ead10229
Merge pull request #460 from danmcp/main
README cleanup
2024-05-03 10:17:12 -04:00
Dan McPherson 2a7c7f8d04 README cleanup
Signed-off-by: Dan McPherson <dmcphers@redhat.com>
2024-05-03 10:05:25 -04:00
Javi Polo a1ec1ced87
Allow to use a different instructlab git repository via env vars
Signed-off-by: Javi Polo <jpolo@redhat.com>
2024-05-03 14:35:58 +02:00
355 changed files with 57681 additions and 1166 deletions

View File

@ -1,6 +0,0 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"github>platform-engineering-org/.github"
]
}

View File

@ -17,7 +17,7 @@ For a full list of the images we build check out or [quay organization](https://
## Testing frameworks
Our testing frameworks are a bit different from our standard workflows. In terms of compute, some of these jobs run either AWS machines provisioned via terraform using secrets in the github repository, or customized github hosted action runners, as well as the standard ubuntu-22.04 github runners for jobs not requiring additional resources.
Our testing frameworks are a bit different from our standard workflows. In terms of compute, some of these jobs run either AWS machines provisioned via terraform using secrets in the github repository, or customized github hosted action runners, as well as the standard ubuntu-24.04 github runners for jobs not requiring additional resources.
These workflows start by checking out the [terraform-test-environment-module](https://github.com/containers/terraform-test-environment-module) repo, as well as the code in `containers/ai-lab-recipes` at the `main` branch. Then it will provision the terraform instance, install the correct ansible playbook requirements, and runs a coressponding playbook. Aditional actions may also be taken depending on the testing framework in question.

View File

@ -8,6 +8,8 @@ on:
- ./recipes/common/Makefile.common
- ./recipes/natural_language_processing/chatbot/**
- .github/workflows/chatbot.yaml
- ./recipes/natural_language_processing/chatbot/app/**
- ./renovate.json
push:
branches:
- main
@ -25,7 +27,7 @@ env:
jobs:
chatbot-build-and-push:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -35,13 +37,69 @@ jobs:
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Install opentelemetry dependencies
run: |
pip install --no-cache-dir opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-instrumentation
- name: Download OpenTelemetry Collector Contrib
run: |
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.103.0/otelcol-contrib_0.103.0_linux_amd64.tar.gz
tar -xvf otelcol-contrib_0.103.0_linux_amd64.tar.gz
- name: Write secrets to files
run: |
echo "${{ secrets.ROSA_OTEL_CACERT }}" > /tmp/ca.crt
echo "${{ secrets.ROSA_OTEL_SERVER_CRT }}" > /tmp/server.crt
echo "${{ secrets.ROSA_OTEL_SERVER_KEY }}" > /tmp/server.key
- name: Configure OpenTelemetry Collector
run: |
echo '
receivers:
otlp:
protocols:
grpc:
http:
exporters:
otlphttp:
endpoint: "${{ secrets.ROSA_OTEL_ENDPOINT }}"
tls:
insecure: false
cert_file: /tmp/server.crt
key_file: /tmp/server.key
ca_file: /tmp/ca.crt
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug, otlphttp]
' > otel-collector-config.yaml
- name: Run OpenTelemetry Collector
run: |
./otelcol-contrib --config otel-collector-config.yaml > otel-collector.log 2>&1 &
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Start job trace
run: |
export WORKFLOW_NAME="chatbot"
export JOB_NAME="chatbot-build-and-push"
export TRACE_ACTION="start"
python ci/trace-steps.py
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2.13
@ -52,11 +110,6 @@ jobs:
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.1.0
with:
python-version: '3.11'
- name: Install Dependencies
working-directory: ./recipes/natural_language_processing/${{ env.IMAGE_NAME }}
run: make install
@ -86,3 +139,11 @@ jobs:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
- name: End job trace
run: |
export WORKFLOW_NAME="chatbot"
export JOB_NAME="chatbot-build-and-push"
export TRACE_ACTION="end"
python ci/trace-steps.py

View File

@ -25,7 +25,7 @@ env:
jobs:
codegen-build-and-push:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -35,7 +35,7 @@ jobs:
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
@ -53,7 +53,7 @@ jobs:
context: recipes/natural_language_processing/${{ env.IMAGE_NAME }}/app
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'

View File

@ -43,7 +43,7 @@ jobs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Build Image
id: build_image

View File

@ -16,7 +16,7 @@ env:
jobs:
build-and-push-llamacpp-python-cuda-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -26,7 +26,7 @@ jobs:
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Build llamacpp_python cuda
id: build_llamacpp_python_cuda
@ -54,7 +54,7 @@ jobs:
tags: ${{ steps.build_llamacpp_python_cuda.outputs.tags }}
build-and-push-llamacpp-python-vulkan-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -64,7 +64,7 @@ jobs:
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
@ -98,7 +98,7 @@ jobs:
tags: ${{ steps.build_llamacpp_python_vulkan.outputs.tags }}
build-and-push-llamacpp-python-base-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -108,7 +108,7 @@ jobs:
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
run: |
@ -141,7 +141,7 @@ jobs:
tags: ${{ steps.build_llamacpp_python_base.outputs.tags }}
build-and-push-rag-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -151,7 +151,7 @@ jobs:
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
run: |
@ -184,13 +184,13 @@ jobs:
tags: ${{ steps.build_rag.outputs.tags }}
build-and-push-chromadb-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
run: |
@ -223,13 +223,13 @@ jobs:
tags: ${{ steps.build_chromadb.outputs.tags }}
build-and-push-codegen-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
@ -263,13 +263,13 @@ jobs:
tags: ${{ steps.build_codegen_image.outputs.tags }}
build-and-push-chatbot-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency
@ -303,13 +303,13 @@ jobs:
tags: ${{ steps.build_chatbot_image.outputs.tags }}
build-and-push-summarizer-image:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
# required for multi-arch builds
- name: Install qemu dependency

View File

@ -14,9 +14,9 @@ concurrency:
jobs:
mirror-repository:
if: github.repository == 'containers/ai-lab-recipes'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
with:
fetch-depth: 0

View File

@ -7,14 +7,14 @@ on:
paths:
- 'convert_models/**'
- '!convert_models/README.md'
- '.github/workflows/model-converter.yaml'
- '.github/workflows/model_converter.yaml'
push:
branches:
- main
paths:
- 'convert_models/**'
- '!convert_models/README.md'
- '.github/workflows/model-converter.yaml'
- '.github/workflows/model_converter.yaml'
workflow_dispatch:
@ -29,7 +29,7 @@ jobs:
matrix:
include:
- platforms: linux/amd64,linux/arm64
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -39,7 +39,7 @@ jobs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |

View File

@ -5,14 +5,18 @@ on:
branches:
- main
paths:
- ./model_servers/**
- 'model_servers/**'
- 'models/Makefile'
- .github/workflows/model_servers.yaml
push:
branches:
- main
paths:
- ./model_servers/
- 'model_servers/**'
- 'models/Makefile'
- .github/workflows/model_servers.yaml
tags:
- '*'
workflow_dispatch:
@ -32,19 +36,37 @@ jobs:
directory: llamacpp_python
platforms: linux/amd64,linux/arm64
no_gpu: 1
- image_name: llamacpp_python_cuda
- image_name: llamacpp-python-cuda
model: granite
flavor: cuda
directory: llamacpp_python
platforms: linux/amd64,linux/arm64
no_gpu: 0
- image_name: llamacpp-python-vulkan-amd
model: granite
flavor: vulkan/amd64
directory: llamacpp_python
platforms: linux/amd64
cuda: 1
no_gpu: 0
- image_name: llamacpp-python-vulkan-arm
model: granite
flavor: vulkan/arm64
directory: llamacpp_python
platforms: linux/arm64
no_gpu: 0
- image_name: whispercpp
model: whisper-small
flavor: base
directory: whispercpp
platforms: linux/amd64,linux/arm64
no_gpu: 1
runs-on: ubuntu-22.04
- image_name: object_detection_python
model: facebook-detr-resnet-101
flavor: base
directory: object_detection_python
platforms: linux/amd64,linux/arm64
no_gpu: 1
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -59,12 +81,17 @@ jobs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Build Image
id: build_image
@ -72,7 +99,7 @@ jobs:
with:
image: ${{ env.REGISTRY }}/${{ github.repository_owner}}/${{ matrix.image_name }}
platforms: ${{ matrix.platforms }}
tags: latest
tags: latest ${{ github.ref_type == 'tag' && github.ref_name || '' }}
containerfiles: ./model_servers/${{ matrix.directory }}/${{ matrix.flavor }}/Containerfile
context: model_servers/${{ matrix.directory }}/
@ -80,11 +107,6 @@ jobs:
working-directory: ./models
run: make download-model-${{ matrix.model }}
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
- name: Install python dependencies
working-directory: ./model_servers/${{ matrix.directory }}/
run: make install

View File

@ -8,12 +8,12 @@ on:
branches:
- main
paths:
- .github/workflows/model_image_build_push.yaml
- .github/workflows/models.yaml
push:
branches:
- main
paths:
- .github/workflows/model_image_build_push.yaml
- .github/workflows/models.yaml
workflow_dispatch:
@ -46,7 +46,7 @@ jobs:
- image_name: whisper-small
url: https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin
platforms: linux/amd64,linux/arm64
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -56,7 +56,7 @@ jobs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
@ -78,7 +78,7 @@ jobs:
context: models
- name: Login to Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
uses: redhat-actions/podman-login@v1.7
with:
registry: ${{ env.REGISTRY }}
@ -86,7 +86,7 @@ jobs:
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
if: (github.event_name == 'push' && github.ref == 'refs/heads/main') || (github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main')
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}

89
.github/workflows/object_detection.yaml vendored Normal file
View File

@ -0,0 +1,89 @@
name: Object Detection
on:
pull_request:
branches:
- main
paths:
- ./recipes/computer_vision/object_detection/**
- .github/workflows/object_detection.yaml
push:
branches:
- main
paths:
- ./recipes/computer_vision/object_detection/**
- .github/workflows/object_detection.yaml
workflow_dispatch:
env:
REGISTRY: ghcr.io
REGISTRY_ORG: containers
RECIPE_NAME: object_detection
RECIPE_TYPE: computer_vision
IMAGE_NAME: object_detection_client
jobs:
object-detection-client-build-and-push:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
services:
registry:
image: registry:2.8.3
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Image
id: build_image
uses: redhat-actions/buildah-build@v2.13
with:
image: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/${{ env.IMAGE_NAME }}
tags: latest
platforms: linux/amd64,linux/arm64
containerfiles: ./recipes/${{ env.RECIPE_TYPE }}/${{ env.RECIPE_NAME }}/app/Containerfile
context: recipes/${{ env.RECIPE_TYPE }}/${{ env.RECIPE_NAME }}/app
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Install Dependencies
working-directory: ./recipes/${{ env.RECIPE_TYPE }}/${{ env.RECIPE_NAME }}
run: make install
- name: Download model
working-directory: ./models
run: make download-model-facebook-detr-resnet-101
- name: Run Functional Tests
shell: bash
run: make functional-tests
working-directory: ./recipes/${{ env.RECIPE_TYPE }}/${{ env.RECIPE_NAME }}
- name: Login to Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/podman-login@v1.7
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push Image
id: push_image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}

View File

@ -5,16 +5,16 @@ on:
branches:
- main
paths:
- ./recipes/common/Makefile.common
- ./recipes/natural_language_processing/rag/**
- .github/workflows/rag.yaml
- 'recipes/common/Makefile.common'
- 'recipes/natural_language_processing/rag/**'
- '.github/workflows/rag.yaml'
push:
branches:
- main
paths:
- ./recipes/common/Makefile.common
- ./recipes/natural_language_processing/rag/**
- .github/workflows/rag.yaml
- 'recipes/common/Makefile.common'
- 'recipes/natural_language_processing/rag/**'
- '.github/workflows/rag.yaml'
workflow_dispatch:
@ -25,7 +25,7 @@ env:
jobs:
rag-build-and-push:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -40,7 +40,7 @@ jobs:
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
@ -58,7 +58,7 @@ jobs:
context: recipes/natural_language_processing/${{ env.IMAGE_NAME }}/app
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'

View File

@ -25,7 +25,7 @@ env:
jobs:
summarizer-build-and-push:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
@ -35,7 +35,7 @@ jobs:
ports:
- 5000:5000
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Install qemu dependency
run: |
@ -53,7 +53,7 @@ jobs:
context: recipes/natural_language_processing/${{ env.IMAGE_NAME }}/app
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'

94
.github/workflows/test-trace-steps.yaml vendored Normal file
View File

@ -0,0 +1,94 @@
# To run locally
# act -W .github/workflows/test-trace-steps.yaml --container-architecture linux/amd64 -b ci/logs:/logs
name: Test Workflow
on:
pull_request:
branches:
- main
paths:
- .github/workflows/test-trace-steps.yaml
workflow_dispatch:
jobs:
test-build:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Install Python dependencies
run: |
pip install --no-cache-dir opentelemetry-sdk opentelemetry-exporter-otlp opentelemetry-instrumentation
- name: Download OpenTelemetry Collector Contrib
run: |
wget https://github.com/open-telemetry/opentelemetry-collector-releases/releases/download/v0.103.0/otelcol-contrib_0.103.0_linux_amd64.tar.gz
tar -xvf otelcol-contrib_0.103.0_linux_amd64.tar.gz
- name: Write secrets to files
run: |
echo "${{ secrets.ROSA_OTEL_CACERT }}" > /tmp/ca.crt
echo "${{ secrets.ROSA_OTEL_SERVER_CRT }}" > /tmp/server.crt
echo "${{ secrets.ROSA_OTEL_SERVER_KEY }}" > /tmp/server.key
- name: Configure OpenTelemetry Collector
run: |
echo '
receivers:
otlp:
protocols:
grpc:
http:
exporters:
otlphttp:
endpoint: "${{ secrets.ROSA_OTEL_ENDPOINT }}"
tls:
insecure: false
cert_file: /tmp/server.crt
key_file: /tmp/server.key
ca_file: /tmp/ca.crt
debug:
verbosity: detailed
service:
pipelines:
traces:
receivers: [otlp]
exporters: [debug, otlphttp]
' > otel-collector-config.yaml
- name: Run OpenTelemetry Collector
run: |
./otelcol-contrib --config otel-collector-config.yaml > otel-collector.log 2>&1 &
- name: Start job trace
run: |
export WORKFLOW_NAME="test-trace"
export JOB_NAME="test-build"
export TRACE_ACTION="start"
python ci/trace-steps.py
- name: Build
run: |
echo "Simulating build step..."
sleep 2
- name: Test
run: |
echo "Simulating test step..."
sleep 2
- name: End job trace
run: |
export WORKFLOW_NAME="test-trace"
export JOB_NAME="test-build"
export TRACE_ACTION="end"
python ci/trace-steps.py
- name: Display OpenTelemetry Collector Logs
run: cat otel-collector.log

View File

@ -1,10 +1,10 @@
name: Testing Framework
on:
schedule: # schedule the job to run every hour
- cron: '0 * * * *'
workflow_dispatch:
schedule: # schedule the job to run once a day
- cron: '0 0 * * *'
#workflow_dispatch:
# pull_request: ## temporary for debugging development purposes
# branches:
@ -13,7 +13,7 @@ on:
env:
TF_VAR_aws_region: "eu-west-2"
TF_VAR_aws_ami_owners: '["125523088429"]'
TF_VAR_aws_ami_name: '["Fedora-Cloud-Base-*"]'
TF_VAR_aws_ami_name: '["Fedora-Cloud-Base-39*"]'
TF_VAR_aws_volume_size: 100
TF_VAR_aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
TF_VAR_aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
@ -28,13 +28,13 @@ concurrency:
jobs:
integration-tests:
if: github.repository == 'containers/ai-lab-recipes'
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
include:
- arch: amd64
aws_image_type: t3a.medium
aws_image_type: t3a.medium
aws_ami_architecture: x86_64
- arch: arm64
aws_image_type: m7g.medium
@ -44,20 +44,25 @@ jobs:
aws_ami_architecture: x86_64
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.7
with:
path: main
ref: 'main'
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: Checkout terraform module
id: checkout-module
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.7
with:
repository: containers/terraform-test-environment-module
path: terraform-test-environment-module
ref: 'main'
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3.1.0
uses: hashicorp/setup-terraform@v3.1.2
with:
terraform_version: "1.7.5"
terraform_wrapper: false
@ -73,7 +78,7 @@ jobs:
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
- name: Terraform Output
id: terraform-output
run: |
@ -84,31 +89,26 @@ jobs:
- name: Ansible Collections
run: ansible-galaxy install -r ./provision/requirements.yml
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./recipes/natural_language_processing/chatbot
- name: Provision
run: |
ansible-playbook ./main/recipes/natural_language_processing/chatbot/provision/playbook.yml \
ansible-playbook ./recipes/natural_language_processing/chatbot/provision/playbook.yml \
-i terraform-test-environment-module/hosts.ini \
--private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }}
env:
ANSIBLE_HOST_KEY_CHECKING: false
- name: Set up Python
uses: actions/setup-python@v5.1.0
with:
python-version: '3.11'
- name: Install Dependencies
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./recipes/natural_language_processing/chatbot
run: make install
- name: Run Integration Tests
working-directory: ./main/recipes/natural_language_processing/chatbot
working-directory: ./recipes/natural_language_processing/chatbot
run: make integration-tests
env:
URL: ${{ steps.terraform-output.outputs.url }}
- name: Destroy Test Environment
id: down
if: always()
@ -117,7 +117,7 @@ jobs:
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
- name: Publish Job Results to Slack
id: slack
if: always()
@ -131,7 +131,7 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
release-images:
runs-on: ubuntu-22.04
runs-on: ubuntu-24.04
needs: integration-tests
if: success()
strategy:
@ -154,7 +154,7 @@ jobs:
env:
SOURCE_REGISTRY: ghcr.io/containers
TARGET_REGISTRY: quay.io/ai-lab
- name: Publish Job Results to Slack
id: slack
if: always()
@ -171,7 +171,12 @@ jobs:
if: github.repository == 'containers-mirror/ai-lab-recipes'
runs-on: ubuntu-22.04-2core
steps:
- uses: actions/checkout@v4.1.4
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.11'
- name: chatbot
working-directory: ./recipes/natural_language_processing/chatbot

View File

@ -1,25 +1,26 @@
name: traning E2E
on:
# schedule: # schedule the job to run every day at midnight
# - cron: '0 * * * *'
schedule: # schedule the job to run every day at midnight
- cron: '0 12 * * *'
# For testing purposes, will remove
pull_request:
branches:
- main
paths:
- .github/workflows/training-e2e.yaml
- ./training/**
workflow_dispatch:
env:
TF_VAR_aws_region: "eu-west-2"
TF_VAR_aws_ami_owners: '["125523088429"]'
TF_VAR_aws_ami_name: '["Fedora-Cloud-Base-*"]'
TF_VAR_aws_volume_size: 128
TF_VAR_aws_ami_owners: '["309956199498"]'
TF_VAR_aws_ami_name: '["*RHEL-9.4*"]'
TF_VAR_aws_volume_size: 500
TF_VAR_aws_access_key: ${{ secrets.AWS_ACCESS_KEY_ID }}
TF_VAR_aws_secret_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
HF_TOKEN: ${{ secrets.HF_TOKEN }}
concurrency:
group: ${{ github.workflow }}
@ -27,10 +28,11 @@ concurrency:
jobs:
e2e:
if: github.repository == 'containers/ai-lab-recipes'
runs-on: ubuntu-22.04
if: github.repository == 'containers/ai-lab-recipes' && !contains(github.event.pull_request.labels.*.name, 'hold-tests')
runs-on: ubuntu-24.04
strategy:
fail-fast: false
max-parallel: 1
matrix:
include:
- arch: amd64
@ -39,20 +41,20 @@ jobs:
aws_ami_architecture: x86_64
steps:
- name: Checkout
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.7
with:
path: main
- name: Checkout terraform module
id: checkout-module
uses: actions/checkout@v4.1.4
uses: actions/checkout@v4.1.7
with:
repository: containers/terraform-test-environment-module
path: terraform-test-environment-module
ref: 'main'
- name: Setup Terraform
uses: hashicorp/setup-terraform@v3.1.0
uses: hashicorp/setup-terraform@v3.1.2
with:
terraform_version: "1.7.5"
terraform_wrapper: false
@ -68,27 +70,67 @@ jobs:
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
- name: Terraform Output
id: terraform-output
run: |
echo "id=$(terraform output id | xargs)" >> $GITHUB_OUTPUT
echo "url=$(terraform output host | xargs)" >> $GITHUB_OUTPUT
echo "ssh_public_key=$(terraform output ssh_public_key | xargs)" >> $GITHUB_OUTPUT
echo "pem_filename=$(terraform output pem_filename | xargs)" >> $GITHUB_OUTPUT
working-directory: terraform-test-environment-module
- name: Ansible Collections
run: ansible-galaxy install -r ./provision/requirements.yml
run: ansible-galaxy install -r ./tests/provision/requirements.yml
working-directory: ./main/training
- name: Provision
run: |
ansible-playbook ./main/training/provision/playbook.yml \
ansible-playbook ./main/training/tests/provision/playbook.yml \
-i terraform-test-environment-module/hosts.ini \
--private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }} \
--extra-vars "image_name=${{ matrix.image_name }}"
--extra-vars "image_name=${{ matrix.image_name }}" \
--extra-vars "ssh_public_key='${{ steps.terraform-output.outputs.ssh_public_key }}'" \
--extra-vars "registry_user=${{ secrets.REGISTRY_USER }}" \
--extra-vars "registry_password=${{ secrets.REGISTRY_PASSWORD }}"
env:
ANSIBLE_HOST_KEY_CHECKING: false
ANSIBLE_CONFIG: ./main/training/tests/ansible.cfg
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3.18
# timeout-minutes: 20
# with:
# detached: true
# limit-access-to-actor: false
- name: Setup tmate session
uses: mxschmitt/action-tmate@v3.18
timeout-minutes: 60
with:
detached: true
limit-access-to-actor: false
- name: Run tests
run: |
ansible-playbook ./main/training/tests/e2e-tests/playbook.yml \
-i terraform-test-environment-module/hosts.ini \
--private-key=terraform-test-environment-module/${{ steps.terraform-output.outputs.pem_filename }} \
--extra-vars "HF_TOKEN=${{ secrets.HF_TOKEN }}" \
--extra-vars "image_name=${{ matrix.image_name }}" \
--extra-vars "ssh_public_key='${{ steps.terraform-output.outputs.ssh_public_key }}'" \
--extra-vars "registry_user=${{ secrets.REGISTRY_USER }}" \
--extra-vars "registry_password=${{ secrets.REGISTRY_PASSWORD }}"
env:
ANSIBLE_CONFIG: ./main/training/tests/ansible.cfg
# This should exist in the final workflow
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3.18
# timeout-minutes: 15
# with:
# detached: true
# limit-access-to-actor: false
- name: Destroy Test Environment
id: down
@ -98,7 +140,7 @@ jobs:
env:
TF_VAR_aws_instance_type: ${{ matrix.aws_image_type }}
TF_VAR_aws_ami_architecture: ${{ matrix.aws_ami_architecture }}
- name: Publish Job Results to Slack
id: slack
if: always()

View File

@ -1,22 +1,12 @@
name: Training Bootc image builds
on:
schedule: # schedule the job to run at 12 AM daily
- cron: '0 0 * * *'
push:
branches: [ main ]
paths:
- 'training/**'
- '.github/workflows/training_bootc.yaml'
# pull_request:
# branches:
# - main
# paths:
# - .github/workflows/instructlab_baseimages_build_push.yaml
# - training/nvidia
# push:
# branches:
# - main
# paths:
# - .github/workflows/instructlab_baseimages_build_push.yaml
# - training/nvidia
workflow_dispatch:
concurrency:
@ -26,53 +16,84 @@ concurrency:
env:
REGISTRY: quay.io
REGISTRY_ORG: ai-lab
REGION: us-east-1
jobs:
start-runner:
name: Start self-hosted EC2 runner
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ubuntu-latest
outputs:
label: ${{ steps.start-ec2-runner.outputs.label }}
ec2-instance-id: ${{ steps.start-ec2-runner.outputs.ec2-instance-id }}
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ env.REGION }}
- name: Start EC2 runner
id: start-ec2-runner
uses: machulav/ec2-github-runner@v2
with:
mode: start
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
ec2-image-id: ami-0154957ba4ce98784
ec2-instance-type: m7i.12xlarge
subnet-id: subnet-0b1e1d94240813658
security-group-id: sg-055105753f5e8bd83
nvidia-bootc-builder-image:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests') && github.repository == 'containers-mirror/ai-lab-recipes'"
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
strategy:
matrix:
include:
- image_name: nvidia-builder
context: training/nvidia-bootc
arch: amd64
runs-on: ubuntu-22.04
runs-on: ${{ needs.start-runner.outputs.label }}
needs: start-runner
permissions:
contents: read
packages: write
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.1.4
- name: Install qemu dependency
- name: mkdir root/.docker directory
run: |
sudo apt-get update
sudo apt-get install -y qemu-user-static
- name: Build Image
id: build_image
run: make dtk ARCH=${{ matrix.arch }}
working-directory: ${{ matrix.context }}
mkdir -p ~/.docker
- name: Login to Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/podman-login@v1.7
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ env.REGISTRY }}
- name: generate a ssh key - USER SHOULD INJECT THEIR OWN AND REBUILD IF THEY USE THIS IMAGE
run: |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N ""
- name: Build Image
id: build_image
run: make driver-toolkit ARCH=${{ matrix.arch }}
working-directory: ${{ matrix.context }}
- name: tag image as nvidia-builder
run: podman tag ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/driver-toolkit:latest ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}/${{ matrix.image_name}}:latest
- name: Push image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
registry: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}
image: driver-toolkit
tags: latest
- name: push the nvidia-builder image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ matrix.image_name}}
tags: latest
registry: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}
- name: Publish Job Results to Slack
id: slack
@ -87,8 +108,6 @@ jobs:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
nvidia-bootc-image:
if: "success() && !contains(github.event.pull_request.labels.*.name, 'hold-tests') && github.repository == 'containers-mirror/ai-lab-recipes'"
needs: nvidia-bootc-builder-image
strategy:
matrix:
include:
@ -96,35 +115,43 @@ jobs:
driver_version: "550.54.15"
context: training/nvidia-bootc
arch: amd64
runs-on: ubuntu-22.04-8-cores
runs-on: ${{ needs.start-runner.outputs.label }}
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
needs: [ nvidia-bootc-builder-image, start-runner ]
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.7
- name: mkdir root/.docker directory
run: |
mkdir -p ~/.docker
- name: generate a ssh key - USER SHOULD INJECT THEIR OWN AND REBUILD IF THEY USE THIS IMAGE and overwrite the existing one
run: |
ssh-keygen -t rsa -b 4096 -f ~/.ssh/id_rsa -N "" <<<y
- name: Login to Container Registry
run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ env.REGISTRY }}
- name: generate the local OCI assets
run: |
cd training
make -j vllm
make -j deepspeed
make -j instruct-nvidia
- uses: actions/checkout@v4.1.4
- name: Build Image
id: build_image
run: make bootc DRIVER_VERSION=${{ matrix.driver_version }} ARCH=${{ matrix.arch }}
run: make bootc DRIVER_VERSION=${{ matrix.driver_version }} ARCH=${{ matrix.arch }} SSH_PUBKEY=~/.ssh/id_rsa.pub
working-directory: ${{ matrix.context }}
- name: Login to Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/podman-login@v1.7
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
- name: Push image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
image: ${{ matrix.image_name }}
tags: latest
registry: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}
- name: Publish Job Results to Slack
id: slack
@ -138,46 +165,51 @@ jobs:
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
intel-and-amd-bootc-image:
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests') && github.repository == 'containers-mirror/ai-lab-recipes'"
bootc-images:
strategy:
matrix:
include:
- image_name: intel-bootc
context: training/intel-bootc
arch: amd64
gpu: intel
- image_name: amd-bootc
context: training/amd-bootc
arch: amd64
runs-on: ubuntu-latest
gpu: amd
if: "!contains(github.event.pull_request.labels.*.name, 'hold-tests')"
runs-on: ${{ needs.start-runner.outputs.label }}
needs: [ start-runner, nvidia-bootc-builder-image ]
continue-on-error: true
steps:
- name: Remove unnecessary files
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
- uses: actions/checkout@v4.1.7
- uses: actions/checkout@v4.1.4
- name: Build Image
id: build_image
run: make bootc ARCH=${{ matrix.arch }}
working-directory: ${{ matrix.context }}
- name: mkdir root/.docker directory
run: |
mkdir -p ~/.docker
- name: Login to Container Registry
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/podman-login@v1.7
with:
registry: ${{ env.REGISTRY }}
username: ${{ secrets.REGISTRY_USER }}
password: ${{ secrets.REGISTRY_PASSWORD }}
run: podman login -u ${{ secrets.REGISTRY_USER }} -p ${{ secrets.REGISTRY_PASSWORD }} ${{ env.REGISTRY }}
- name: generate the local OCI assets
run: |
cd training
make -j vllm
make -j deepspeed
make -j instruct-${{ matrix.gpu}}
- name: Build Image
id: build_image
run: make bootc ARCH=${{ matrix.arch }} INSTRUCTLAB_IMAGE=${{env.REGISTRY}}/${{env.REGISTRY_ORG}}/instruct-${{ matrix.gpu }}:latest
working-directory: ${{ matrix.context }}
- name: Push image
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: redhat-actions/push-to-registry@v2.8
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ${{ env.REGISTRY }}
image: ${{ matrix.image_name }}
tags: latest
registry: ${{ env.REGISTRY }}/${{ env.REGISTRY_ORG }}
- name: Publish Job Results to Slack
id: slack
@ -190,3 +222,26 @@ jobs:
}
env:
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
stop-runner:
name: Stop self-hosted EC2 runner
needs:
- start-runner
- bootc-images
- nvidia-bootc-image
runs-on: ubuntu-latest
if: ${{ always() }} # required to stop the runner even if the error happened in the previous jobs
steps:
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}
- name: Stop EC2 runner
uses: machulav/ec2-github-runner@v2
with:
mode: stop
github-token: ${{ secrets.GH_PERSONAL_ACCESS_TOKEN }}
label: ${{ needs.start-runner.outputs.label }}
ec2-instance-id: ${{ needs.start-runner.outputs.ec2-instance-id }}

4
.gitignore vendored
View File

@ -10,5 +10,9 @@ models/*
convert_models/converted_models
recipes/common/bin/*
*/.venv/
**/venv/**
training/cloud/examples
training/instructlab/instructlab
vector_dbs/milvus/volumes/milvus/*
.idea
**/volumes/**

View File

@ -1 +1 @@
* @MichaelClifford @rhatdan @sallyom @lmilbaum @cgwalters @Gregory-Pereira
* @MichaelClifford @rhatdan @sallyom @cgwalters @Gregory-Pereira @jeffmaury

View File

@ -44,7 +44,7 @@ application:
containerfile: ./base/Containerfile
model-service: true
backend:
- llama
- llama-cpp
arch:
- arm64
- amd64

View File

@ -1,5 +1,7 @@
# AI Lab Recipes
![](/assets/ai_lab_recipes_logo.png)
This repo contains recipes for building and running containerized AI and LLM
Applications with Podman.
@ -54,3 +56,15 @@ currently built images are tracked in
## [Training](./training/README.md)
Linux Operating System Bootable containers enabled for AI Training
## Setting Up Git Hooks
To install our standard git hooks, run the following command:
```sh
./install-hooks.sh
```
### pre-commit hook
Ensures that `training/ilab-wrapper/ilab` is duplicated into `training/nvidia-bootc/duplicated/ilab-wrapper/ilab`

View File

@ -16,11 +16,6 @@
Images used in the `Bootc` aspect of this repo or tooling images
- quay.io/ai-lab/nvidia-builder:latest
- quay.io/ai-lab/instructlab-nvidia:latest
- quay.io/ai-lab/nvidia-bootc:latest
- quay.io/ai-lab/intel-bootc:latest
- quay.io/ai-lab/amd-bootc:latest
- quay.io/ai-lab/chromadb:latest
- quay.io/ai-lab/model-converter:latest

Binary file not shown.

After

Width:  |  Height:  |  Size: 205 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 KiB

BIN
assets/rag_nodejs.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

47
ci/trace-steps.py Normal file
View File

@ -0,0 +1,47 @@
import os
import time
from datetime import datetime
from opentelemetry import trace
from opentelemetry.sdk.resources import Resource
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import BatchSpanProcessor, ConsoleSpanExporter
from opentelemetry.exporter.otlp.proto.grpc.trace_exporter import OTLPSpanExporter
service_name = os.getenv("WORKFLOW_NAME", "default_service")
job_name = os.getenv("JOB_NAME", "default_job")
resource = Resource.create({"service.name": service_name})
trace.set_tracer_provider(TracerProvider(resource=resource))
tracer = trace.get_tracer(__name__)
console_span_processor = BatchSpanProcessor(ConsoleSpanExporter())
trace.get_tracer_provider().add_span_processor(console_span_processor)
# Adding OTLP Span Exporter for actual data export
otlp_exporter = OTLPSpanExporter(endpoint="localhost:4317", insecure=True)
otlp_span_processor = BatchSpanProcessor(otlp_exporter)
trace.get_tracer_provider().add_span_processor(otlp_span_processor)
print("Tracer initialized with service name:", service_name)
def set_start_time():
start_time = datetime.now().timestamp()
with open("/tmp/start_time.txt", "w") as file:
file.write(str(start_time))
print("Start time recorded")
def calculate_duration():
with open("/tmp/start_time.txt", "r") as file:
start_time = float(file.read())
end_time = datetime.now().timestamp()
duration = end_time - start_time
print(f"Total Duration: {duration}s")
with tracer.start_as_current_span(job_name) as span:
span.set_attribute("total_duration_s", duration)
if __name__ == "__main__":
action = os.getenv("TRACE_ACTION", "start")
if action == "start":
set_start_time()
elif action == "end":
calculate_duration()

View File

@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /opt/app-root/src/converter
USER root
RUN chown -R default:root /opt/app-root/src/converter

View File

@ -19,10 +19,10 @@ podman build -t converter .
## Quantize and Convert
You can run the conversion image directly with podman in the terminal. You just need to provide it with the huggingface model name you want to download, the quantization level you want to use and whether or not you want to keep the raw files after conversion.
You can run the conversion image directly with podman in the terminal. You just need to provide it with the huggingface model name you want to download, the quantization level you want to use and whether or not you want to keep the raw files after conversion. "HF_TOKEN" is optional, it is required for private models.
```bash
podman run -it --rm -v models:/converter/converted_models -e HF_MODEL_URL=<ORG/MODEL_NAME> -e QUANTIZATION=Q4_K_M -e KEEP_ORIGINAL_MODEL="False"
podman run -it --rm -v models:/converter/converted_models -e HF_MODEL_URL=<ORG/MODEL_NAME> -e HF_TOKEN=<YOUR_HF_TOKEN_ID> -e QUANTIZATION=Q4_K_M -e KEEP_ORIGINAL_MODEL="False" converter
```
You can also use the UI shown above to do the same.

View File

@ -3,9 +3,11 @@ import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-m", "--model")
parser.add_argument("-t", "--token")
args = parser.parse_args()
snapshot_download(repo_id=args.model,
token=args.token,
local_dir=f"converted_models/{args.model}",
local_dir_use_symlinks=True,
cache_dir=f"converted_models/cache")

View File

@ -1,6 +1,7 @@
#! /bin/bash
hf_model_url=${HF_MODEL_URL}
hf_token=${HF_TOKEN:="None"}
model_org=$(echo $hf_model_url | sed -n 's/\(.*\)\/\(.*\)/\1/p')
model_name=$(echo $hf_model_url | sed -n 's/\(.*\)\/\(.*\)/\2/p')
keep_orgi=${KEEP_ORIGINAL_MODEL}
@ -15,11 +16,11 @@ if [ -e "/opt/app-root/src/converter/converted_models/cache/models--$model_org--
fi
echo "Downloading $hf_model_url"
python download_huggingface.py --model $hf_model_url
python llama.cpp/convert.py /opt/app-root/src/converter/converted_models/$hf_model_url
python llama.cpp/convert-hf-to-gguf.py /opt/app-root/src/converter/converted_models/$hf_model_url
python download_huggingface.py --model $hf_model_url --token $hf_token
python llama.cpp/examples/convert_legacy_llama.py /opt/app-root/src/converter/converted_models/$hf_model_url
python llama.cpp/convert_hf_to_gguf.py /opt/app-root/src/converter/converted_models/$hf_model_url
mkdir -p /opt/app-root/src/converter/converted_models/gguf/
llama.cpp/quantize /opt/app-root/src/converter/converted_models/$hf_model_url/ggml-model-f16.gguf /opt/app-root/src/converter/converted_models/gguf/$model_org-$model_name-${QUANTIZATION}.gguf ${QUANTIZATION}
llama.cpp/llama-quantize /opt/app-root/src/converter/converted_models/$hf_model_url/ggml-model-f16.gguf /opt/app-root/src/converter/converted_models/gguf/$model_org-$model_name-${QUANTIZATION}.gguf ${QUANTIZATION}
rm -rf /opt/app-root/src/converter/converted_models/$model_org
if [ $keep_orgi = "False" ]; then

View File

@ -22,6 +22,9 @@ with col2:
model_name = st.text_input(label="Enter a huggingface model url to convert",
placeholder="org/model_name")
token_id = st.text_input(label="Enter your huggingface token (optional)",
help="huggingface token is required for private model"
) or "None"
keep_files = st.checkbox("Keep huggingface model files after conversion?")
submit_button = st.button(label="submit")
if submit_button:
@ -30,8 +33,9 @@ if submit_button:
"run",
"-it",
"--rm",
"-v", f"{volume}:/opt/app-root/src/converter/converted_models",
"-e", f"HF_MODEL_URL={model_name}" ,
"-v", f"{volume}:/converter/converted_models",
"-e", f"HF_MODEL_URL={model_name}",
"-e", f"HF_TOKEN={token_id}",
"-e", f"QUANTIZATION={quantization}",
"-e", f"KEEP_ORIGINAL_MODEL={keep_files}",
"converter"],stdout=subprocess.PIPE)

View File

@ -0,0 +1,98 @@
from langchain.embeddings.sentence_transformer import SentenceTransformerEmbeddings
from langchain_openai import ChatOpenAI
from langchain.chains import LLMChain
from langchain_core.prompts import ChatPromptTemplate, MessagesPlaceholder
import matplotlib.pyplot as plt
import os
from scipy.spatial.distance import cosine
import streamlit as st
model_service = os.getenv("MODEL_ENDPOINT",
"http://localhost:8001")
model_service = f"{model_service}/v1"
embedding_model = os.getenv("EMBEDDING_MODEL",
"BAAI/bge-base-en-v1.5")
def get_embedding(string, e):
embeddings = e.embed_query(string)
return embeddings
st.title("📊 Create Custom LLM Eval Set")
if "Question" not in st.session_state:
st.session_state["Question"] = "What is the Higgs Boson?"
if "Answers" not in st.session_state:
st.session_state["Answers"] = {}
st.session_state["Answers"]["Right_Answer_1"] = "The Higgs boson, sometimes called the Higgs particle, is an elementary particle in the Standard Model of particle physics produced by the quantum excitation of the Higgs field, one of the fields in particle physics theory"
st.session_state["Answers"]["Wrong_Answer_1"] = "Alan Turing was the first person to conduct substantial research in the field that he called machine intelligence."
st.session_state["Question"] = st.text_input(label="Question", value=st.session_state["Question"])
col1,col2,col3 = st.columns(3)
with col1:
st.session_state["Answers"]["Right_Answer_1"] = st.text_input("Right Answer 1",
value=st.session_state["Answers"]["Right_Answer_1"])
with col2:
st.session_state["Answers"]["Right_Answer_2"] = st.text_input("Right Answer 2")
with col3:
st.session_state["Answers"]["Right_Answer_3"] = st.text_input("Right Answer 3")
col1,col2,col3 = st.columns(3)
with col1:
st.session_state["Answers"]["Wrong_Answer_1"] = st.text_input("Wrong Answer 1",
value=st.session_state["Answers"]["Wrong_Answer_1"])
with col2:
st.session_state["Answers"]["Wrong_Answer_2"] = st.text_input("Wrong Answer 2")
with col3:
st.session_state["Answers"]["Wrong_Answer_3"] = st.text_input("Wrong Answer 3")
text = {k:[v] for (k,v) in st.session_state["Answers"].items() if v != ""}
text["Question"] = [st.session_state["Question"]]
e = SentenceTransformerEmbeddings(model_name=embedding_model)
for t in text.keys():
text[t].append(get_embedding(text[t][0],e))
answer_embedding = text["Question"][1]
for t in text.keys():
question_embedding = text[t][1]
distance = cosine(answer_embedding, question_embedding)
text[t].append(round(distance,3))
distances = [text[key][2] for key in text.keys()]
ones = [1]* len(distances)
fig = plt.figure()
plt.vlines(1,.001,1)
plt.scatter(ones, distances)
for key in text.keys():
plt.annotate(key,(1, text[key][2]))
plt.xticks([])
plt.ylabel("Cosine Similarity")
st.pyplot(fig)
submit = st.button("Check Against Model")
if submit:
llm = ChatOpenAI(base_url=model_service,
api_key="sk-no-key-required")
prompt = ChatPromptTemplate.from_messages([
("system", "You are world class technical advisor."),
("user", "{input}")])
chain = LLMChain(llm=llm,
prompt=prompt,
verbose=False,)
response = chain.invoke(st.session_state["Question"])
st.session_state["Answers"]["LLM Response"] = response["text"]
st.markdown(st.session_state["Answers"]["LLM Response"])
st.rerun()

15
eval/promptfoo/README.md Normal file
View File

@ -0,0 +1,15 @@
# LLM Evaluation with Promptfoo
We are using the [Promptfoo.dev](https://www.promptfoo.dev/) project for LLM model evaluation.
```
podman build -t promptfoo eval/promptfoo/build
```
Make sure you are running an LLM before starting the promptfoo container.
```
podman run -it -p 15500:15500 -v <LOCAL/PATH/TO/>/locallm/eval/promptfoo/evals/:/promptfoo/evals:ro promptfoo
```
Go to `http://0.0.0.0:15500/setup/` to set up your tests.

View File

@ -0,0 +1,8 @@
FROM registry.access.redhat.com/ubi9/nodejs-20-minimal:1-63.1725851021
WORKDIR /promptfoo
RUN npm install promptfoo
ENV PROMPTFOO_DISABLE_TELEMETRY=1
RUN mkdir evals
ENV PROMPTFOO_CONFIG_DIR=/promptfoo/evals
COPY promptfooconfig.yaml /promptfoo
ENTRYPOINT [ "npx", "promptfoo@latest", "view", "--yes" ]

View File

@ -0,0 +1,31 @@
# This configuration compares LLM output of 2 prompts x 2 GPT models across 3 test cases.
# Learn more: https://promptfoo.dev/docs/configuration/guide
description: 'My first eval'
prompts:
- "Write a tweet about {{topic}}"
- "Write a very concise, funny tweet about {{topic}}"
providers:
- openai:gpt-3.5-turbo-0613
- openai:gpt-4
tests:
- vars:
topic: bananas
- vars:
topic: avocado toast
assert:
# For more information on assertions, see https://promptfoo.dev/docs/configuration/expected-outputs
- type: icontains
value: avocado
- type: javascript
value: 1 / (output.length + 1) # prefer shorter outputs
- vars:
topic: new york city
assert:
# For more information on model-graded evals, see https://promptfoo.dev/docs/configuration/expected-outputs/model-graded
- type: llm-rubric
value: ensure that the output is funny

View File

@ -0,0 +1 @@
Directory to store evaluation runs locally

13
hooks/pre-commit Executable file
View File

@ -0,0 +1,13 @@
#!/bin/bash
SOURCE_FILE="training/ilab-wrapper/ilab"
DEST_FILE="training/nvidia-bootc/duplicated/ilab-wrapper/ilab"
if [[ -f "$SOURCE_FILE" ]]; then
mkdir -p "$(dirname "$DEST_FILE")"
cp "$SOURCE_FILE" "$DEST_FILE"
git add "$DEST_FILE"
else
echo "Source file $SOURCE_FILE does not exist. Aborting commit."
exit 1
fi

8
install-hooks.sh Executable file
View File

@ -0,0 +1,8 @@
#!/bin/bash
HOOKS_DIR="hooks"
GIT_HOOKS_DIR=".git/hooks"
cp "$HOOKS_DIR/pre-commit" "$GIT_HOOKS_DIR/pre-commit"
echo "Hooks installed successfully."

View File

@ -1,6 +1,8 @@
CONTAINER_TOOL ?= podman
REGISTRY ?= quay.io
REGISTRY_ORG ?= ai-lab
COMPONENT ?= model_servers
CHAT_FORMAT ?=
BIND_MOUNT_OPTIONS := ro
OS := $(shell uname -s)
@ -10,7 +12,7 @@ endif
.PHONY: build
build:
podman build --squash-all --build-arg $(PORT) -t $(IMAGE) . -f base/Containerfile
podman build --squash-all --build-arg PORT=$(PORT) -t $(IMAGE) . -f base/Containerfile
.PHONY: install
install:
@ -35,7 +37,15 @@ clean:
.PHONY: run
run:
cd ../../models && \
podman run -it -d -p $(PORT):$(PORT) -v ./$(MODEL_NAME):$(MODELS_PATH)/$(MODEL_NAME):$(BIND_MOUNT_OPTIONS) -e MODEL_PATH=$(MODELS_PATH)/$(MODEL_NAME) -e HOST=0.0.0.0 -e PORT=$(PORT) $(IMAGE)
podman run -it \
-d \
-p $(PORT):$(PORT) \
-v ./$(MODEL_NAME):$(MODELS_PATH)/$(MODEL_NAME):$(BIND_MOUNT_OPTIONS) \
-e MODEL_PATH=$(MODELS_PATH)/$(MODEL_NAME) \
-e HOST=0.0.0.0 \
-e PORT=$(PORT) \
$(CHAT_FORMAT:%=-e CHAT_FORMAT=${CHAT_FORMAT}) \
$(IMAGE)
.PHONY: podman-clean
podman-clean:

View File

@ -1,6 +1,6 @@
APP := llamacpp_python
PORT ?= 8001
CHAT_FORMAT ?= openchat
CHAT_FORMAT ?=
include ../common/Makefile.common
@ -17,11 +17,13 @@ all: build download-model-granite run
.PHONY: build-cuda
build-cuda:
podman build --squash-all -t $(CUDA_IMAGE) . -f cuda/Containerfile
"${CONTAINER_TOOL}" build --squash-all -t $(CUDA_IMAGE) . -f cuda/Containerfile
.PHONY: build-vulkan
build-vulkan:
podman build --squash-all -t $(VULKAN_IMAGE) . -f vulkan/Containerfile
.PHONY: build-vulkan-amd64 build-vulkan-arm64
build-vulkan-amd64:
"${CONTAINER_TOOL}" build --squash-all -t $(VULKAN_IMAGE) . -f vulkan/amd64/Containerfile
build-vulkan-arm64:
"${CONTAINER_TOOL}" build --squash-all -t $(VULKAN_IMAGE) . -f vulkan/arm64/Containerfile
.PHONY: download-model-granite # default model
download-model-granite:

View File

@ -1,26 +1,27 @@
# Llamacpp_Python Model Sever
# Llamacpp_Python Model Server
The llamacpp_python model server images are based on the [llama-cpp-python](https://github.com/abetlen/llama-cpp-python) project that provides python bindings for [llama.cpp](https://github.com/ggerganov/llama.cpp). This provides us with a python based and OpenAI API compatible model server that can run LLM's of various sizes locally across Linux, Windows or Mac.
This model server requires models to be converted from their original format, typically a set of `*.bin` or `*.safetensor` files into a single GGUF formatted file. Many models are available in GGUF format already on [huggingface.co](https://huggingface.co). You can also use the [model converter utility](../../convert_models/) available in this repo to convert models yourself.
This model server requires models to be converted from their original format, typically a set of `*.bin` or `*.safetensor` files into a single GGUF formatted file. Many models are available in GGUF format already on [huggingface.co](https://huggingface.co). You can also use the [model converter utility](../../convert_models/) available in this repo to convert models yourself.
## Image Options
We currently provide 3 options for the llamacpp_python model server:
* [Base](#base)
We currently provide 3 options for the llamacpp_python model server:
* [Base](#base)
* [Cuda](#cuda)
* [Vulkan (experimental)](#vulkan-experimental)
* [Vulkan (experimental)](#vulkan-experimental)
### Base
The [base image](../llamacpp_python/base/Containerfile) is the standard image that works for both arm64 and amd64 environments. However, it does not includes any hardware acceleration and will run with CPU only. If you use the base image, make sure that your container runtime has sufficient resources to run the desired model(s).
The [base image](../llamacpp_python/base/Containerfile) is the standard image that works for both arm64 and amd64 environments. However, it does not includes any hardware acceleration and will run with CPU only. If you use the base image, make sure that your container runtime has sufficient resources to run the desired model(s).
To build the base model service image:
```bash
make -f Makefile build
make build
```
To pull the base model service image:
```bash
@ -30,11 +31,12 @@ podman pull quay.io/ai-lab/llamacpp_python
### Cuda
The [Cuda image](../llamacpp_python/cuda/Containerfile) include all the extra drivers necessary to run our model server with Nvidia GPUs. This will significant speed up the models response time over CPU only deployments.
The [Cuda image](../llamacpp_python/cuda/Containerfile) include all the extra drivers necessary to run our model server with Nvidia GPUs. This will significant speed up the models response time over CPU only deployments.
To Build the the Cuda variant image:
```bash
make -f Makefile build-cuda
make build-cuda
```
To pull the base model service image:
@ -45,9 +47,10 @@ podman pull quay.io/ai-lab/llamacpp_python_cuda
**IMPORTANT!**
To run the Cuda image with GPU acceleration, you need to install the correct [Cuda drivers](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#driver-installation) for your system along with the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#). Please use the links provided to find installation instructions for your system.
To run the Cuda image with GPU acceleration, you need to install the correct [Cuda drivers](https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#driver-installation) for your system along with the [Nvidia Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html#). Please use the links provided to find installation instructions for your system.
Once those are installed you can use the container toolkit CLI to discover your Nvidia device(s).
Once those are installed you can use the container toolkit CLI to discover your Nvidia device(s).
```bash
sudo nvidia-ctk cdi generate --output=/etc/cdi/nvidia.yaml
```
@ -57,13 +60,15 @@ Finally, you will also need to add `--device nvidia.com/gpu=all` to your `podman
### Vulkan (experimental)
The [Vulkan image](../llamacpp_python/vulkan/Containerfile) is experimental, but can be used for gaining partial GPU access on an M-series Mac, significantly speeding up model response time over a CPU only deployment. This image requires that your podman machine provider is "applehv" and that you use krunkit instead of vfkit. Since these tools are not currently supported by podman desktop this image will remain "experimental".
The [Vulkan](https://docs.vulkan.org/guide/latest/what_is_vulkan.html) image ([amd64](../llamacpp_python/vulkan/amd64/Containerfile)/[arm64](../llamacpp_python/vulkan/arm64/Containerfile)) is experimental, but can be used for gaining partial GPU access on an M-series Mac, significantly speeding up model response time over a CPU only deployment. This image requires that your podman machine provider is "applehv" and that you use krunkit instead of vfkit. Since these tools are not currently supported by podman desktop this image will remain "experimental".
To build the Vulkan model service variant image:
```bash
make -f Makefile build-vulkan
```
| System Architecture | Command |
|---|---|
| amd64 | make build-vulkan-amd64 |
| arm64 | make build-vulkan-arm64 |
To pull the base model service image:
```bash
@ -71,13 +76,12 @@ podman pull quay.io/ai-lab/llamacpp_python_vulkan
```
## Download Model(s)
There are many models to choose from these days, most of which can be found on [huggingface.co](https://huggingface.co). In order to use a model with the llamacpp_python model server, it must be in GGUF format. You can either download pre-converted GGUF models directly or convert them yourself with the [model converter utility](../../convert_models/) available in this repo.
A well performant Apache-2.0 licensed models that we recommend using if you are just getting started is
`granite-7b-lab`. You can use the link below to quickly download a quantized (smaller) GGUF version of this model for use with the llamacpp_python model server.
`granite-7b-lab`. You can use the link below to quickly download a quantized (smaller) GGUF version of this model for use with the llamacpp_python model server.
Download URL: [https://huggingface.co/instructlab/granite-7b-lab-GGUF/resolve/main/granite-7b-lab-Q4_K_M.gguf](https://huggingface.co/instructlab/granite-7b-lab-GGUF/resolve/main/granite-7b-lab-Q4_K_M.gguf)
@ -86,7 +90,7 @@ Place all models in the [models](../../models/) directory.
You can use this snippet below to download the default model:
```bash
make -f Makefile download-model-granite
make download-model-granite
```
Or you can use the generic `download-models` target from the `/models` directory to download any model file from huggingface:
@ -105,29 +109,30 @@ make MODEL_NAME=<model_name> MODEL_URL=<model_url> -f Makefile download-model
To deploy the LLM server you must specify a volume mount `-v` where your models are stored on the host machine and the `MODEL_PATH` for your model of choice. The model_server is most easily deploy from calling the make command: `make -f Makefile run`. Of course as with all our make calls you can pass any number of the following variables: `REGISTRY`, `IMAGE_NAME`, `MODEL_NAME`, `MODEL_PATH`, and `PORT`.
```bash
podman run --rm -it \
podman run --rm -d \
-p 8001:8001 \
-v Local/path/to/locallm/models:/locallm/models:ro \
-e MODEL_PATH=models/granite-7b-lab-Q4_K_M.gguf
-e HOST=0.0.0.0
-e PORT=8001
-e MODEL_CHAT_FORMAT=openchat
llamacpp_python \
-e MODEL_PATH=models/granite-7b-lab-Q4_K_M.gguf \
-e HOST=0.0.0.0 \
-e PORT=8001 \
-e MODEL_CHAT_FORMAT=openchat \
llamacpp_python
```
or with Cuda image
```bash
podman run --rm -it \
--device nvidia.com/gpu=all
podman run --rm -d \
--device nvidia.com/gpu=all \
-p 8001:8001 \
-v Local/path/to/locallm/models:/locallm/models:ro \
-e MODEL_PATH=models/granite-7b-lab-Q4_K_M.gguf
-e HOST=0.0.0.0
-e PORT=8001
-e MODEL_CHAT_FORMAT=openchat
llamacpp_python \
-e MODEL_PATH=models/granite-7b-lab-Q4_K_M.gguf \
-e HOST=0.0.0.0 \
-e PORT=8001 \
-e MODEL_CHAT_FORMAT=openchat \
llamacpp_python
```
### Multiple Model Service:
To enable dynamic loading and unloading of different models present on your machine, you can start the model service with a `CONFIG_PATH` instead of a `MODEL_PATH`.
@ -154,10 +159,10 @@ Here is an example `models_config.json` with two model options.
}
```
Now run the container with the specified config file.
Now run the container with the specified config file.
```bash
podman run --rm -it -d \
podman run --rm -d \
-p 8001:8001 \
-v Local/path/to/locallm/models:/locallm/models:ro \
-e CONFIG_PATH=models/<config-filename> \
@ -172,4 +177,4 @@ Running tests
```bash
make -f Makefile test
```
```

View File

@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-311:1-62
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /locallm
COPY src .
USER root

View File

@ -4,7 +4,7 @@ RUN dnf install -y gcc-toolset-13-gcc gcc-toolset-13-gcc-c++
USER 1001
WORKDIR /locallm
COPY src .
ENV CMAKE_ARGS="-DLLAMA_CUBLAS=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF"
ENV CMAKE_ARGS="-DGGML_CUDA=on -DLLAMA_AVX2=OFF -DLLAMA_FMA=OFF -DLLAMA_F16C=OFF"
ENV FORCE_CMAKE=1
RUN CC="/opt/rh/gcc-toolset-13/root/usr/bin/gcc" CXX="/opt/rh/gcc-toolset-13/root/usr/bin/g++" pip install --no-cache-dir -r ./requirements.txt
ENTRYPOINT [ "sh", "run.sh" ]

View File

@ -1,2 +1,3 @@
llama-cpp-python[server]==0.2.65
llama-cpp-python[server]==0.2.90
transformers==4.41.2
pip==24.0

View File

@ -4,8 +4,21 @@ if [ ${CONFIG_PATH} ] || [[ ${MODEL_PATH} && ${CONFIG_PATH} ]]; then
exit 0
fi
if [ "${MODEL_HF_PRETRAINED_MODEL}" == "None" ]; then
MODEL_HF_PRETRAINED_MODEL=""
fi
if [ ${MODEL_PATH} ]; then
python -m llama_cpp.server --model ${MODEL_PATH} --host ${HOST:=0.0.0.0} --port ${PORT:=8001} --n_gpu_layers ${GPU_LAYERS:=0} --clip_model_path ${CLIP_MODEL_PATH:=None} --chat_format ${MODEL_CHAT_FORMAT:="llama-2"}
python -m llama_cpp.server \
--model ${MODEL_PATH} \
--host ${HOST:=0.0.0.0} \
--port ${PORT:=8001} \
--n_gpu_layers ${GPU_LAYERS:=0} \
--clip_model_path ${CLIP_MODEL_PATH:=None} \
--chat_format ${MODEL_CHAT_FORMAT:=llama-2} \
${PRETRAINED_MODEL_PATH:=} \
${MODEL_HF_PRETRAINED_MODEL:+--hf_pretrained_model_name_or_path ${MODEL_HF_PRETRAINED_MODEL}} \
--interrupt_requests ${INTERRUPT_REQUESTS:=False}
exit 0
fi

View File

@ -203,7 +203,7 @@
"from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler\n",
"\n",
"\n",
"llm = OpenAI(temperature=0.9,model_name=\"llama2\", base_url=\"http://localhost:8000/v1\", \n",
"llm = OpenAI(temperature=0.9,model_name=\"instructlab/granite-7b-lab\", base_url=\"http://localhost:8000/v1\", \n",
" openai_api_key=\"sk-no-key-required\", streaming=True,\n",
" callbacks=[StreamingStdOutCallbackHandler()])\n",
"text = \"What would be a good company name for a company that makes colorful socks?\"\n",

View File

@ -0,0 +1,17 @@
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
USER 0
RUN dnf install -y python3-dnf-plugin-versionlock
RUN dnf install -y mesa-vulkan-drivers-24.1.2-3.el9.x86_64
RUN dnf versionlock mesa-vulkan-drivers-24.1.2-3.el9.x86_64
RUN dnf install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm
RUN dnf install -y git cmake ninja-build gcc gcc-c++
RUN dnf copr enable -y ligenix/enterprise-sandbox epel-9-x86_64
RUN dnf install -y vulkan-headers vulkan-tools
USER 1001
WORKDIR /locallm
COPY src .
RUN pip install --upgrade pip
ENV CMAKE_ARGS="-DLLAMA_VULKAN=on"
ENV FORCE_CMAKE=1
RUN pip install --no-cache-dir --upgrade -r /locallm/requirements.txt
ENTRYPOINT [ "sh", "run.sh" ]

View File

@ -1,9 +1,11 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
USER 0
RUN dnf install -y python3-dnf-plugin-versionlock && \
dnf install -y \
https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm && \
dnf copr enable -y slp/mesa-krunkit epel-9-aarch64 && \
dnf install -y mesa-vulkan-drivers-23.3.3-101.el9.aarch64 && \
dnf versionlock mesa-vulkan-drivers-23.3.3-101.el9.aarch64 && \
dnf install -y mesa-vulkan-drivers-24.1.2-101.el9.aarch64 && \
dnf versionlock mesa-vulkan-drivers-24.1.2-101.el9.aarch64 && \
dnf install -y git cmake ninja-build gcc gcc-c++ vulkan-loader-devel vulkan-tools
USER 1001
WORKDIR /locallm

View File

@ -1,33 +1,33 @@
APP := object_detection_python
PORT ?= 8000
include ../common/Makefile.common
IMAGE_NAME ?= $(REGISTRY_ORG)/$(COMPONENT)/$(APP):latest
IMAGE := $(REGISTRY)/$(IMAGE_NAME)
CUDA_IMAGE := $(REGISTRY)/$(REGISTRY_ORG)/$(COMPONENT)/$(APP)_cuda:latest
VULKAN_IMAGE := $(REGISTRY)/$(REGISTRY_ORG)/$(COMPONENT)/$(APP)_vulkan:latest
REGISTRY ?= ghcr.io
REGISTRY_ORG ?= containers
MODEL_NAME ?= facebook/detr-resnet-101
MODELS_DIR := /models
MODELS_DIR := /app/models
include ../common/Makefile.common
IMAGE_NAME ?= $(REGISTRY_ORG)/$(APP):latest
IMAGE := $(REGISTRY)/$(IMAGE_NAME)
# Run override required because of the multi-directory models and model_path vs models_dir
.PHONY: run
run:
cd ../../models && \
podman run -it -d -p $(PORT):$(PORT) -v ./$(MODEL_NAME):$(MODELS_DIR)/$(MODEL_NAME):$(BIND_MOUNT_OPTIONS) -e MODEL_PATH=$(MODELS_DIR)/$(MODEL_NAME) -e HOST=0.0.0.0 -e PORT=$(PORT) $(IMAGE)
.PHONY: all
all: build download-model-facebook-detr-resnet-101 run
.PHONY: download-model-facebook-detr-resnet-101
download-model-facebook-detr-resnet-101:
cd ../../models/ && \
python download_hf_models.py -m facebook/detr-resnet-101
cd ../../models && \
make download-model-facebook-detr-resnet-101
.PHONY: test
test:
$(MAKE) download-model-facebook-detr-resnet-101
ln -s ../../models/detr-resnet-101 ./
PORT=$(PORT) MODEL_NAME=$(MODEL_NAME) MODELS_PATH=$(MODELS_PATH) IMAGE=$(IMAGE) PULL_ALWAYS=0 pytest -s -vvv
pip install -r ../../convert_models/requirements.txt
cp -r ../../models/facebook ./
REGISTRY=$(REGISTRY) MODEL_NAME=$(MODEL_NAME) MODELS_DIR=$(MODELS_DIR) IMAGE_NAME=$(IMAGE_NAME) PORT=$(PORT) pytest -s -vvv

View File

@ -1,9 +1,8 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
ARG PORT=8000
WORKDIR /app
COPY src/requirements.txt .
COPY src .
RUN pip install --upgrade pip && \
pip install --no-cache-dir --upgrade -r requirements.txt
COPY src/object_detection_server.py .
EXPOSE $PORT
ENTRYPOINT [ "uvicorn", "object_detection_server:app", "--host", "0.0.0.0" ]
ENTRYPOINT [ "sh", "./run.sh" ]

View File

@ -11,7 +11,7 @@ import shutil
app = FastAPI()
model = os.getenv("MODEL_PATH", default="facebook/detr-resnet-101")
model = os.getenv("MODEL_PATH", default="/app/models/facebook/detr-resnet-101")
revision = os.getenv("MODEL_REVISION", default="no_timm")
if os.path.isfile(model):
@ -30,6 +30,10 @@ else:
class Item(BaseModel):
image: bytes
@app.get("/health")
def tests_alive():
return {"alive": True}
@app.post("/detection")
def detection(item: Item):
b64_image = item.image

View File

@ -0,0 +1,8 @@
fastapi
pillow
pydantic
requests
transformers
torch
uvicorn
timm

View File

@ -1,36 +1,55 @@
annotated-types==0.6.0
anyio==4.3.0
certifi==2024.2.2
annotated-types==0.7.0
anyio==4.4.0
certifi==2024.6.2
charset-normalizer==3.3.2
click==8.1.7
fastapi==0.110.3
filelock==3.13.4
fsspec==2024.3.1
h11==0.14.0
huggingface-hub==0.22.2
click==8.1.8
dnspython==2.6.1
email_validator==2.2.0
fastapi==0.111.1
fastapi-cli==0.0.7
filelock==3.15.4
fsspec==2024.6.1
h11==0.16.0
httpcore==1.0.9
httptools==0.6.4
httpx==0.27.2
huggingface-hub==0.23.4
idna==3.7
Jinja2==3.1.3
Jinja2==3.1.6
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
mpmath==1.3.0
networkx==3.3
numpy==1.26.4
packaging==24.0
numpy==2.0.1
orjson==3.10.18
packaging==24.1
pillow==10.3.0
pydantic==2.7.1
pydantic_core==2.18.2
PyYAML==6.0.1
regex==2024.4.28
requests==2.31.0
safetensors==0.4.3
pydantic==2.7.4
pydantic_core==2.18.4
Pygments==2.18.0
python-dotenv==1.0.1
python-multipart==0.0.20
PyYAML==6.0.2
regex==2024.5.15
requests==2.32.3
rich==13.7.1
safetensors==0.4.5
shellingham==1.5.4
sniffio==1.3.1
starlette==0.37.2
sympy==1.12
timm==0.9.16
sympy==1.12.1
timm==1.0.15
tokenizers==0.19.1
torch==2.3.0
torchvision==0.18.0
tqdm==4.66.2
transformers==4.40.1
typing_extensions==4.11.0
urllib3==2.2.1
uvicorn==0.29.0
torch==2.3.1
torchvision==0.18.1
tqdm==4.66.5
transformers==4.41.2
typer==0.12.5
typing_extensions==4.12.2
ujson==5.10.0
urllib3==2.2.3
uvicorn==0.30.6
uvloop==0.19.0
watchfiles==0.22.0
websockets==12.0

View File

@ -0,0 +1,9 @@
#!/bin/bash
if [ ${MODEL_PATH} ]; then
PORT=${PORT} MODEL_PATH=${MODEL_PATH} uvicorn object_detection_server:app --port ${PORT:=8000} --host ${HOST:=0.0.0.0}
exit 0
fi
echo "Please set either a MODEL_PATH"
exit 1

View File

@ -0,0 +1,46 @@
import pytest_container
import os
REGISTRY = os.getenv("REGISTRY", "ghcr.io")
IMAGE_NAME = os.getenv("IMAGE_NAME", "containers/object_detection_python:latest")
MODEL_NAME = os.getenv("MODEL_NAME", "facebook/detr-resnet-101")
MODELS_DIR = os.getenv("MODELS_DIR", "/app/models")
MODEL_PATH = f"{MODELS_DIR}/{MODEL_NAME}"
PORT = os.getenv("PORT", 8000)
if type(PORT) == str:
try:
PORT = int(PORT)
except:
PORT = 8000
MS = pytest_container.Container(
url=f"containers-storage:{REGISTRY}/{IMAGE_NAME}",
volume_mounts=[
pytest_container.container.BindMount(
container_path=f"{MODEL_PATH}",
host_path=f"./{MODEL_NAME}",
flags=["ro"]
)
],
extra_environment_variables={
"MODEL_PATH": f"{MODEL_PATH}",
"HOST": "0.0.0.0",
"PORT": f"{PORT}",
"IMAGE_NAME": f"{IMAGE_NAME}",
"REGISTRY": f"{REGISTRY}"
},
forwarded_ports=[
pytest_container.PortForwarding(
container_port=PORT,
host_port=PORT
)
],
)
def pytest_generate_tests(metafunc):
pytest_container.auto_container_parametrize(metafunc)
def pytest_addoption(parser):
pytest_container.add_logging_level_options(parser)

View File

@ -0,0 +1,8 @@
pip==24.0
pytest-container==0.4.0
pytest-selenium==4.1.0
pytest-testinfra==10.1.0
pytest==8.1.1
requests==2.31.0
selenium==4.19.0
tenacity==8.2.3

View File

@ -0,0 +1,12 @@
import pytest_container
from .conftest import MS
import tenacity
CONTAINER_IMAGES = [MS]
def test_etc_os_release_present(auto_container: pytest_container.container.ContainerData):
assert auto_container.connection.file("/etc/os-release").exists
@tenacity.retry(stop=tenacity.stop_after_attempt(5), wait=tenacity.wait_exponential())
def test_alive(auto_container: pytest_container.container.ContainerData, host):
host.run_expect([0],f"curl http://localhost:{auto_container.forwarded_ports[0].host_port}",).stdout.strip()

View File

@ -19,6 +19,10 @@ COPY --from=builder /app /app
COPY --from=mwader/static-ffmpeg:6.1.1 /ffmpeg /bin/
COPY --from=mwader/static-ffmpeg:6.1.1 /ffprobe /bin/
COPY src /app/
COPY --chown=0:0 --chmod=755 src /app
RUN chown 1001:1001 /app
USER 1001
ENV AUDIO_FILE=/app/jfk.wav
ENTRYPOINT ["sh", "run.sh"]

View File

@ -7,7 +7,7 @@
# https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-small.bin
# podman build --build-arg="MODEL_URL=https://..." -t quay.io/yourimage .
#
FROM registry.access.redhat.com/ubi9/ubi-micro:9.3-15
FROM registry.access.redhat.com/ubi9/ubi-micro:9.4-15
# Can be substituted using the --build-arg defined above
ARG MODEL_URL=https://huggingface.co/instructlab/granite-7b-lab-GGUF/resolve/main/granite-7b-lab-Q4_K_M.gguf

View File

@ -1,3 +1,4 @@
CONTAINER_TOOL ?= podman
MODEL_URL ?= https://huggingface.co/instructlab/granite-7b-lab-GGUF/resolve/main/granite-7b-lab-Q4_K_M.gguf
MODEL_NAME ?= granite-7b-lab-Q4_K_M.gguf
@ -5,11 +6,11 @@ REGISTRY ?= quay.io
REGISTRY_ORG ?= ai-lab
COMPONENT = models
IMAGE ?= $(REGISTRY)/$(REGISTRY_ORG)/$(MODEL_NAME):latest
IMAGE ?= $(shell tr '[:upper:]' '[:lower:]' <<< $(REGISTRY)/$(REGISTRY_ORG)/$(MODEL_NAME):latest)
.PHONY: build
build:
podman build $(MODEL_URL:%=--build-arg MODEL_URL=%) -f Containerfile -t ${IMAGE} .
"${CONTAINER_TOOL}" build $(MODEL_URL:%=--build-arg MODEL_URL=%) -f Containerfile -t ${IMAGE} .
.PHONY: download-model
download-model:
@ -37,6 +38,13 @@ download-model-mistral:
download-model-mistral-code:
$(MAKE) MODEL_NAME=mistral-7b-code-16k-qlora.Q4_K_M.gguf MODEL_URL=https://huggingface.co/TheBloke/Mistral-7B-Code-16K-qlora-GGUF/resolve/main/mistral-7b-code-16k-qlora.Q4_K_M.gguf download-model
.PHONY: download-model-facebook-detr-resnet-101
download-model-facebook-detr-resnet-101:
python3 -m pip install -r ../convert_models/requirements.txt
cd ../convert_models/ && \
python3 download_huggingface.py -m facebook/detr-resnet-101
cp -r ../convert_models/converted_models/facebook ./
.PHONY: clean
clean:
-rm -f *tmp

View File

@ -9,7 +9,7 @@ application:
containerfile: ./base/Containerfile
model-service: true
backend:
- llama
- whisper-cpp
arch:
- arm64
- amd64

View File

@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /locallm
COPY requirements.txt /locallm/requirements.txt
RUN pip install --upgrade pip && \

View File

@ -8,13 +8,17 @@ st.title(":studio_microphone: Speech Recognition")
st.markdown("Upload an audio file you wish to have translated")
endpoint = os.getenv("MODEL_ENDPOINT", default="http://0.0.0.0:8001")
endpoint = f"{endpoint}/inference"
endpoint_bearer = os.getenv("MODEL_ENDPOINT_BEARER")
request_kwargs = {}
if endpoint_bearer is not None:
request_kwargs["headers"] = {"Authorization": f"Bearer {endpoint_bearer}"}
audio = st.file_uploader("", type=["wav","mp3","mp4","flac"], accept_multiple_files=False)
# read audio file
if audio:
audio_bytes = audio.read()
st.audio(audio_bytes, format='audio/wav', start_time=0)
files = {'file': audio_bytes}
response = requests.post(endpoint, files=files)
request_kwargs["files"] = {'file': audio_bytes}
response = requests.post(endpoint, **request_kwargs)
response_json = response.json()
st.subheader(f"Translated Text")
st.text_area(label="", value=response_json['text'], height=300)

View File

@ -14,8 +14,10 @@ DISK_UID ?= $(shell id -u)
DISK_GID ?= $(shell id -g)
FROM ?=
ARCH ?=
BUILD_ARG_FILE ?=
CONTAINERFILE ?= Containerfile
GRAPH_ROOT=$(shell podman info --format '{{ .Store.GraphRoot }}')
UMASK=$(shell umask)
ROOTLESS_AUTH_JSON=${XDG_RUNTIME_DIR}/containers/auth.json
ROOTFUL_AUTH_JSON=/run/containers/0/auth.json
@ -75,12 +77,16 @@ install::
.PHONY: build
build:
podman build --squash-all $(ARCH:%=--platform linux/%) $(FROM:%=--from %) -t ${APP_IMAGE} app/
podman build --squash-all \
$(ARCH:%=--platform linux/%) \
$(BUILD_ARG_FILE:%=--build-arg-file=%) \
$(FROM:%=--from %) -t ${APP_IMAGE} app/
.PHONY: bootc
bootc: quadlet growfs
podman build \
$(ARCH:%=--arch %) \
$(BUILD_ARG_FILE:%=--build-arg-file=%) \
$(FROM:%=--from %) \
$(AUTH_JSON:%=-v %:/run/containers/0/auth.json) \
--security-opt label=disable \
@ -151,15 +157,21 @@ install-chrome:
elif [[ "$(OS)" == "Darwin" ]]; then \
open $(CHROME_DOWNLOAD_PATH); \
ls "/Volumes/Google Chrome/Google Chrome.app/Contents/MacOS/Google Chrome"; \
cp -r "/Volumes/Google Chrome/Google Chrome.app" "$(RECIPE_BINARIES_PATH)/"; \
cp -pr "/Volumes/Google Chrome/Google Chrome.app" "$(RECIPE_BINARIES_PATH)/"; \
diskutil unmount "/Volumes/Google Chrome" || true; \
rm $(CHROME_DOWNLOAD_PATH); \
fi;
.PHONY: check-umask
check-umask:
@test "$(UMASK)" = "0022" || \
(echo; echo -n "Error: umask $(UMASK) will cause unexpected behaviour: use umask 022! "; \
echo "Verify the `ai-lab-recipes` git repository was cloned with umask 0022"; exit 1)
.PHONY: growfs
growfs: quadlet
growfs: quadlet check-umask
# Add growfs service
mkdir -p build; cp -R ../../common/usr build/
mkdir -p build; cp -pR ../../common/usr build/
.PHONY: quadlet
quadlet:
@ -176,7 +188,7 @@ quadlet:
-e "s|MODEL_IMAGE|${MODEL_IMAGE}|g" \
quadlet/${APP}.yaml \
> build/${APP}.yaml
cp quadlet/${APP}.kube build/${APP}.kube
cp -p quadlet/${APP}.kube build/${APP}.kube
.PHONY: run
run:

View File

@ -0,0 +1,15 @@
SHELL := /bin/bash
APP ?= object_detection_client
PORT ?= 8501
MODEL_NAME ?= facebook/detr-resnet-101
include ../../common/Makefile.common
.PHONY: functional-tests
functional-tests:
IMAGE_NAME=${IMAGE_NAME} REGISTRY=${REGISTRY} MODEL_NAME=${MODEL_NAME} pytest -vvv --driver=Chrome --driver-path=$(RECIPE_BINARIES_PATH)/chromedriver ${RELATIVE_TESTS_PATH}/functional
RECIPE_BINARIES_PATH := $(shell realpath ../../common/bin)
RELATIVE_MODELS_PATH := ../../../models
RELATIVE_TESTS_PATH := ../tests

View File

@ -56,11 +56,11 @@ The local Model Service relies on a volume mount to the localhost to access the
make run
```
As stated above, by default the model service will use [`facebook/detr-resnet-101`](https://huggingface.co/facebook/detr-resnet-101). However you can use other compatabale models. Simply pass the new `MODEL_NAME` and `MODEL_PATH` to the make command. Make sure the model is downloaded and exists in the [models directory](../../../models/):
As stated above, by default the model service will use [`facebook/detr-resnet-101`](https://huggingface.co/facebook/detr-resnet-101). However you can use other compatible models. Simply pass the new `MODEL_NAME` and `MODEL_PATH` to the make command. Make sure the model is downloaded and exists in the [models directory](../../../models/):
```bash
# from path model_servers/object_detection_python from repo containers/ai-lab-recipes
make MODEL_NAME=facebook/detr-resnet-50 MODEL_PATH=/models/facebook/detr-resnet-50 run
make MODEL_NAME=facebook/detr-resnet-50 MODEL_PATH=/models/facebook/detr-resnet-101 run
```
## Build the AI Application
@ -81,7 +81,7 @@ This could be any appropriately hosted Model Service (running locally or in the
The following Podman command can be used to run your AI Application:
```bash
podman run -p 8501:8501 -e MODEL_ENDPOINT=http://10.88.0.1:8000/detection object_detection_client
podman run -p 8501:8501 -e MODEL_ENDPOINT=http://10.88.0.1:8000 object_detection_client
```
### Interact with the AI Application

View File

@ -8,8 +8,8 @@ application:
contextdir: ../../../model_servers/object_detection_python
containerfile: ./base/Containerfile
model-service: true
backend:
- torch
backend:
- pytorch
arch:
- arm64
- amd64
@ -17,7 +17,7 @@ application:
- 8000
image: quay.io/redhat-et/locallm-object-detection-server:latest
- name: object-detection-client
contextdir: ./client
contextdir: ./app
containerfile: Containerfile
arch:
- arm64

View File

@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /locallm
COPY requirements.txt /locallm/requirements.txt
RUN pip install --upgrade pip && \

View File

@ -7,8 +7,11 @@ import io
st.title("🕵️‍♀️ Object Detection")
endpoint =os.getenv("MODEL_ENDPOINT", default = "http://0.0.0.0:8000")
endpoint_bearer = os.getenv("MODEL_ENDPOINT_BEARER")
headers = {"accept": "application/json",
"Content-Type": "application/json"}
if endpoint_bearer:
headers["Authorization"] = f"Bearer {endpoint_bearer}"
image = st.file_uploader("Upload Image")
window = st.empty()
@ -23,6 +26,8 @@ if image:
window.image(img, use_column_width=True)
# convert PIL image into bytes for post request
bytes_io = io.BytesIO()
if img.mode in ("RGBA", "P"):
img = img.convert("RGB")
img.save(bytes_io, "JPEG")
img_bytes = bytes_io.getvalue()
b64_image = base64.b64encode(img_bytes).decode('utf-8')

View File

@ -0,0 +1,40 @@
altair==5.3.0
attrs==23.2.0
blinker==1.7.0
cachetools==5.3.3
certifi==2024.2.2
charset-normalizer==3.3.2
click==8.1.8
gitdb==4.0.12
GitPython==3.1.44
idna==3.7
Jinja2==3.1.6
jsonschema==4.21.1
jsonschema-specifications==2023.12.1
markdown-it-py==3.0.0
MarkupSafe==2.1.5
mdurl==0.1.2
numpy==1.26.4
packaging==24.0
pandas==2.2.3
pillow==10.3.0
protobuf==4.25.3
pyarrow==15.0.2
pydeck==0.8.1b0
Pygments==2.17.2
python-dateutil==2.9.0.post0
pytz==2024.1
referencing==0.34.0
requests==2.31.0
rich==13.7.1
rpds-py==0.18.1
six==1.16.0
smmap==5.0.2
streamlit==1.33.0
tenacity==8.2.3
toml==0.10.2
toolz==0.12.1
tornado==6.4.2
typing_extensions==4.11.0
tzdata==2024.1
urllib3==2.2.3

View File

@ -1,3 +0,0 @@
streamlit
requests
pillow

View File

@ -0,0 +1,8 @@
import pytest
import os
@pytest.fixture
def chrome_options(chrome_options):
chrome_options.add_argument("--headless")
return chrome_options

View File

@ -0,0 +1,58 @@
import pytest_container
import os
import logging
REGISTRY=os.environ['REGISTRY']
IMAGE_NAME=os.environ['IMAGE_NAME']
MODEL_NAME=os.environ['MODEL_NAME']
logging.info("""
Starting pytest with the following ENV vars:
REGISTRY: {REGISTRY}
IMAGE_NAME: {IMAGE_NAME}
MODEL_NAME: {MODEL_NAME}
For:
model_server: whispercpp
""".format(REGISTRY=REGISTRY, IMAGE_NAME=IMAGE_NAME, MODEL_NAME=MODEL_NAME))
MS = pytest_container.Container(
url=f"containers-storage:{REGISTRY}/{IMAGE_NAME}",
volume_mounts=[
pytest_container.container.BindMount(
container_path=f"/locallm/models/${MODEL_NAME}",
host_path=f"./{MODEL_NAME}",
flags=["ro"]
)
],
extra_environment_variables={
"MODEL_PATH": f"/locall/models/{MODEL_NAME}",
"HOST": "0.0.0.0",
"PORT": "8001"
},
forwarded_ports=[
pytest_container.PortForwarding(
container_port=8001,
host_port=8001
)
],
)
CB = pytest_container.Container(
url=f"containers-storage:{os.environ['REGISTRY']}/containers/{os.environ['IMAGE_NAME']}",
extra_environment_variables={
"MODEL_ENDPOINT": "http://10.88.0.1:8001"
},
forwarded_ports=[
pytest_container.PortForwarding(
container_port=8501,
host_port=8501
)
],
)
def pytest_generate_tests(metafunc):
pytest_container.auto_container_parametrize(metafunc)
def pytest_addoption(parser):
pytest_container.add_logging_level_options(parser)

View File

@ -0,0 +1,17 @@
import pytest_container
from .conftest import CB
import tenacity
CONTAINER_IMAGES = [CB]
def test_etc_os_release_present(auto_container: pytest_container.container.ContainerData):
assert auto_container.connection.file("/etc/os-release").exists
@tenacity.retry(stop=tenacity.stop_after_attempt(5), wait=tenacity.wait_exponential())
def test_alive(auto_container: pytest_container.container.ContainerData, host):
host.run_expect([0],f"curl http://localhost:{auto_container.forwarded_ports[0].host_port}",).stdout.strip()
def test_title(auto_container: pytest_container.container.ContainerData, selenium):
selenium.get(f"http://localhost:{auto_container.forwarded_ports[0].host_port}")
assert selenium.title == "Streamlit"

View File

@ -0,0 +1,7 @@
import os
import pytest
@pytest.fixture()
def url():
return os.environ["URL"]

View File

@ -0,0 +1,3 @@
def test_title(url,selenium):
selenium.get(f"http://{url}:8501")
assert selenium.title == "Streamlit"

View File

@ -0,0 +1,8 @@
pip==24.0
pytest-container==0.4.0
pytest-selenium==4.1.0
pytest-testinfra==10.1.0
pytest==8.1.1
requests==2.31.0
selenium==4.19.0
tenacity==8.2.3

View File

@ -8,7 +8,7 @@ application:
containerfile: ./base/Containerfile
model-service: true
backend:
- llama
- llama-cpp
arch:
- arm64
- amd64

View File

@ -1,4 +1,4 @@
FROM registry.access.redhat.com/ubi9/python-311:1-52.1712567218
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /image_understanding
COPY requirements.txt .
RUN pip install --upgrade pip && \

View File

@ -0,0 +1,9 @@
SHELL := /bin/bash
APP ?= react_agent
PORT ?= 8501
include ../../common/Makefile.common
RECIPE_BINARIES_PATH := $(shell realpath ../../common/bin)
RELATIVE_MODELS_PATH := ../../../models
RELATIVE_TESTS_PATH := ../tests

View File

@ -0,0 +1,182 @@
# ReAct Agent Application
This recipe demonstrates the ReAct (Reasoning and Acting) framework in action through a music exploration application. ReAct enables AI to think step-by-step about tasks, take appropriate actions, and provide reasoned responses. The application shows how ReAct can be used to create an intelligent music discovery assistant that combines reasoning with Spotify API interactions.
The application utilizes [`llama-cpp-python`](https://github.com/abetlen/llama-cpp-python) for the Model Service and integrates with Spotify's API for music data. The recipe uses [Langchain](https://python.langchain.com/docs/get_started/introduction) for the ReAct implementation and [Streamlit](https://streamlit.io/) for the UI layer.
## Spotify API Access
To use this application, you'll need Spotify API credentials:
- Create a Spotify Developer account
- Create an application in the Spotify Developer Dashboard
- Get your Client ID and Client Secret
These can be provided through environment variables or the application's UI.
## Try the ReAct Agent Application
The [Podman Desktop](https://podman-desktop.io) [AI Lab Extension](https://github.com/containers/podman-desktop-extension-ai-lab) includes this recipe among others. To try it out, open `Recipes Catalog` -> `ReAct Agent` and follow the instructions to start the application.
# Build the Application
The rest of this document will explain how to build and run the application from the terminal, and will
go into greater detail on how each container in the Pod above is built, run, and
what purpose it serves in the overall application. All the recipes use a central [Makefile](../../common/Makefile.common) that includes variables populated with default values to simplify getting started. Please review the [Makefile docs](../../common/README.md), to learn about further customizing your application.
This application requires a model, a model service and an AI inferencing application.
* [Quickstart](#quickstart)
* [Download a model](#download-a-model)
* [Build the Model Service](#build-the-model-service)
* [Deploy the Model Service](#deploy-the-model-service)
* [Build the AI Application](#build-the-ai-application)
* [Deploy the AI Application](#deploy-the-ai-application)
* [Interact with the AI Application](#interact-with-the-ai-application)
* [Embed the AI Application in a Bootable Container Image](#embed-the-ai-application-in-a-bootable-container-image)
## Quickstart
To run the application with pre-built images from `quay.io/ai-lab`, use `make quadlet`. This command
builds the application's metadata and generates Kubernetes YAML at `./build/chatbot.yaml` to spin up a Pod that can then be launched locally.
Try it with:
```
make quadlet
podman kube play build/chatbot.yaml
```
This will take a few minutes if the model and model-server container images need to be downloaded.
The Pod is named `chatbot`, so you may use [Podman](https://podman.io) to manage the Pod and its containers:
```
podman pod list
podman ps
```
Once the Pod and its containers are running, the application can be accessed at `http://localhost:8501`. However, if you started the app via the podman desktop UI, a random port will be assigned instead of `8501`. Please use the AI App Details `Open AI App` button to access it instead.
Please refer to the section below for more details about [interacting with the chatbot application](#interact-with-the-ai-application).
To stop and remove the Pod, run:
```
podman pod stop chatbot
podman pod rm chatbot
```
## Download a model
If you are just getting started, we recommend using [granite-7b-lab](https://huggingface.co/instructlab/granite-7b-lab). This is a well
performant mid-sized model with an apache-2.0 license. In order to use it with our Model Service we need it converted
and quantized into the [GGUF format](https://github.com/ggerganov/ggml/blob/master/docs/gguf.md). There are a number of
ways to get a GGUF version of granite-7b-lab, but the simplest is to download a pre-converted one from
[huggingface.co](https://huggingface.co) here: https://huggingface.co/instructlab/granite-7b-lab-GGUF.
The recommended model can be downloaded using the code snippet below:
```bash
cd ../../../models
curl -sLO https://huggingface.co/instructlab/granite-7b-lab-GGUF/resolve/main/granite-7b-lab-Q4_K_M.gguf
cd ../recipes/natural_language_processing/chatbot
```
_A full list of supported open models is forthcoming._
## Build the Model Service
The complete instructions for building and deploying the Model Service can be found in the
[llamacpp_python model-service document](../../../model_servers/llamacpp_python/README.md).
The Model Service can be built from make commands from the [llamacpp_python directory](../../../model_servers/llamacpp_python/).
```bash
# from path model_servers/llamacpp_python from repo containers/ai-lab-recipes
make build
```
Checkout the [Makefile](../../../model_servers/llamacpp_python/Makefile) to get more details on different options for how to build.
## Deploy the Model Service
The local Model Service relies on a volume mount to the localhost to access the model files. It also employs environment variables to dictate the model used and where its served. You can start your local Model Service using the following `make` command from `model_servers/llamacpp_python` set with reasonable defaults:
```bash
# from path model_servers/llamacpp_python from repo containers/ai-lab-recipes
make run
```
## Build the AI Application
The AI Application can be built from the make command:
```bash
# Run this from the current directory (path recipes/natural_language_processing/chatbot from repo containers/ai-lab-recipes)
make build
```
## Deploy the AI Application
Make sure the Model Service is up and running before starting this container image. When starting the AI Application container image we need to direct it to the correct `MODEL_ENDPOINT`. This could be any appropriately hosted Model Service (running locally or in the cloud) using an OpenAI compatible API. In our case the Model Service is running inside the Podman machine so we need to provide it with the appropriate address `10.88.0.1`. To deploy the AI application use the following:
```bash
# Run this from the current directory (path recipes/natural_language_processing/chatbot from repo containers/ai-lab-recipes)
make run
```
## Interact with the AI Application
Everything should now be up an running with the chat application available at [`http://localhost:8501`](http://localhost:8501). By using this recipe and getting this starting point established, users should now have an easier time customizing and building their own LLM enabled chatbot applications.
## Embed the AI Application in a Bootable Container Image
To build a bootable container image that includes this sample chatbot workload as a service that starts when a system is booted, run: `make -f Makefile bootc`. You can optionally override the default image / tag you want to give the make command by specifying it as follows: `make -f Makefile BOOTC_IMAGE=<your_bootc_image> bootc`.
Substituting the bootc/Containerfile FROM command is simple using the Makefile FROM option.
```bash
make FROM=registry.redhat.io/rhel9/rhel-bootc:9.4 bootc
```
Selecting the ARCH for the bootc/Containerfile is simple using the Makefile ARCH= variable.
```
make ARCH=x86_64 bootc
```
The magic happens when you have a bootc enabled system running. If you do, and you'd like to update the operating system to the OS you just built
with the chatbot application, it's as simple as ssh-ing into the bootc system and running:
```bash
bootc switch quay.io/ai-lab/chatbot-bootc:latest
```
Upon a reboot, you'll see that the chatbot service is running on the system. Check on the service with:
```bash
ssh user@bootc-system-ip
sudo systemctl status chatbot
```
### What are bootable containers?
What's a [bootable OCI container](https://containers.github.io/bootc/) and what's it got to do with AI?
That's a good question! We think it's a good idea to embed AI workloads (or any workload!) into bootable images at _build time_ rather than
at _runtime_. This extends the benefits, such as portability and predictability, that containerizing applications provides to the operating system.
Bootable OCI images bake exactly what you need to run your workloads into the operating system at build time by using your favorite containerization
tools. Might I suggest [podman](https://podman.io/)?
Once installed, a bootc enabled system can be updated by providing an updated bootable OCI image from any OCI
image registry with a single `bootc` command. This works especially well for fleets of devices that have fixed workloads - think
factories or appliances. Who doesn't want to add a little AI to their appliance, am I right?
Bootable images lend toward immutable operating systems, and the more immutable an operating system is, the less that can go wrong at runtime!
#### Creating bootable disk images
You can convert a bootc image to a bootable disk image using the
[quay.io/centos-bootc/bootc-image-builder](https://github.com/osbuild/bootc-image-builder) container image.
This container image allows you to build and deploy [multiple disk image types](../../common/README_bootc_image_builder.md) from bootc container images.
Default image types can be set via the DISK_TYPE Makefile variable.
`make bootc-image-builder DISK_TYPE=ami`

View File

@ -0,0 +1,27 @@
version: v1.0
application:
type: language
name: ReAct_Agent_Streamlit
description: ReAct framework implementation with Spotify API integration in a web frontend
containers:
- name: llamacpp-server
contextdir: ../../../model_servers/llamacpp_python
containerfile: ./base/Containerfile
model-service: true
backend:
- llama-cpp
arch:
- arm64
- amd64
ports:
- 8001
image: quay.io/ai-lab/llamacpp_python:latest
- name: streamlit-react-agent-app
contextdir: app
containerfile: Containerfile
arch:
- arm64
- amd64
ports:
- 8501
image: quay.io/ai-lab/react-agent:latest

View File

@ -0,0 +1,8 @@
FROM registry.access.redhat.com/ubi9/python-311:1-77.1726664316
WORKDIR /agents
COPY requirements.txt .
RUN pip install --upgrade pip
RUN pip install --no-cache-dir --upgrade -r /agents/requirements.txt
COPY *.py .
EXPOSE 8501
ENTRYPOINT [ "streamlit", "run", "react-agent-app.py" ]

View File

@ -0,0 +1,386 @@
import os
from typing import Dict, List
import requests
import time
import json
import streamlit as st
from langchain_core.tools import BaseTool
from langchain_openai import ChatOpenAI
from langchain_core.prompts import ChatPromptTemplate
from langchain_core.messages import AIMessage, HumanMessage
from dotenv import load_dotenv
from typing import Any, List, Dict, Union
# Load env file
load_dotenv()
# Model service
model_service = os.getenv("MODEL_ENDPOINT", "http://localhost:8001")
model_service = f"{model_service}/v1"
# Spotify API Configuration
SPOTIFY_BASE_URL = "https://api.spotify.com/v1"
class SpotifyAPI:
def __init__(self):
self.client_id = os.getenv("SPOTIFY_CLIENT_ID")
self.client_secret = os.getenv("SPOTIFY_CLIENT_SECRET")
# If not in .env, access it through UI
if not self.client_id or not self.client_secret:
if hasattr(st.session_state, 'spotify_client_id') and hasattr(st.session_state, 'spotify_client_secret'):
self.client_id = st.session_state.spotify_client_id
self.client_secret = st.session_state.spotify_client_secret
if not self.client_id or not self.client_secret:
raise ValueError("Spotify credentials not found. Please provide them in the sidebar.")
self.access_token = self._get_access_token()
def _get_access_token(self):
"""Get Spotify access token using client credentials flow"""
auth_url = "https://accounts.spotify.com/api/token"
auth_response = requests.post(
auth_url,
data={
"grant_type": "client_credentials",
"client_id": self.client_id,
"client_secret": self.client_secret,
}
)
if auth_response.status_code != 200:
raise Exception("Failed to get access token")
return auth_response.json()["access_token"]
def search_playlists(self, query: str, limit: int = 5) -> Dict:
"""Search for playlists using Spotify API"""
enhanced_query = f"{query} playlist top popular"
headers = {
"Authorization": f"Bearer {self.access_token}",
"Content-Type": "application/json"
}
params = {
"q": enhanced_query,
"type": "playlist",
"limit": limit,
"market": "US"
}
response = requests.get(
f"{SPOTIFY_BASE_URL}/search",
headers=headers,
params=params
)
if response.status_code != 200:
raise Exception(f"Search failed: {response.json().get('error', {}).get('message')}")
return response.json()
def get_trending_tracks(self, location: str = None, limit: int = 10) -> Dict:
"""Get trending tracks for a specific location"""
headers = {
"Authorization": f"Bearer {self.access_token}",
"Content-Type": "application/json"
}
#include location in query
query = f"top charts popular {location}" if location else "top charts"
params = {
"q": query,
"type": "track",
"limit": limit,
"market": "US",
"offset": 0,
"include_external": "audio"
}
response = requests.get(
f"{SPOTIFY_BASE_URL}/search",
headers=headers,
params=params
)
if response.status_code != 200:
raise Exception(f"Search failed: {response.json().get('error', {}).get('message')}")
return response.json()
class SpotifySearchTool(BaseTool):
name: str = "spotify_search"
description: str = """
Search for playlists on Spotify.
Input should be a search query string.
The tool will return relevant playlists with their details.
"""
spotify: Any = None
def __init__(self) -> None:
super().__init__()
self.spotify = SpotifyAPI()
def _run(self, query: str) -> List[Dict]:
try:
results = self.spotify.search_playlists(query)
playlists = []
for item in results['playlists']['items']:
playlist = {
'name': item['name'],
'description': item['description'],
'tracks_total': item['tracks']['total'],
'url': item['external_urls']['spotify'],
'owner': item['owner']['display_name'],
'followers': item['followers']['total'] if 'followers' in item else 0
}
playlists.append(playlist)
return playlists
except Exception as e:
return f"Error searching Spotify: {str(e)}"
class SpotifyTrendingTool(BaseTool):
name: str = "spotify_trending"
description: str = """
Get trending tracks for a specific location on Spotify.
Input should be a location string (e.g., 'Berkeley', 'Bay Area').
Returns top trending tracks in that area.
"""
spotify: Any = None
def __init__(self) -> None:
super().__init__()
self.spotify = SpotifyAPI()
def _run(self, location: str) -> List[Dict]:
try:
results = self.spotify.get_trending_tracks(location)
tracks = []
for item in results['tracks']['items']:
track = {
'name': item['name'],
'artist': ', '.join([artist['name'] for artist in item['artists']]),
'album': item['album']['name'],
'url': item['external_urls']['spotify'],
'popularity': item['popularity']
}
tracks.append(track)
return tracks
except Exception as e:
return f"Error getting trending tracks: {str(e)}"
def format_spotify_response(tool_responses: Dict) -> str:
"""Format the Spotify API responses into a readable message"""
response = ""
# Format trending tracks
trending_tracks = tool_responses.get("trending", [])
if isinstance(trending_tracks, list) and trending_tracks:
response += "📊 Trending Tracks:\n"
for i, track in enumerate(trending_tracks[:5], 1):
response += f"{i}. {track['name']} by {track['artist']}\n"
response += f" - Album: {track['album']}\n"
response += f" - Listen: {track['url']}\n\n"
else:
response += "📊 No trending tracks found for this location.\n\n"
# Format playlists
playlists = tool_responses.get("playlists", [])
if isinstance(playlists, list) and playlists:
response += "🎵 Related Playlists:\n"
for i, playlist in enumerate(playlists[:3], 1):
response += f"{i}. {playlist['name']}\n"
response += f" - Tracks: {playlist['tracks_total']}\n"
response += f" - Description: {playlist['description']}\n"
response += f" - Listen: {playlist['url']}\n\n"
else:
response += "No related playlists found.\n"
return response
# Model service check
@st.cache_resource(show_spinner=False)
def checking_model_service():
start = time.time()
print("Checking Model Service Availability...")
ready = False
while not ready:
try:
request_cpp = requests.get(f'{model_service}/models')
request_ollama = requests.get(f'{model_service[:-2]}api/tags')
if request_cpp.status_code == 200:
server = "Llamacpp_Python"
ready = True
elif request_ollama.status_code == 200:
server = "Ollama"
ready = True
except:
pass
time.sleep(1)
print(f"{server} Model Service Available")
print(f"Time taken: {time.time()-start} seconds")
return server
def get_models():
try:
response = requests.get(f"{model_service[:-2]}api/tags")
return [i["name"].split(":")[0] for i in json.loads(response.content)["models"]]
except:
return None
# ReAct prompt template
REACT_PROMPT = """You are a helpful assistant that can search for music on Spotify.
You have access to the following tools:
{tools}
Use the following format in your internal processing:
Thought: First interpret if the user's input is a casual greeting or an actual search query.
If it seems like a greeting, respond conversationally and suggest some current trending tracks.
If it's a search query, use it directly.
Action: tool_name (either spotify_search or spotify_trending)
Action Input: input to the tool
Observation: tool's response
Final Answer: If the input was conversational, start with a greeting before showing the music results.
Then provide results in this format:
📊 Trending Tracks:
[formatted tracks...]
🎵 Related Playlists:
[formatted playlists...]
"""
# Create ReAct Agent function
def create_react_agent(model_name: str):
llm = ChatOpenAI(
base_url=model_service,
api_key="sk-no-key-required",
model=model_name,
streaming=True
)
# Create both tools
playlist_tool = SpotifySearchTool()
trending_tool = SpotifyTrendingTool()
prompt = ChatPromptTemplate.from_messages([
("system", REACT_PROMPT),
("human", "{input}")
])
chain = prompt | llm
return chain, [playlist_tool, trending_tool]
#Streamlit
st.title("🎵 Spotify Playlist Explorer")
if "spotify_credentials_set" not in st.session_state:
st.session_state.spotify_credentials_set = False
# Spotify Credentials Management in Sidebar
with st.sidebar:
st.markdown("### Spotify Credentials")
# Check if credentials exist in environment variables
env_credentials_exist = bool(os.getenv("SPOTIFY_CLIENT_ID")) and bool(os.getenv("SPOTIFY_CLIENT_SECRET"))
if not env_credentials_exist:
st.warning("Spotify credentials not found in environment variables.")
# Initialize session state for credentials
if "spotify_client_id" not in st.session_state:
st.session_state.spotify_client_id = ""
if "spotify_client_secret" not in st.session_state:
st.session_state.spotify_client_secret = ""
# Input fields for credentials
client_id = st.text_input(
"Enter Spotify Client ID",
value=st.session_state.spotify_client_id,
type="password"
)
client_secret = st.text_input(
"Enter Spotify Client Secret",
value=st.session_state.spotify_client_secret,
type="password"
)
if st.button("Save Credentials"):
st.session_state.spotify_client_id = client_id
st.session_state.spotify_client_secret = client_secret
st.session_state.spotify_credentials_set = True
st.success("Credentials saved!")
st.rerun()
else:
st.success("Using credentials from environment variables")
st.session_state.spotify_credentials_set = True
# Check if credentials are available before proceeding
credentials_available = env_credentials_exist or st.session_state.spotify_credentials_set
if not credentials_available:
st.error("Please provide Spotify credentials in the sidebar to continue.")
else:
with st.spinner("Checking Model Service Availability..."):
server = checking_model_service()
model_name = os.getenv("MODEL_NAME", "")
if server == "Ollama":
with st.sidebar:
model_name = st.radio(
label="Select Model",
options=get_models()
)
try:
agent, tools = create_react_agent(model_name)
playlist_tool, trending_tool = tools
if "messages" not in st.session_state:
st.session_state.messages = []
for message in st.session_state.messages:
with st.chat_message(message["role"]):
st.markdown(message["content"])
if prompt := st.chat_input("What kind of playlists are you looking for?"):
st.session_state.messages.append({"role": "user", "content": prompt})
with st.chat_message("user"):
st.markdown(prompt)
with st.chat_message("assistant"):
try:
tool_responses = {
"playlists": playlist_tool._run(prompt),
"trending": trending_tool._run(prompt)
}
agent_response = agent.invoke({
"input": prompt,
"tools": [tool.description for tool in tools],
"query": prompt,
"observation": tool_responses,
"answer": "Based on the search results, here's what I found:"
})
with st.expander("See thinking process"):
st.markdown(agent_response.content)
formatted_response = format_spotify_response(tool_responses)
st.markdown(formatted_response)
st.session_state.messages.append({
"role": "assistant",
"content": formatted_response
})
except Exception as e:
error_message = f"Error processing request: {str(e)}"
st.error(error_message)
except Exception as e:
st.error(f"Error initializing Spotify API: {str(e)}")

View File

@ -0,0 +1,10 @@
streamlit>=1.24.0
langchain-core>=0.1.0
langchain-openai>=0.0.5
python-dotenv>=0.19.0
requests>=2.31.0
typing-extensions>=4.5.0
streamlit-chat>=0.1.1

View File

@ -0,0 +1,9 @@
# Java-based chatbot application - Quarkus
This application implements a simple chatbot backed by Quarkus and its
LangChain4j extension. The UI communicates with the backend application via
web sockets and the backend uses the OpenAI API to talk to the model served
by Podman AI Lab.
Documentation for Quarkus+LangChain4j can be found at
https://docs.quarkiverse.io/quarkus-langchain4j/dev/.

View File

@ -0,0 +1,26 @@
version: v1.0
application:
type: language
name: ChatBot_Java_Quarkus
description: Chatbot sample based on Quarkus
containers:
- name: llamacpp-server
contextdir: ../../../model_servers/llamacpp_python
containerfile: ./base/Containerfile
model-service: true
backend:
- llama-cpp
arch:
- arm64
- amd64
ports:
- 8001
image: quay.io/ai-lab/llamacpp_python:latest
- name: quarkus-chat-app
contextdir: app
containerfile: Containerfile
arch:
- arm64
- amd64
ports:
- 8080

View File

@ -0,0 +1,19 @@
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
wrapperVersion=3.3.2
distributionType=only-script
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.9.10/apache-maven-3.9.10-bin.zip

View File

@ -0,0 +1,7 @@
FROM registry.access.redhat.com/ubi8/openjdk-21:latest
WORKDIR /app
COPY --chown=185:0 --chmod=744 . .
RUN mvn package
EXPOSE 8080
ENV JAVA_OPTS="-Dquarkus.http.host=0.0.0.0 -Djava.util.logging.manager=org.jboss.logmanager.LogManager"
ENV JAVA_APP_JAR="/app/target/quarkus-app/quarkus-run.jar"

View File

@ -0,0 +1,259 @@
#!/bin/sh
# ----------------------------------------------------------------------------
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# ----------------------------------------------------------------------------
# ----------------------------------------------------------------------------
# Apache Maven Wrapper startup batch script, version 3.3.2
#
# Optional ENV vars
# -----------------
# JAVA_HOME - location of a JDK home dir, required when download maven via java source
# MVNW_REPOURL - repo url base for downloading maven distribution
# MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
# MVNW_VERBOSE - true: enable verbose log; debug: trace the mvnw script; others: silence the output
# ----------------------------------------------------------------------------
set -euf
[ "${MVNW_VERBOSE-}" != debug ] || set -x
# OS specific support.
native_path() { printf %s\\n "$1"; }
case "$(uname)" in
CYGWIN* | MINGW*)
[ -z "${JAVA_HOME-}" ] || JAVA_HOME="$(cygpath --unix "$JAVA_HOME")"
native_path() { cygpath --path --windows "$1"; }
;;
esac
# set JAVACMD and JAVACCMD
set_java_home() {
# For Cygwin and MinGW, ensure paths are in Unix format before anything is touched
if [ -n "${JAVA_HOME-}" ]; then
if [ -x "$JAVA_HOME/jre/sh/java" ]; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
JAVACCMD="$JAVA_HOME/jre/sh/javac"
else
JAVACMD="$JAVA_HOME/bin/java"
JAVACCMD="$JAVA_HOME/bin/javac"
if [ ! -x "$JAVACMD" ] || [ ! -x "$JAVACCMD" ]; then
echo "The JAVA_HOME environment variable is not defined correctly, so mvnw cannot run." >&2
echo "JAVA_HOME is set to \"$JAVA_HOME\", but \"\$JAVA_HOME/bin/java\" or \"\$JAVA_HOME/bin/javac\" does not exist." >&2
return 1
fi
fi
else
JAVACMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v java
)" || :
JAVACCMD="$(
'set' +e
'unset' -f command 2>/dev/null
'command' -v javac
)" || :
if [ ! -x "${JAVACMD-}" ] || [ ! -x "${JAVACCMD-}" ]; then
echo "The java/javac command does not exist in PATH nor is JAVA_HOME set, so mvnw cannot run." >&2
return 1
fi
fi
}
# hash string like Java String::hashCode
hash_string() {
str="${1:-}" h=0
while [ -n "$str" ]; do
char="${str%"${str#?}"}"
h=$(((h * 31 + $(LC_CTYPE=C printf %d "'$char")) % 4294967296))
str="${str#?}"
done
printf %x\\n $h
}
verbose() { :; }
[ "${MVNW_VERBOSE-}" != true ] || verbose() { printf %s\\n "${1-}"; }
die() {
printf %s\\n "$1" >&2
exit 1
}
trim() {
# MWRAPPER-139:
# Trims trailing and leading whitespace, carriage returns, tabs, and linefeeds.
# Needed for removing poorly interpreted newline sequences when running in more
# exotic environments such as mingw bash on Windows.
printf "%s" "${1}" | tr -d '[:space:]'
}
# parse distributionUrl and optional distributionSha256Sum, requires .mvn/wrapper/maven-wrapper.properties
while IFS="=" read -r key value; do
case "${key-}" in
distributionUrl) distributionUrl=$(trim "${value-}") ;;
distributionSha256Sum) distributionSha256Sum=$(trim "${value-}") ;;
esac
done <"${0%/*}/.mvn/wrapper/maven-wrapper.properties"
[ -n "${distributionUrl-}" ] || die "cannot read distributionUrl property in ${0%/*}/.mvn/wrapper/maven-wrapper.properties"
case "${distributionUrl##*/}" in
maven-mvnd-*bin.*)
MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/
case "${PROCESSOR_ARCHITECTURE-}${PROCESSOR_ARCHITEW6432-}:$(uname -a)" in
*AMD64:CYGWIN* | *AMD64:MINGW*) distributionPlatform=windows-amd64 ;;
:Darwin*x86_64) distributionPlatform=darwin-amd64 ;;
:Darwin*arm64) distributionPlatform=darwin-aarch64 ;;
:Linux*x86_64*) distributionPlatform=linux-amd64 ;;
*)
echo "Cannot detect native platform for mvnd on $(uname)-$(uname -m), use pure java version" >&2
distributionPlatform=linux-amd64
;;
esac
distributionUrl="${distributionUrl%-bin.*}-$distributionPlatform.zip"
;;
maven-mvnd-*) MVN_CMD=mvnd.sh _MVNW_REPO_PATTERN=/maven/mvnd/ ;;
*) MVN_CMD="mvn${0##*/mvnw}" _MVNW_REPO_PATTERN=/org/apache/maven/ ;;
esac
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
[ -z "${MVNW_REPOURL-}" ] || distributionUrl="$MVNW_REPOURL$_MVNW_REPO_PATTERN${distributionUrl#*"$_MVNW_REPO_PATTERN"}"
distributionUrlName="${distributionUrl##*/}"
distributionUrlNameMain="${distributionUrlName%.*}"
distributionUrlNameMain="${distributionUrlNameMain%-bin}"
MAVEN_USER_HOME="${MAVEN_USER_HOME:-${HOME}/.m2}"
MAVEN_HOME="${MAVEN_USER_HOME}/wrapper/dists/${distributionUrlNameMain-}/$(hash_string "$distributionUrl")"
exec_maven() {
unset MVNW_VERBOSE MVNW_USERNAME MVNW_PASSWORD MVNW_REPOURL || :
exec "$MAVEN_HOME/bin/$MVN_CMD" "$@" || die "cannot exec $MAVEN_HOME/bin/$MVN_CMD"
}
if [ -d "$MAVEN_HOME" ]; then
verbose "found existing MAVEN_HOME at $MAVEN_HOME"
exec_maven "$@"
fi
case "${distributionUrl-}" in
*?-bin.zip | *?maven-mvnd-?*-?*.zip) ;;
*) die "distributionUrl is not valid, must match *-bin.zip or maven-mvnd-*.zip, but found '${distributionUrl-}'" ;;
esac
# prepare tmp dir
if TMP_DOWNLOAD_DIR="$(mktemp -d)" && [ -d "$TMP_DOWNLOAD_DIR" ]; then
clean() { rm -rf -- "$TMP_DOWNLOAD_DIR"; }
trap clean HUP INT TERM EXIT
else
die "cannot create temp dir"
fi
mkdir -p -- "${MAVEN_HOME%/*}"
# Download and Install Apache Maven
verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
verbose "Downloading from: $distributionUrl"
verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
# select .zip or .tar.gz
if ! command -v unzip >/dev/null; then
distributionUrl="${distributionUrl%.zip}.tar.gz"
distributionUrlName="${distributionUrl##*/}"
fi
# verbose opt
__MVNW_QUIET_WGET=--quiet __MVNW_QUIET_CURL=--silent __MVNW_QUIET_UNZIP=-q __MVNW_QUIET_TAR=''
[ "${MVNW_VERBOSE-}" != true ] || __MVNW_QUIET_WGET='' __MVNW_QUIET_CURL='' __MVNW_QUIET_UNZIP='' __MVNW_QUIET_TAR=v
# normalize http auth
case "${MVNW_PASSWORD:+has-password}" in
'') MVNW_USERNAME='' MVNW_PASSWORD='' ;;
has-password) [ -n "${MVNW_USERNAME-}" ] || MVNW_USERNAME='' MVNW_PASSWORD='' ;;
esac
if [ -z "${MVNW_USERNAME-}" ] && command -v wget >/dev/null; then
verbose "Found wget ... using wget"
wget ${__MVNW_QUIET_WGET:+"$__MVNW_QUIET_WGET"} "$distributionUrl" -O "$TMP_DOWNLOAD_DIR/$distributionUrlName" || die "wget: Failed to fetch $distributionUrl"
elif [ -z "${MVNW_USERNAME-}" ] && command -v curl >/dev/null; then
verbose "Found curl ... using curl"
curl ${__MVNW_QUIET_CURL:+"$__MVNW_QUIET_CURL"} -f -L -o "$TMP_DOWNLOAD_DIR/$distributionUrlName" "$distributionUrl" || die "curl: Failed to fetch $distributionUrl"
elif set_java_home; then
verbose "Falling back to use Java to download"
javaSource="$TMP_DOWNLOAD_DIR/Downloader.java"
targetZip="$TMP_DOWNLOAD_DIR/$distributionUrlName"
cat >"$javaSource" <<-END
public class Downloader extends java.net.Authenticator
{
protected java.net.PasswordAuthentication getPasswordAuthentication()
{
return new java.net.PasswordAuthentication( System.getenv( "MVNW_USERNAME" ), System.getenv( "MVNW_PASSWORD" ).toCharArray() );
}
public static void main( String[] args ) throws Exception
{
setDefault( new Downloader() );
java.nio.file.Files.copy( java.net.URI.create( args[0] ).toURL().openStream(), java.nio.file.Paths.get( args[1] ).toAbsolutePath().normalize() );
}
}
END
# For Cygwin/MinGW, switch paths to Windows format before running javac and java
verbose " - Compiling Downloader.java ..."
"$(native_path "$JAVACCMD")" "$(native_path "$javaSource")" || die "Failed to compile Downloader.java"
verbose " - Running Downloader.java ..."
"$(native_path "$JAVACMD")" -cp "$(native_path "$TMP_DOWNLOAD_DIR")" Downloader "$distributionUrl" "$(native_path "$targetZip")"
fi
# If specified, validate the SHA-256 sum of the Maven distribution zip file
if [ -n "${distributionSha256Sum-}" ]; then
distributionSha256Result=false
if [ "$MVN_CMD" = mvnd.sh ]; then
echo "Checksum validation is not supported for maven-mvnd." >&2
echo "Please disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
elif command -v sha256sum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | sha256sum -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
elif command -v shasum >/dev/null; then
if echo "$distributionSha256Sum $TMP_DOWNLOAD_DIR/$distributionUrlName" | shasum -a 256 -c >/dev/null 2>&1; then
distributionSha256Result=true
fi
else
echo "Checksum validation was requested but neither 'sha256sum' or 'shasum' are available." >&2
echo "Please install either command, or disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties." >&2
exit 1
fi
if [ $distributionSha256Result = false ]; then
echo "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised." >&2
echo "If you updated your Maven version, you need to update the specified distributionSha256Sum property." >&2
exit 1
fi
fi
# unzip and move
if command -v unzip >/dev/null; then
unzip ${__MVNW_QUIET_UNZIP:+"$__MVNW_QUIET_UNZIP"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -d "$TMP_DOWNLOAD_DIR" || die "failed to unzip"
else
tar xzf${__MVNW_QUIET_TAR:+"$__MVNW_QUIET_TAR"} "$TMP_DOWNLOAD_DIR/$distributionUrlName" -C "$TMP_DOWNLOAD_DIR" || die "failed to untar"
fi
printf %s\\n "$distributionUrl" >"$TMP_DOWNLOAD_DIR/$distributionUrlNameMain/mvnw.url"
mv -- "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" "$MAVEN_HOME" || [ -d "$MAVEN_HOME" ] || die "fail to move MAVEN_HOME"
clean || :
exec_maven "$@"

View File

@ -0,0 +1,149 @@
<# : batch portion
@REM ----------------------------------------------------------------------------
@REM Licensed to the Apache Software Foundation (ASF) under one
@REM or more contributor license agreements. See the NOTICE file
@REM distributed with this work for additional information
@REM regarding copyright ownership. The ASF licenses this file
@REM to you under the Apache License, Version 2.0 (the
@REM "License"); you may not use this file except in compliance
@REM with the License. You may obtain a copy of the License at
@REM
@REM http://www.apache.org/licenses/LICENSE-2.0
@REM
@REM Unless required by applicable law or agreed to in writing,
@REM software distributed under the License is distributed on an
@REM "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@REM KIND, either express or implied. See the License for the
@REM specific language governing permissions and limitations
@REM under the License.
@REM ----------------------------------------------------------------------------
@REM ----------------------------------------------------------------------------
@REM Apache Maven Wrapper startup batch script, version 3.3.2
@REM
@REM Optional ENV vars
@REM MVNW_REPOURL - repo url base for downloading maven distribution
@REM MVNW_USERNAME/MVNW_PASSWORD - user and password for downloading maven
@REM MVNW_VERBOSE - true: enable verbose log; others: silence the output
@REM ----------------------------------------------------------------------------
@IF "%__MVNW_ARG0_NAME__%"=="" (SET __MVNW_ARG0_NAME__=%~nx0)
@SET __MVNW_CMD__=
@SET __MVNW_ERROR__=
@SET __MVNW_PSMODULEP_SAVE=%PSModulePath%
@SET PSModulePath=
@FOR /F "usebackq tokens=1* delims==" %%A IN (`powershell -noprofile "& {$scriptDir='%~dp0'; $script='%__MVNW_ARG0_NAME__%'; icm -ScriptBlock ([Scriptblock]::Create((Get-Content -Raw '%~f0'))) -NoNewScope}"`) DO @(
IF "%%A"=="MVN_CMD" (set __MVNW_CMD__=%%B) ELSE IF "%%B"=="" (echo %%A) ELSE (echo %%A=%%B)
)
@SET PSModulePath=%__MVNW_PSMODULEP_SAVE%
@SET __MVNW_PSMODULEP_SAVE=
@SET __MVNW_ARG0_NAME__=
@SET MVNW_USERNAME=
@SET MVNW_PASSWORD=
@IF NOT "%__MVNW_CMD__%"=="" (%__MVNW_CMD__% %*)
@echo Cannot start maven from wrapper >&2 && exit /b 1
@GOTO :EOF
: end batch / begin powershell #>
$ErrorActionPreference = "Stop"
if ($env:MVNW_VERBOSE -eq "true") {
$VerbosePreference = "Continue"
}
# calculate distributionUrl, requires .mvn/wrapper/maven-wrapper.properties
$distributionUrl = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionUrl
if (!$distributionUrl) {
Write-Error "cannot read distributionUrl property in $scriptDir/.mvn/wrapper/maven-wrapper.properties"
}
switch -wildcard -casesensitive ( $($distributionUrl -replace '^.*/','') ) {
"maven-mvnd-*" {
$USE_MVND = $true
$distributionUrl = $distributionUrl -replace '-bin\.[^.]*$',"-windows-amd64.zip"
$MVN_CMD = "mvnd.cmd"
break
}
default {
$USE_MVND = $false
$MVN_CMD = $script -replace '^mvnw','mvn'
break
}
}
# apply MVNW_REPOURL and calculate MAVEN_HOME
# maven home pattern: ~/.m2/wrapper/dists/{apache-maven-<version>,maven-mvnd-<version>-<platform>}/<hash>
if ($env:MVNW_REPOURL) {
$MVNW_REPO_PATTERN = if ($USE_MVND) { "/org/apache/maven/" } else { "/maven/mvnd/" }
$distributionUrl = "$env:MVNW_REPOURL$MVNW_REPO_PATTERN$($distributionUrl -replace '^.*'+$MVNW_REPO_PATTERN,'')"
}
$distributionUrlName = $distributionUrl -replace '^.*/',''
$distributionUrlNameMain = $distributionUrlName -replace '\.[^.]*$','' -replace '-bin$',''
$MAVEN_HOME_PARENT = "$HOME/.m2/wrapper/dists/$distributionUrlNameMain"
if ($env:MAVEN_USER_HOME) {
$MAVEN_HOME_PARENT = "$env:MAVEN_USER_HOME/wrapper/dists/$distributionUrlNameMain"
}
$MAVEN_HOME_NAME = ([System.Security.Cryptography.MD5]::Create().ComputeHash([byte[]][char[]]$distributionUrl) | ForEach-Object {$_.ToString("x2")}) -join ''
$MAVEN_HOME = "$MAVEN_HOME_PARENT/$MAVEN_HOME_NAME"
if (Test-Path -Path "$MAVEN_HOME" -PathType Container) {
Write-Verbose "found existing MAVEN_HOME at $MAVEN_HOME"
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"
exit $?
}
if (! $distributionUrlNameMain -or ($distributionUrlName -eq $distributionUrlNameMain)) {
Write-Error "distributionUrl is not valid, must end with *-bin.zip, but found $distributionUrl"
}
# prepare tmp dir
$TMP_DOWNLOAD_DIR_HOLDER = New-TemporaryFile
$TMP_DOWNLOAD_DIR = New-Item -Itemtype Directory -Path "$TMP_DOWNLOAD_DIR_HOLDER.dir"
$TMP_DOWNLOAD_DIR_HOLDER.Delete() | Out-Null
trap {
if ($TMP_DOWNLOAD_DIR.Exists) {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
}
New-Item -Itemtype Directory -Path "$MAVEN_HOME_PARENT" -Force | Out-Null
# Download and Install Apache Maven
Write-Verbose "Couldn't find MAVEN_HOME, downloading and installing it ..."
Write-Verbose "Downloading from: $distributionUrl"
Write-Verbose "Downloading to: $TMP_DOWNLOAD_DIR/$distributionUrlName"
$webclient = New-Object System.Net.WebClient
if ($env:MVNW_USERNAME -and $env:MVNW_PASSWORD) {
$webclient.Credentials = New-Object System.Net.NetworkCredential($env:MVNW_USERNAME, $env:MVNW_PASSWORD)
}
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$webclient.DownloadFile($distributionUrl, "$TMP_DOWNLOAD_DIR/$distributionUrlName") | Out-Null
# If specified, validate the SHA-256 sum of the Maven distribution zip file
$distributionSha256Sum = (Get-Content -Raw "$scriptDir/.mvn/wrapper/maven-wrapper.properties" | ConvertFrom-StringData).distributionSha256Sum
if ($distributionSha256Sum) {
if ($USE_MVND) {
Write-Error "Checksum validation is not supported for maven-mvnd. `nPlease disable validation by removing 'distributionSha256Sum' from your maven-wrapper.properties."
}
Import-Module $PSHOME\Modules\Microsoft.PowerShell.Utility -Function Get-FileHash
if ((Get-FileHash "$TMP_DOWNLOAD_DIR/$distributionUrlName" -Algorithm SHA256).Hash.ToLower() -ne $distributionSha256Sum) {
Write-Error "Error: Failed to validate Maven distribution SHA-256, your Maven distribution might be compromised. If you updated your Maven version, you need to update the specified distributionSha256Sum property."
}
}
# unzip and move
Expand-Archive "$TMP_DOWNLOAD_DIR/$distributionUrlName" -DestinationPath "$TMP_DOWNLOAD_DIR" | Out-Null
Rename-Item -Path "$TMP_DOWNLOAD_DIR/$distributionUrlNameMain" -NewName $MAVEN_HOME_NAME | Out-Null
try {
Move-Item -Path "$TMP_DOWNLOAD_DIR/$MAVEN_HOME_NAME" -Destination $MAVEN_HOME_PARENT | Out-Null
} catch {
if (! (Test-Path -Path "$MAVEN_HOME" -PathType Container)) {
Write-Error "fail to move MAVEN_HOME"
}
} finally {
try { Remove-Item $TMP_DOWNLOAD_DIR -Recurse -Force | Out-Null }
catch { Write-Warning "Cannot remove $TMP_DOWNLOAD_DIR" }
}
Write-Output "MVN_CMD=$MAVEN_HOME/bin/$MVN_CMD"

View File

@ -0,0 +1,138 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>org.example</groupId>
<artifactId>podman-ai-sample-chatbot-quarkus</artifactId>
<name>Quarkus-based chatbot sample</name>
<version>1.0-SNAPSHOT</version>
<properties>
<compiler-plugin.version>3.13.0</compiler-plugin.version>
<maven.compiler.parameters>true</maven.compiler.parameters>
<maven.compiler.release>17</maven.compiler.release>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<quarkus.platform.artifact-id>quarkus-bom</quarkus.platform.artifact-id>
<quarkus.platform.group-id>io.quarkus</quarkus.platform.group-id>
<quarkus.platform.version>3.15.1</quarkus.platform.version>
<skipITs>true</skipITs>
<surefire-plugin.version>3.2.5</surefire-plugin.version>
<quarkus-langchain4j.version>0.21.0</quarkus-langchain4j.version>
</properties>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>${quarkus.platform.group-id}</groupId>
<artifactId>${quarkus.platform.artifact-id}</artifactId>
<version>${quarkus.platform.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-rest-jackson</artifactId>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-websockets-next</artifactId>
</dependency>
<dependency>
<groupId>io.quarkiverse.langchain4j</groupId>
<artifactId>quarkus-langchain4j-openai</artifactId>
<version>${quarkus-langchain4j.version}</version>
</dependency>
<!-- UI -->
<dependency>
<groupId>io.mvnpm</groupId>
<artifactId>importmap</artifactId>
<version>1.0.11</version>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>lit</artifactId>
<version>3.2.1</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>org.mvnpm</groupId>
<artifactId>wc-chatbot</artifactId>
<version>0.2.1</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-maven-plugin</artifactId>
<version>${quarkus.platform.version}</version>
<executions>
<execution>
<goals>
<goal>build</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>${compiler-plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.5.3</version>
<configuration>
<systemPropertyVariables>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>native</id>
<activation>
<property>
<name>native</name>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-failsafe-plugin</artifactId>
<version>3.5.3</version>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
<configuration>
<systemPropertyVariables>
<native.image.path>${project.build.directory}/${project.build.finalName}-runner</native.image.path>
<java.util.logging.manager>org.jboss.logmanager.LogManager</java.util.logging.manager>
<maven.home>${maven.home}</maven.home>
</systemPropertyVariables>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<properties>
<quarkus.package.type>native</quarkus.package.type>
</properties>
</profile>
</profiles>
</project>

View File

@ -0,0 +1,15 @@
package io.quarkiverse.langchain4j.sample.chatbot;
import dev.langchain4j.service.SystemMessage;
import dev.langchain4j.service.UserMessage;
import io.quarkiverse.langchain4j.RegisterAiService;
import io.smallrye.mutiny.Multi;
import jakarta.enterprise.context.SessionScoped;
@RegisterAiService
@SessionScoped
public interface Bot {
Multi<String> chat(@UserMessage String question);
}

View File

@ -0,0 +1,23 @@
package io.quarkiverse.langchain4j.sample.chatbot;
import io.quarkus.websockets.next.OnOpen;
import io.quarkus.websockets.next.OnTextMessage;
import io.quarkus.websockets.next.WebSocket;
import io.smallrye.mutiny.Multi;
@WebSocket(path = "/chatbot")
public class ChatBotWebSocket {
private final Bot bot;
public ChatBotWebSocket(Bot bot) {
this.bot = bot;
}
@OnTextMessage
public Multi<String> onMessage(String message) {
return bot.chat(message).onFailure().recoverWithItem(t ->
"There was an error in communicating with the model server");
}
}

View File

@ -0,0 +1,51 @@
package io.quarkiverse.langchain4j.sample.chatbot;
import jakarta.annotation.PostConstruct;
import jakarta.enterprise.context.ApplicationScoped;
import jakarta.ws.rs.GET;
import jakarta.ws.rs.Path;
import jakarta.ws.rs.Produces;
import io.mvnpm.importmap.Aggregator;
/**
* Dynamically create the import map
*/
@ApplicationScoped
@Path("/_importmap")
public class ImportmapResource {
private String importmap;
// See https://github.com/WICG/import-maps/issues/235
// This does not seem to be supported by browsers yet...
@GET
@Path("/dynamic.importmap")
@Produces("application/importmap+json")
public String importMap() {
return this.importmap;
}
@GET
@Path("/dynamic-importmap.js")
@Produces("application/javascript")
public String importMapJson() {
return JAVASCRIPT_CODE.formatted(this.importmap);
}
@PostConstruct
void init() {
Aggregator aggregator = new Aggregator();
// Add our own mappings
aggregator.addMapping("icons/", "/icons/");
aggregator.addMapping("components/", "/components/");
aggregator.addMapping("fonts/", "/fonts/");
this.importmap = aggregator.aggregateAsJson();
}
private static final String JAVASCRIPT_CODE = """
const im = document.createElement('script');
im.type = 'importmap';
im.textContent = JSON.stringify(%s);
document.currentScript.after(im);
""";
}

View File

@ -0,0 +1,64 @@
import {css, LitElement} from 'lit';
export class DemoChat extends LitElement {
_stripHtml(html) {
const div = document.createElement("div");
div.innerHTML = html;
return div.textContent || div.innerText || "";
}
connectedCallback() {
const chatBot = document.getElementsByTagName("chat-bot")[0];
const protocol = (window.location.protocol === 'https:') ? 'wss' : 'ws';
const socket = new WebSocket(protocol + '://' + window.location.host + '/chatbot');
const that = this;
socket.onmessage = function (event) {
chatBot.hideLastLoading();
// LLM response
let lastMessage;
if (chatBot.messages.length > 0) {
lastMessage = chatBot.messages[chatBot.messages.length - 1];
}
if (lastMessage && lastMessage.sender.name === "Bot" && ! lastMessage.loading) {
if (! lastMessage.msg) {
lastMessage.msg = "";
}
lastMessage.msg += event.data;
let bubbles = chatBot.shadowRoot.querySelectorAll("chat-bubble");
let bubble = bubbles.item(bubbles.length - 1);
if (lastMessage.message) {
bubble.innerHTML = that._stripHtml(lastMessage.message) + lastMessage.msg;
} else {
bubble.innerHTML = lastMessage.msg;
}
chatBot.body.scrollTo({ top: chatBot.body.scrollHeight, behavior: 'smooth' })
} else {
chatBot.sendMessage(event.data, {
right: false,
sender: {
name: "Bot"
}
});
}
}
chatBot.addEventListener("sent", function (e) {
if (e.detail.message.sender.name !== "Bot") {
// User message
const msg = that._stripHtml(e.detail.message.message);
socket.send(msg);
chatBot.sendMessage("", {
right: false,
loading: true
});
}
});
}
}
customElements.define('demo-chat', DemoChat);

Some files were not shown because too many files have changed in this diff Show More