From 4c464e2871cb7956c6368f219db7c2b3bf641bc9 Mon Sep 17 00:00:00 2001 From: alinadima Date: Tue, 12 Sep 2023 20:14:55 +0200 Subject: [PATCH] Fixes --- lib/demo-pipeline.ts | 1 - source-repo/poky-ami/build.buildspec.yml | 2 +- source-repo/poky-ami/create-ec2-ami.sh | 10 ++++------ 3 files changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/demo-pipeline.ts b/lib/demo-pipeline.ts index c856706..be77f2b 100644 --- a/lib/demo-pipeline.ts +++ b/lib/demo-pipeline.ts @@ -30,7 +30,6 @@ import { Bucket, IBucket } from 'aws-cdk-lib/aws-s3'; import { SourceRepo, ProjectKind } from './constructs/source-repo'; import { VMImportBucket } from './vm-import-bucket'; import { Asset } from 'aws-cdk-lib/aws-s3-assets'; -import { IAsset } from 'aws-cdk-lib'; const MAX_ALLOWED_LENGTH = 50; diff --git a/source-repo/poky-ami/build.buildspec.yml b/source-repo/poky-ami/build.buildspec.yml index e3f38cd..9f48782 100644 --- a/source-repo/poky-ami/build.buildspec.yml +++ b/source-repo/poky-ami/build.buildspec.yml @@ -38,7 +38,7 @@ phases: - aws s3 cp ${SCRIPT_URL} $CODEBUILD_SRC_DIR/create-ec2-ami.sh # - chmod +x $CODEBUILD_SRC_DIR/create-ec2-ami.sh - chmod +x $CODEBUILD_SRC_DIR/create-ec2-ami.sh - - $CODEBUILD_SRC_DIR/$SCRIPT $IMPORT_BUCKET 16 core-image-minimal aws-ec2-arm64 $TMP_DIR/tmp $ROLE_NAME + - $CODEBUILD_SRC_DIR/create-ec2-ami.sh $IMPORT_BUCKET 16 core-image-minimal aws-ec2-arm64 $TMP_DIR/tmp $ROLE_NAME artifacts: discard-paths: true files: diff --git a/source-repo/poky-ami/create-ec2-ami.sh b/source-repo/poky-ami/create-ec2-ami.sh index d91cf14..0aa8e84 100755 --- a/source-repo/poky-ami/create-ec2-ami.sh +++ b/source-repo/poky-ami/create-ec2-ami.sh @@ -40,19 +40,17 @@ echo TARGET_ARCH=$TARGET_ARCH echo IMAGE_ROOTFS_SIZE=$IMAGE_ROOTFS_SIZE echo AMI_DISK_SIZE_GB=$AMI_DISK_SIZE_GB -echo "Converting ${IMAGE_NAME}.wic.vhdx to raw format" -qemu-img convert -f vhdx -O raw ${IMG_DIR}/${IMAGE_NAME}.wic.vhdx ${IMG_DIR}/${IMAGE_NAME}.rootfs.raw -echo "Pushing image ${IMAGE_NAME}.rootfs.raw to s3://${IMPORT_BUCKET_NAME}" -aws s3 cp ${IMG_DIR}/${IMAGE_NAME}.rootfs.raw s3://${IMPORT_BUCKET_NAME} +echo "Pushing image ${IMAGE_NAME}.wic.vhd to s3://${IMPORT_BUCKET_NAME}" +aws s3 cp ${IMG_DIR}/${IMAGE_NAME}.wic.vhd s3://${IMPORT_BUCKET_NAME} cat < image-import.json { "Description": "ewaol docker image", - "Format": "raw", + "Format": "vhd", "UserBucket": { "S3Bucket": "${IMPORT_BUCKET_NAME}", - "S3Key": "${IMAGE_NAME}.rootfs.raw" + "S3Key": "${IMAGE_NAME}.wic.vhd" } } EOF