Skip to content

Commit

Permalink
kata: Use image for M3 UVM
Browse files Browse the repository at this point in the history
  • Loading branch information
ms-mahuber committed Oct 4, 2024
1 parent 8375778 commit 7823d7b
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 10 deletions.
3 changes: 2 additions & 1 deletion .pipelines/templates/.builder-release-template.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ steps:
exit 1
fi
echo "Found source components.json to use for overrides: ${COMPONENT_JSON_SRC}"
echo "Overwriting component.json from ${COMPONENT_JSON_SRC} -> ${COMPONENT_JSON_DEST}"
cp -af "${COMPONENT_JSON_SRC}" "${COMPONENT_JSON_DEST}"
displayName: Apply Overrides
Expand Down Expand Up @@ -71,6 +71,7 @@ steps:
**/kata-containers-igvm-debug.img**
**/igvm-measurement**
**/kata-containers-igvm.img**
**/kata-containers-cc.img**
**/kata-containers.img**
**/kata-containers-initrd-base.img**
**/reference-info-base64**
Expand Down
34 changes: 25 additions & 9 deletions vhdbuilder/packer/packer_source.sh
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,33 @@ copyPackerFiles() {

if grep -q "kata" <<< "$FEATURE_FLAGS"; then
# KataCC SPEC file assumes kata config points to the files exactly under this path
KATA_CONFIG_DIR=/var/cache/kata-containers/osbuilder-images/kernel-uvm/
if [[ $OS_VERSION == "2.0" ]]; then
KATA_CONFIG_DIR=/var/cache/kata-containers/osbuilder-images/kernel-uvm
elif [[ $OS_VERSION == "3.0" ]]; then
KATA_CONFIG_DIR=/usr/share/kata-containers
else
exit 1
fi
KATACC_CONFIG_DIR=/opt/confidential-containers/share/kata-containers

if [[ $OS_VERSION == "2.0" ]]; then
KATA_INITRD_SRC=/home/packer/kata-containers-initrd-base.img
KATA_INITRD_DEST=$KATA_CONFIG_DIR/kata-containers-initrd.img
cpAndMode $KATA_INITRD_SRC $KATA_INITRD_DEST 0755

KATACC_IMAGE_SRC=/home/packer/kata-containers.img
KATACC_IMAGE_DEST=$KATACC_CONFIG_DIR/kata-containers.img
cpAndMode $KATACC_IMAGE_SRC $KATACC_IMAGE_DEST 0755
elif [[ $OS_VERSION == "3.0" ]]; then
KATA_IMAGE_SRC=/home/packer/kata-containers.img
KATA_IMAGE_DEST=$KATA_CONFIG_DIR/kata-containers.img
cpAndMode $KATA_IMAGE_SRC $KATA_IMAGE_DEST 0755

KATACC_IMAGE_SRC=/home/packer/kata-containers-cc.img
KATACC_IMAGE_DEST=$KATACC_CONFIG_DIR/kata-containers.img
cpAndMode $KATACC_IMAGE_SRC $KATACC_IMAGE_DEST 0755
fi

IGVM_DEBUG_BIN_SRC=/home/packer/kata-containers-igvm-debug.img
IGVM_DEBUG_BIN_DEST=$KATACC_CONFIG_DIR/kata-containers-igvm-debug.img
cpAndMode $IGVM_DEBUG_BIN_SRC $IGVM_DEBUG_BIN_DEST 0755
Expand All @@ -155,14 +179,6 @@ copyPackerFiles() {
IGVM_BIN_DEST=$KATACC_CONFIG_DIR/kata-containers-igvm.img
cpAndMode $IGVM_BIN_SRC $IGVM_BIN_DEST 0755

KATA_INITRD_SRC=/home/packer/kata-containers-initrd-base.img
KATA_INITRD_DEST=$KATA_CONFIG_DIR/kata-containers-initrd.img
cpAndMode $KATA_INITRD_SRC $KATA_INITRD_DEST 0755

KATACC_IMAGE_SRC=/home/packer/kata-containers.img
KATACC_IMAGE_DEST=$KATACC_CONFIG_DIR/kata-containers.img
cpAndMode $KATACC_IMAGE_SRC $KATACC_IMAGE_DEST 0755

REF_INFO_SRC=/home/packer/reference-info-base64
REF_INFO_DEST=$KATACC_CONFIG_DIR/reference-info-base64
cpAndMode $REF_INFO_SRC $REF_INFO_DEST 0755
Expand Down
5 changes: 5 additions & 0 deletions vhdbuilder/packer/vhd-image-builder-mariner.json
Original file line number Diff line number Diff line change
Expand Up @@ -560,6 +560,11 @@
"source": "kata-containers.img",
"destination": "/home/packer/kata-containers.img"
},
{
"type": "file",
"source": "kata-containers-cc.img",
"destination": "/home/packer/kata-containers-cc.img"
},
{
"type": "file",
"source": "reference-info-base64",
Expand Down

0 comments on commit 7823d7b

Please sign in to comment.