diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/Manifest b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/Manifest new file mode 100644 index 0000000000..2098798341 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/Manifest @@ -0,0 +1 @@ +DIST amazon-ssm-agent-2.3.1319.0.tar.gz 22207875 BLAKE2B 9c94f6837079d8117dffea09b1f793d261ac0cb2321c5e0f5a422ea1c57f5abeb3eb38fae74f91481d70ab3bb55dd2098fca4136c37a692d182b45560ed05900 SHA512 bb1d09704981277701bd0b70fadb8c6c917b72fce3f228511def621ea85ee4f401b20456e82bd7e9eed28350260b63076d49cf5f4004555fa16d645bafbecc41 diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild new file mode 100644 index 0000000000..2be9824e0f --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/amazon-ssm-agent-2.3.1319.0.ebuild @@ -0,0 +1,57 @@ +# Distributed under the terms of the GNU General Public License v2 + +EAPI=7 + +COREOS_GO_PACKAGE="${GITHUB_URI}" +COREOS_GO_VERSION="go1.12" + +inherit coreos-go-depend golang-vcs-snapshot + +EGO_PN="github.com/aws/${PN}" +DESCRIPTION="AWS Systems Manager Agent" +HOMEPAGE="https://github.com/aws/amazon-ssm-agent" +LICENSE="Apache-2.0" +SRC_URI="https://${EGO_PN}/archive/${PV}.tar.gz -> ${P}.tar.gz ${EGO_VENDOR_URI}" +SLOT="0" +KEYWORDS="amd64 arm64" + +S="${WORKDIR}/${PN}-${PV}/src/${EGO_PN}" + +PATCHES=( + # patch generated by `goimports -w ./agent` command + "${FILESDIR}"/${P}-goimports.patch +) + +src_prepare() { + default + ln -s ${PWD}/vendor/src/* ${PWD}/vendor/ +} + +src_compile() { + # this is replication of commands from the vendor makefile + # but without network activity during build phase + local GO_LDFLAGS="-s -w -extldflags=-Wl,-z,now,-z,relro,-z,defs" + export GOPATH="${WORKDIR}/${PN}-${PV}" + # set agent release version + BRAZIL_PACKAGE_VERSION=${PV} go run ./agent/version/versiongenerator/version-gen.go + # build all the tools + go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + -o bin/amazon-ssm-agent ./agent || die + go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + -o bin/ssm-cli ./agent/cli-main || die + go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + -o bin/ssm-document-worker ./agent/framework/processor/executer/outofproc/worker || die + go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + -o bin/ssm-session-logger ./agent/session/logging || die + go build -v -ldflags "${GO_LDFLAGS}" -buildmode=pie \ + -o bin/ssm-session-worker ./agent/framework/processor/executer/outofproc/sessionworker || die +} + +src_install() { + into "/usr/share/oem" + dobin bin/amazon-ssm-agent bin/ssm-cli bin/ssm-document-worker bin/ssm-session-logger bin/ssm-session-worker + # files used by ignition on a first run + insinto "/usr/share/oem/ssm" + newins seelog_unix.xml seelog.xml.template + doins amazon-ssm-agent.json.template +} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/files/amazon-ssm-agent-2.3.1319.0-goimports.patch b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/files/amazon-ssm-agent-2.3.1319.0-goimports.patch new file mode 100644 index 0000000000..390ada1d53 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/files/amazon-ssm-agent-2.3.1319.0-goimports.patch @@ -0,0 +1,23 @@ +diff --git a/agent/plugins/inventory/gatherers/application/dataProvider.go b/agent/plugins/inventory/gatherers/application/dataProvider.go +index d252ffb4..d1a010ed 100644 +--- a/agent/plugins/inventory/gatherers/application/dataProvider.go ++++ b/agent/plugins/inventory/gatherers/application/dataProvider.go +@@ -7,7 +7,6 @@ import ( + "fmt" + + "github.com/aws/amazon-ssm-agent/agent/context" +- "github.com/aws/amazon-ssm-agent/agent/plugins/configurepackage/localpackages" + "github.com/aws/amazon-ssm-agent/agent/plugins/inventory/model" + ) + +diff --git a/agent/plugins/inventory/gatherers/application/dataProvider_unix_test.go b/agent/plugins/inventory/gatherers/application/dataProvider_unix_test.go +index af51fa2d..a2757005 100644 +--- a/agent/plugins/inventory/gatherers/application/dataProvider_unix_test.go ++++ b/agent/plugins/inventory/gatherers/application/dataProvider_unix_test.go +@@ -241,4 +241,4 @@ func TestApplicationDataWithPackageRepositoryData(t *testing.T) { + data := CollectApplicationData(mockContext) + assert.Equal(t, len(sampleDataParsed), len(data)) + assert.NotEqual(t, len(mockData), len(data)) +-} +\ No newline at end of file ++} diff --git a/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/metadata.xml b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/metadata.xml new file mode 100644 index 0000000000..f30b435f18 --- /dev/null +++ b/sdk_container/src/third_party/coreos-overlay/app-emulation/amazon-ssm-agent/metadata.xml @@ -0,0 +1,15 @@ + + + + + Amazon EC2 Simple Systems Manager (SSM) Agent is software developed + for the Simple Systems Manager Service. + + + samm@os2.kiev.ua + Oleksii Samorukov + + + aws/amazon-ssm-agent + + diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/base-ec2.ign b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/base-ec2.ign index bfcfd84e05..dd5ce9670a 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/base-ec2.ign +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/files/base/base-ec2.ign @@ -7,6 +7,31 @@ { "name": "coreos-metadata-sshkeys@.service", "enabled": true + }, + { + "name": "amazon-ssm-agent.service", + "enabled": true, + "contents": "[Unit]\nDescription=amazon-ssm-agent\nAfter=network-online.target\n\n[Service]\nType=simple\nWorkingDirectory=/usr/share/oem\nExecStart=/usr/share/oem/amazon-ssm-agent\nKillMode=process\nRestart=on-failure\nRestartForceExitStatus=SIGPIPE\nRestartSec=15min\n\n[Install]\nWantedBy=multi-user.target\n" + } + ] + }, + "storage": { + "files": [ + { + "filesystem": "root", + "path": "/etc/amazon/ssm/amazon-ssm-agent.json", + "contents": { + "source": "oem:///ssm/amazon-ssm-agent.json.template" + }, + "mode": 292 + }, + { + "filesystem": "root", + "path": "/etc/amazon/ssm/seelog.xml", + "contents": { + "source": "oem:///ssm/seelog.xml.template" + }, + "mode": 292 } ] } diff --git a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2.ebuild b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2.ebuild index acd897e6db..6c48367530 100644 --- a/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2.ebuild +++ b/sdk_container/src/third_party/coreos-overlay/coreos-base/oem-ec2-compat/oem-ec2-compat-0.1.2.ebuild @@ -13,6 +13,10 @@ KEYWORDS="amd64 arm64 x86" IUSE="ec2 openstack brightbox" REQUIRED_USE="^^ ( ec2 openstack brightbox )" +RDEPEND=" + app-emulation/amazon-ssm-agent +" + # no source directory S="${WORKDIR}"