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

[launcher] Try to fix cloudbuild for launcher #458

Merged
merged 1 commit into from
Jun 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
3 changes: 0 additions & 3 deletions launcher/image/cloudbuild.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,4 @@ steps:
timeout: '3000s'

options:
logging: CLOUD_LOGGING_ONLY
dynamic_substitutions: true
pool:
name: 'projects/confidential-space-images-dev/locations/us-west1/workerPools/cs-image-build-vpc'
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Remove this private pool requirement, so people can submit the image build in their own project

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did we have this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Used to have this to build images in the private pool. But I realize it's fine to have the image building step without private pool, just put tests in the private pool.

Good thing is people can now use this cloudbuild file directly to build image in their own project for testing and debugging

13 changes: 13 additions & 0 deletions launcher/image/fixup_oem.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@ main() {
sed -e 's|.*|[BEGIN_CS_CMDLINE]&[END_CS_CMDLINE]|g'

umount /mnt/disks/efi

# Now the oem partition is sealed, we mount it to print it's content
if [[ ! -d /mnt/disks/oem ]]; then
mkdir /mnt/disks/oem
Copy link
Contributor

Choose a reason for hiding this comment

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

Cleanup this directory?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think it is fine as this is not get persistent, just a tmp build environment

fi

# Since it's sealed, we mount it read-only to prevent changes
mount -o ro /dev/sda8 /mnt/disks/oem

ls -l /mnt/disks/oem/
ls -l /mnt/disks/oem/confidential_space

umount /mnt/disks/oem
}

main
4 changes: 4 additions & 0 deletions launcher/image/preload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,12 @@ main() {
# Make sure cache is flushed for the OEM partition.
sync ${OEM_PATH}

# Remount as read-only to avoid unexpected changes
Copy link
Contributor

Choose a reason for hiding this comment

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

Why do we need this? Are you worried that some other thing is modifying the OEM partition after the fact? Wouldn't that get reflected in the dm-verity?

Copy link
Contributor Author

@jkl73 jkl73 Jun 4, 2024

Choose a reason for hiding this comment

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

yes, the behavior I saw is files are all good before the preload.sh finish, but somehow got corrupted before the dm-verity sealing step. So dm-verity looks all good, but the files are still corrupted.

Remount it as read-only (as it should be before this script) just to make sure it doesn't get overwritten accidentally

mount -o remount,ro ${OEM_PATH}

# Verify the content before the OEM sealing step.
ls -lh ${CS_PATH}
ls -lh ${OEM_PATH}
}

main
Loading