-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #120 from rhatdan/bootc
Cleanup bootc and quadlet handling
- Loading branch information
Showing
10 changed files
with
41 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
30 changes: 30 additions & 0 deletions
30
recipes/natural_language_processing/chatbot/bootc/Containerfile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Example: an AI powered sample application is embedded as a systemd service | ||
# via Podman quadlet files in /usr/share/containers/systemd | ||
# | ||
# Use build command: | ||
# podman build --build-arg "sshpubkey=$(cat $HOME/.ssh/mykey.pub)" -t quay.io/exampleos/chatbot . | ||
# The --build-arg "SSHPUBKEY=$(cat ~/.ssh/mykey.pub)" option inserts your | ||
# public key into the image, allowing root access via ssh. | ||
|
||
FROM quay.io/centos-bootc/centos-bootc:stream9 | ||
ARG SSHPUBKEY | ||
ARG MODEL-SERVER-IMAGE=quay.io/redhat-et/locallm-model-service:latest | ||
|
||
RUN mkdir /usr/etc-system && \ | ||
echo 'AuthorizedKeysFile /usr/etc-system/%u.keys' >> /etc/ssh/sshd_config.d/30-auth-system.conf && \ | ||
echo ${SSHPUBKEY} > /usr/etc-system/root.keys && chmod 0600 /usr/etc-system/root.keys | ||
|
||
RUN dnf -y update && (dnf install -y vim || true) && dnf clean all | ||
|
||
# Add quadlet files to setup system to automatically run AI application on boot | ||
COPY ../quadlet/chatbot.kube /usr/share/containers/systemd/chatbot.kube | ||
COPY ../quadlet/chatbot.yaml /usr/share/containers/systemd/chatbot.yaml | ||
COPY ../quadlet/chatbot.image /usr/share/containers/systemd/chatbot.image | ||
|
||
# pre-pull workload images: | ||
# Comment the pull commands to keep bootc image smaller. | ||
# The quadlet .image file added above pulls following images on boot if not | ||
# pre-pulled here | ||
RUN podman pull quay.io/redhat-et/ai-model:latest | ||
RUN podman pull ${MODEL-SERVER-IMAGE} | ||
RUN podman pull quay.io/redhat-et/chatbot:latest |
File renamed without changes.
File renamed without changes.
10 changes: 0 additions & 10 deletions
10
...s/natural_language_processing/chatbot/embed-in-bootable-image/quadlet/README.md
This file was deleted.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
recipes/natural_language_processing/chatbot/quadlet/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
### Run chatbot as a systemd service | ||
|
||
```bash | ||
sudo cp chatbot.yaml /usr/share/containers/systemd/chatbot.yaml | ||
sudo cp chatbot.kube /usr/share/containers/chatbot.kube | ||
sudo cp chatbot.image /usr/share/containers/chatbot.image | ||
sudo /usr/libexec/podman/quadlet --dryrun (optional) | ||
sudo systemctl daemon-reload | ||
sudo systemctl start chatbot | ||
``` |
File renamed without changes.
File renamed without changes.
File renamed without changes.