Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add target for creating disk-images #455

Merged
merged 1 commit into from
May 3, 2024

Conversation

javipolo
Copy link
Collaborator

@javipolo javipolo commented May 3, 2024

No description provided.

@@ -18,6 +18,9 @@ In order to run accelerated AI workloads, we've prepared [bootc](https://github.
| intel | Create bootable container for Intel Habanalabs platform |
| nvidia | Create bootable container for NVidia platform |
| vllm | Containerized inference/serving engine for LLMs |
| disk-amd | Create disk image from bootable container for AMD platform |
| disk-intel | Create disk image from bootable container for Intel platform |
| disk-nvidia | Create disk image from bootable container for Nvidia platform |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please alphabetize.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oops, done :)

Image builder config file is documented in [bootc-image-builder README](https://github.com/osbuild/bootc-image-builder?tab=readme-ov-file#-build-config)

The following image disk types are currently available:
| Image type | Target environment |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should probably be DISK type.

--rm \
-ti \
-v $(GRAPH_ROOT):/var/lib/containers/storage \
$(ARCH:%=--arch %) \
Copy link
Member

@rhatdan rhatdan May 3, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work with the ARCH removed above?

I don't think you ever want to do this? This should only be handled in the bootc section, you should not run a non native bootc-image-builder.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, removing then ... I copied most of it from the Makefile.common target that is present in the /recipes section

bootc-image-builder:
@if podman image exists $(BOOTC_IMAGE); then \
echo "$(BOOTC_IMAGE) exists in local storage, using it"; \
else \
$(MAKE) bootc; \
fi
mkdir -p build/store
podman run \
--rm \
-ti \
-v $(GRAPH_ROOT):/var/lib/containers/storage \
$(ARCH:%=--arch %) \
$(AUTH_JSON:%=-v %:/run/containers/0/auth.json) \
--privileged \
--pull newer \
-v ./build:/output \
-v ./build/store:/store \
$(BOOTC_IMAGE_BUILDER) \
$(ARCH:%=--target-arch %) \
--type $(DISK_TYPE) \
--chown $(DISK_UID):$(DISK_GID) \
--local \
$(BOOTC_IMAGE)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to fix this there also.

-v ./build:/output \
-v ./build/store:/store \
$(BOOTC_IMAGE_BUILDER) \
$(ARCH:%=--target-arch %) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is GOOD. Noth the one above.

@javipolo javipolo force-pushed the bootc-image-builder branch from ef45e95 to 871ae43 Compare May 3, 2024 15:53
@javipolo javipolo force-pushed the bootc-image-builder branch from 871ae43 to 4cb23bb Compare May 3, 2024 15:56
@rhatdan
Copy link
Member

rhatdan commented May 3, 2024

LGTM

@rhatdan rhatdan merged commit 6eb5cdc into containers:main May 3, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants