-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- fetches `kaps` from GitHub (https://github.com/virt-do/kaps), builds it with `cargo`. - clones Cloud Hypervisor repository (https://github.com/cloud-hypervisor/linux), builds a Linux kernel using a specific configuration (https://github.com/virt-do/lumper/blob/main/kernel/linux-config-x86_64). - if offline mode is selected, fetches a `.tar.gz` archive from an URL an builds a container bundle containing the rootfs of the container and a `runc` config file. - creates an initrootfs image (`lzma` format) from an `alpine` image, containing the container bundle, the `kaps` binary and an init file to launch `kaps` using the bundle. - wraps the kernel, the initrootfs image and a `quark.json` config file inside a `quardle`. Signed-off-by: Julian Labatut <[email protected]>
- Loading branch information
Showing
8 changed files
with
359 additions
and
13 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
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 |
---|---|---|
@@ -1,3 +1,23 @@ | ||
# Lumper | ||
# Quark | ||
|
||
<img src="https://img.shields.io/github/workflow/status/virt-do/quark/quark%20build%20and%20unit%20tests?style=for-the-badge" /> | ||
|
||
## Build a quardle | ||
|
||
Building a `quardle` with the container image bundled into the initramfs image : | ||
|
||
```bash | ||
quark build --image <container_image_url> --offline --quardle <quardle_name> | ||
``` | ||
|
||
Building a `quardle` with the container image to be pulled from within the guest: | ||
|
||
```bash | ||
quark build --image <container_image_url> --quardle <quardle_name> | ||
``` | ||
|
||
## Run a quardle | ||
|
||
```bash | ||
quark run --quardle <quardle> --output <output_file> | ||
``` |
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,24 @@ | ||
# From https://github.com/virt-do/kaps/blob/main/hack/mkbundle.sh | ||
|
||
# The URL of a container image archive should be supplied in parameter | ||
# Example with alpine : https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz | ||
if [[ $# -ne 1 ]]; then | ||
echo "Missing container image URL" | ||
exit 1 | ||
fi | ||
|
||
DEST="ctr-bundle" | ||
IMAGE_ARCHIVE_URL=$1 | ||
IMAGE_ARCHIVE_NAME="imageArchive" | ||
|
||
rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir -p "$DEST"/rootfs | ||
|
||
# Download and untar the image | ||
curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME | ||
tar xf $IMAGE_ARCHIVE_NAME -C "$DEST"/rootfs | ||
rm $IMAGE_ARCHIVE_NAME | ||
|
||
pushd "$DEST" > /dev/null | ||
# Generate a runtime spec | ||
runc spec --rootless | ||
popd > /dev/null |
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,16 @@ | ||
# From https://github.com/virt-do/lumper/blob/main/kernel/mkkernel.sh | ||
|
||
CONFIG_URL="https://raw.githubusercontent.com/virt-do/lumper/main/kernel/linux-config-x86_64" | ||
LINUX_REPO=linux-cloud-hypervisor | ||
|
||
if [ ! -d $LINUX_REPO ] | ||
then | ||
echo "Cloning linux-cloud-hypervisor git repository..." | ||
git clone --depth 1 "https://github.com/cloud-hypervisor/linux.git" -b "ch-5.14" $LINUX_REPO | ||
fi | ||
|
||
pushd $LINUX_REPO > /dev/null | ||
pwd | ||
wget -qO .config $CONFIG_URL | ||
make bzImage -j `nproc` | ||
popd > /dev/null |
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,34 @@ | ||
# From https://github.com/virt-do/lumper/blob/main/rootfs/mkrootfs.sh | ||
|
||
DEST="alpine-minirootfs" | ||
IMAGE_ARCHIVE_URL="https://dl-cdn.alpinelinux.org/alpine/v3.14/releases/x86_64/alpine-minirootfs-3.14.2-x86_64.tar.gz" | ||
IMAGE_ARCHIVE_NAME="imageArchive" | ||
|
||
rm -rf $DEST $IMAGE_ARCHIVE_NAME && mkdir $DEST | ||
|
||
# Download and untar the image | ||
curl -sSL $IMAGE_ARCHIVE_URL -o $IMAGE_ARCHIVE_NAME | ||
tar xf $IMAGE_ARCHIVE_NAME -C $DEST | ||
rm $IMAGE_ARCHIVE_NAME | ||
|
||
pushd "$DEST" > /dev/null | ||
# Create an init file in the rootfs | ||
cat > init <<EOF | ||
#! /bin/sh | ||
# | ||
# /init executable file in the initramfs | ||
# | ||
mount -t devtmpfs dev /dev | ||
mount -t proc proc /proc | ||
mount -t sysfs sysfs /sys | ||
ip link set up dev lo | ||
exec /opt/kaps run --bundle /ctr-bundle | ||
poweroff -f | ||
EOF | ||
|
||
chmod +x init | ||
|
||
popd > /dev/null | ||
|
||
# Here we do not create the rootfs image because we need to add some files in it later |
Oops, something went wrong.