Skip to content

Commit

Permalink
Update README to mention Makefile variables
Browse files Browse the repository at this point in the history
Also mention bootc-image-builder target.

Signed-off-by: Daniel J Walsh <[email protected]>
  • Loading branch information
rhatdan committed Apr 10, 2024
1 parent b88c6c2 commit 2408532
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 1 deletion.
25 changes: 25 additions & 0 deletions recipes/common/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Makefile targets

Makefile variables defined within each `recipe` Makefile which can be
used to override defaults for a variety of make targets.

| Variable | Description | Default |
|--------------------|------------------------------------------------------|---------------------------------------------------------|
|REGISTRY | Container Registry for storing container images | `quay.io` |
|REGISTRY_ORG | Containwer Registry organization | `ai-lab` |
|IMAGE_NAME | App image and registry organization | `$(REGISTRY_ORG)/${APP}:latest` |
|APP_IMAGE | Application image to be built | `$(REGISTRY)/$(IMAGE_NAME)` |
|BOOTC_IMAGE | Bootc image name | `quay.io/$(REGISTRY_ORG)/${APP}-bootc:latest` |
|BOOTC_IMAGE_BUILDER | Bootc Image Builder container image | `quay.io/centos-bootc/bootc-image-builder` |
|CHROMADB_IMAGE | ChromaDB image to be used for application | `$(REGISTRY)/$(REGISTRY_ORG)/chromadb:latest` |
|DISK_TYPE | Disk type to be created by BOOTC_IMAGE_BUILDER | `qcow2` (Options: ami, iso, vmdk, raw) |
|MODEL_IMAGE | AI Model to be used by application | `$(REGISTRY)/$(REGISTRY_ORG)/mistral-7b-instruct:latest`|
|SERVER_IMAGE | AI Model Server Application | `$(REGISTRY)/$(REGISTRY_ORG)/llamacpp-python:latest` |
|SSH_PUBKEY | SSH Public key preloaded in bootc image. | `$(shell cat ${HOME}/.ssh/id_rsa.pub;)` |
|FROM | Overrides first FROM instruction within Containerfile| `FROM` line defined in the Containerfile |
|ARCH | Use alternate arch for image build | Current Arch |
|CONTAINERFILE | Use alternate Containfile for image build | Containerfile (Containerfile.nocache) |

Examples

make bootc FROM=registry.redhat.io/rhel9-beta/rhel-bootc:9.4 APP_IMAGE=quay.io/myorg/chatbot-bootc
16 changes: 16 additions & 0 deletions recipes/common/README_bootc_image_builder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
This tools allows you to build and deploy disk-images from bootc container inputs.

The following image disk types are currently available:

| Image type | Target environment |
|-----------------------|---------------------------------------------------------------------------------------|
| `ami` | [Amazon Machine Image](https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AMIs.html) |
| `qcow2` **(default)** | [QEMU](https://www.qemu.org/) |
| `vmdk` | [VMDK](https://en.wikipedia.org/wiki/VMDK) usable in vSphere, among others |
| `anaconda-iso` | An unattended Anaconda installer that installs to the first disk found. |
| `raw` | Unformatted [raw disk](https://en.wikipedia.org/wiki/Rawdisk). |

The recipe Makefile can be used to automatically generate a disk image from the bootc image. The following
command will create an qcow2 image file from the default bootc image in the build subdirectory.

`make bootc-image-builder DISK_TYPE=qcow2`
19 changes: 18 additions & 1 deletion recipes/natural_language_processing/chatbot/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ Everything should now be up an running with the chat application available at [`

### 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 specifiying it as follows: `make -f Makefile BOOTC_IMAGE=<your_bootc_image> bootc`.
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.

Expand Down Expand Up @@ -143,3 +143,20 @@ image registry with a single `bootc` command. This works especially well for fle
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`

### Makefile variables

There are several [Makefile variables](../../common/README.md) defined within each `recipe` Makefile which can be
used to override defaults for a variety of make targets.

0 comments on commit 2408532

Please sign in to comment.