-
Notifications
You must be signed in to change notification settings - Fork 74
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 version information and fix cloudbuild #455
Conversation
2dca42d
to
9234966
Compare
/gcbrun |
/gcbrun |
/gcbrun |
1 similar comment
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
/gcbrun |
|
||
"github.com/google/go-tpm-tools/cmd" | ||
) | ||
|
||
// GoReleaser will populates those fields |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how does it do this? I see https://pkg.go.dev/runtime/debug#ReadBuildInfo, does GoReleaser fill that out?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, by default these three will be populated https://goreleaser.com/cookbooks/using-main.version/
version = "dev" | ||
commit = "none" | ||
date = "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does goreleaser populate these fields?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when building the binary, using ldflags:
https://goreleaser.com/cookbooks/using-main.version/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding a comment
launcher/image/preload.sh
Outdated
@@ -128,6 +128,12 @@ main() { | |||
"Only 'debug' and 'hardened' are supported." | |||
exit 1 | |||
fi | |||
|
|||
# make sure files are copied | |||
sync |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is syncing required? Should we only sync the copy directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the symptom we saw in some image builds are files with 0 length in the OEM partition, I thought this might be because of files didn't copy through and the partition got umounted.
/usr/share/oem/confidential_space $ ls -althr
total 80M
drwxr-xr-x 4 root root 4.0K May 28 20:51 ..
-rwxr-xr-x 1 root root 55M May 28 20:51 confidential_space_experiments
-rwxr-xr-x 1 root root 26M May 28 20:51 cs_container_launcher
-rw-r--r-- 1 root root 0 May 28 20:51 container-runner.service
-rwxr-xr-x 1 root root 0 May 28 20:51 exit_script.sh
-rw-r--r-- 1 root root 0 May 28 20:51 fluent-bit-cs.conf
-rw-r--r-- 1 root root 0 May 28 20:51 system-stats-monitor-cs.json
-rw-r--r-- 1 root root 0 May 28 20:51 boot-disk-size-consistency-monitor-cs.json
-rw-r--r-- 1 root root 0 May 28 20:51 docker-monitor-cs.json
-rw-r--r-- 1 root root 0 May 28 20:51 kernel-monitor-cs.json
drwxr-xr-x 2 root root 4.0K May 28 20:51 .
Adding this to make sure all files are written to the disk.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I changed to sync the oem directory only
/gcbrun |
version = "dev" | ||
commit = "none" | ||
date = "unknown" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
consider adding a comment
Upgrade launcher cloudbuild to golang 1.21 Fix cloudbuild with empty oem files
launcher will also show build commit in the welcome message.
update launcher cloudbuild to go1.21 to match its go.mod
add "sync" at the end of the
preload.sh
file to fix (hopefully) the empty files in OEM partition when building the image.