Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

amazon-ssm-agent: re-add dependency to oem-ec2-compat #1162

Merged
merged 3 commits into from
Aug 4, 2021

Conversation

jepio
Copy link
Contributor

@jepio jepio commented Aug 3, 2021

amazon-ssm-agent: re-add dependency to oem-ec2-compat

The binaries were too big to fit on our 128MB OEM partition. Now that the OEM partition is compressed-btrfs it fits again, so re-add the dependency to oem-ec2-compat.

The other half of the PR are cross-compilation fixes. The ebuild was not exporting GOARCH and was making use of latest go. When built for arm64, host binaries were produced. The ebuild has been fixed to cross-compile correctly.

Related: flatcar/Flatcar#107

How to use

emerge-arm64-usr amazon-ssm-agent
./build_image
./image_to_vm --format=ami

Testing done

Build tested, and tested that the binaries fit on the OEM partition.

The ebuild was missing a call to go_export() which exports GOARCH, and so was
always built for host architecture. While COREOS_GO_VERSION was specified as
go1.12, src_compile() has to use '${EGO}' to make use of it, so we were
building with go1.16 (latest).  Upstream builds with 1.12 for this version, so
we will do the same.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
@jepio jepio requested a review from a team August 3, 2021 12:36
@pothos
Copy link
Contributor

pothos commented Aug 3, 2021

I think we should also try to install it now instead of leaving it unused.
You would move the RDEPEND entry in coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2.ebuild out of the comment and revert b6abb59 to restore the entries in base-ec2.ign

@jepio
Copy link
Contributor Author

jepio commented Aug 3, 2021

Sure

…ges""

Now that the OEM partition is a btrfs partition with compression, we have
enough space to install ssm agent.

This reverts commit b6abb59.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
and properly include all deps in RDEPEND.

Signed-off-by: Jeremi Piotrowski <jpiotrowski@microsoft.com>
@jepio jepio changed the title amazon-ssm-agent: cross-compile and use correct go version amazon-ssm-agent: re-add dependency to oem-ec2-compat Aug 3, 2021
@jepio
Copy link
Contributor Author

jepio commented Aug 3, 2021

@pothos I brought back the dependency and I probed the OEM partition of the AMI to see that it's there. Will try to run CI for it.

@jepio
Copy link
Contributor Author

jepio commented Aug 3, 2021

@pothos
Copy link
Contributor

pothos commented Aug 3, 2021

Nice, thanks, how much space is left on the OEM partition?

@jepio
Copy link
Contributor Author

jepio commented Aug 3, 2021

~85MB

@pothos
Copy link
Contributor

pothos commented Aug 3, 2021

Seems the compression pays off, previously it didn't fit

Edit: here the stats: 122M binary content gets compressed, resulting in a 37M used filesystem

@jepio
Copy link
Contributor Author

jepio commented Aug 4, 2021

CI green ✔️

@jepio jepio merged commit 73c7801 into main Aug 4, 2021
@jepio jepio deleted the jepio/amazon-ssm-agent-xcompile branch August 4, 2021 08:20
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
2 participants