Skip to content
This repository has been archived by the owner on Sep 13, 2024. It is now read-only.

Update the packaging data for SUSE #423

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open
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
7 changes: 7 additions & 0 deletions packaging/suse/amazon-ecs-init.changes
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
-------------------------------------------------------------------
Wed May 26 11:33:16 UTC 2021 - Robert Schweikert <[email protected]>

- Add bundled dependencies
- Update amazon-ecs.service to consider the proper environment files
- Set the cache state to ensure the latest agent container gets pulled

-------------------------------------------------------------------
Tue May 25, 19:30:00 UTC 2021 - [email protected] - 1.52.2-2

Expand Down
133 changes: 118 additions & 15 deletions packaging/suse/amazon-ecs-init.spec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#
# spec file for package amazon-ecs-init
#
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
Expand All @@ -12,37 +12,141 @@
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
# TODO: replace with generic rpm. Need to verify the latter works on EC2.


%define short_name amazon-ecs
Name: amazon-ecs-init
Version: 1.7.1
Version: 1.52.1
Release: 0
Summary: Amazon Elastic Container Service Initialization
Summary: Amazon EC2 Container Service Initialization
License: Apache-2.0
Group: System Environment/Base
Url: https://github.com/aws/amazon-ecs-init
Source0: %{name}-%{version}.tar.gz
URL: https://github.com/aws/amazon-ecs-init
Source0: %{name}-%{version}-1.tar.gz
Source1: %{short_name}.service
BuildRequires: go
BuildRequires: systemd
Requires: docker >= 1.6.0
# Patch local to openSUSE Build service to get reproducible builds
#Patch0: reproducible.patch
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this patch something that can be upstreamed so that ecs-init builds reproducibly?

Copy link
Contributor

Choose a reason for hiding this comment

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

@rjschwei Is this something you can respond to?

# Patch local to openSUSE Build service until we sort out the cert handling
# for server validation.
#Patch1: use-agent-container-built-in-certs.patch
BuildRequires: go >= 1.7
BuildRequires: pkgconfig(systemd)
# We cannot handle cross module dependencies properly, i.e. one module can
# only depend on one other module, instead of having a one to many
# dependency construct. While docker is a hard requirement this cannot be
# expressed here and we use Recommends. AS we want to have openSUSE and SLE
# behave in the same way openSUSE has to suffer the same "brokenness"
Recommends: docker >= 1.6.0
rjschwei marked this conversation as resolved.
Show resolved Hide resolved
Requires: systemd
Provides: bundled(golang(github.com/Azure/go-ansiterm))
Provides: bundled(golang(github.com/Azure/go-ansiterm/winterm))
Provides: bundled(golang(github.com/Microsoft/go-winio))
Provides: bundled(golang(github.com/NVIDIA/gpu-monitoring-tools/bindings/go/nvml))
Provides: bundled(golang(github.com/Nvveen/Gotty))
Provides: bundled(golang(github.com/Sirupsen/logrus))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awserr))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/awsutil))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/client/metadata))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/corehandlers))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/ec2rolecreds))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/endpointcreds))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/credentials/stscreds))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/defaults))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/ec2metadata))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/endpoints))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/request))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/session))
Provides: bundled(golang(github.com/aws/aws-sdk-go/aws/signer/v4))
Provides: bundled(golang(github.com/aws/aws-sdk-go/internal/sdkio))
Provides: bundled(golang(github.com/aws/aws-sdk-go/internal/sdkrand))
Provides: bundled(golang(github.com/aws/aws-sdk-go/internal/shareddefaults))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/query/queryutil))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/rest))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/restxml))
Provides: bundled(golang(github.com/aws/aws-sdk-go/private/protocol/xml/xmlutil))
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3))
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3iface))
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/s3/s3manager))
Provides: bundled(golang(github.com/aws/aws-sdk-go/service/sts))
Provides: bundled(golang(github.com/cihub/seelog))
Provides: bundled(golang(github.com/cihub/seelog/archive))
Provides: bundled(golang(github.com/cihub/seelog/archive/gzip))
Provides: bundled(golang(github.com/cihub/seelog/archive/tar))
Provides: bundled(golang(github.com/cihub/seelog/archive/zip))
Provides: bundled(golang(github.com/coreos/go-systemd/activation))
Provides: bundled(golang(github.com/davecgh/go-spew/spew))
Provides: bundled(golang(github.com/docker/docker/api/types))
Provides: bundled(golang(github.com/docker/docker/api/types/blkiodev))
Provides: bundled(golang(github.com/docker/docker/api/types/container))
Provides: bundled(golang(github.com/docker/docker/api/types/filters))
Provides: bundled(golang(github.com/docker/docker/api/types/mount))
Provides: bundled(golang(github.com/docker/docker/api/types/network))
Provides: bundled(golang(github.com/docker/docker/api/types/registry))
Provides: bundled(golang(github.com/docker/docker/api/types/strslice))
Provides: bundled(golang(github.com/docker/docker/api/types/swarm))
Provides: bundled(golang(github.com/docker/docker/api/types/versions))
Provides: bundled(golang(github.com/docker/docker/opts))
Provides: bundled(golang(github.com/docker/docker/pkg/archive))
Provides: bundled(golang(github.com/docker/docker/pkg/fileutils))
Provides: bundled(golang(github.com/docker/docker/pkg/homedir))
Provides: bundled(golang(github.com/docker/docker/pkg/idtools))
Provides: bundled(golang(github.com/docker/docker/pkg/ioutils))
Provides: bundled(golang(github.com/docker/docker/pkg/jsonlog))
Provides: bundled(golang(github.com/docker/docker/pkg/jsonmessage))
Provides: bundled(golang(github.com/docker/docker/pkg/longpath))
Provides: bundled(golang(github.com/docker/docker/pkg/mount))
Provides: bundled(golang(github.com/docker/docker/pkg/pools))
Provides: bundled(golang(github.com/docker/docker/pkg/promise))
Provides: bundled(golang(github.com/docker/docker/pkg/stdcopy))
Provides: bundled(golang(github.com/docker/docker/pkg/system))
Provides: bundled(golang(github.com/docker/docker/pkg/term))
Provides: bundled(golang(github.com/docker/docker/pkg/term/windows))
Provides: bundled(golang(github.com/docker/go-connections/nat))
Provides: bundled(golang(github.com/docker/go-connections/sockets))
Provides: bundled(golang(github.com/docker/go-plugins-helpers/sdk))
Provides: bundled(golang(github.com/docker/go-plugins-helpers/volume))
Provides: bundled(golang(github.com/docker/go-units))
Provides: bundled(golang(github.com/fsouza/go-dockerclient))
Provides: bundled(golang(github.com/go-ini/ini))
Provides: bundled(golang(github.com/golang/mock/gomock))
Provides: bundled(golang(github.com/jmespath/go-jmespath))
Provides: bundled(golang(github.com/opencontainers/go-digest))
Provides: bundled(golang(github.com/opencontainers/image-spec/specs-go))
Provides: bundled(golang(github.com/opencontainers/image-spec/specs-go/v1))
Provides: bundled(golang(github.com/opencontainers/runc/libcontainer/system))
Provides: bundled(golang(github.com/opencontainers/runc/libcontainer/user))
Provides: bundled(golang(github.com/pkg/errors))
Provides: bundled(golang(github.com/pmezard/go-difflib/difflib))
Provides: bundled(golang(github.com/stretchr/testify/assert))
Provides: bundled(golang(golang.org/x/net/context))
Provides: bundled(golang(golang.org/x/net/context/ctxhttp))
Provides: bundled(golang(golang.org/x/net/proxy))
Provides: bundled(golang(golang.org/x/sys/unix))
Provides: bundled(golang(golang.org/x/sys/windows))

BuildRoot: %{_tmppath}/%{name}-%{version}-build
ExclusiveArch: %ix86 x86_64
ExclusiveArch: x86_64 aarch64

%description
The Amazon Elastic Container Service initialization will start the ECS agent.
The Amazon EC2 Container Service initialization will start the ECS agent.
The ECS agent runs in a container and is needed to support integration
between the aws-cli ecs command line tool and an instance running in
Amazon EC2.

%prep
%setup -q -n %{name}-%{version}
%setup -q -n %{name}-%{version}-1
#%patch0 -p1
#%patch1

%build
export GO111MODULE="auto"
./scripts/gobuild.sh suse
gzip -c scripts/amazon-ecs-init.1 > scripts/amazon-ecs-init.1.gz

Expand All @@ -61,7 +165,7 @@ touch %{buildroot}/%{_sysconfdir}/ecs/ecs.config.json

mkdir -p %{buildroot}/%{_localstatedir}/cache/ecs
touch %{buildroot}/%{_localstatedir}/cache/ecs/ecs-agent.tar
touch %{buildroot}/%{_localstatedir}/cache/ecs/state
echo 0 > %{buildroot}/%{_localstatedir}/cache/ecs/state

%files
%defattr(-,root,root,-)
Expand All @@ -76,7 +180,6 @@ touch %{buildroot}/%{_localstatedir}/cache/ecs/state
%{_localstatedir}/cache/ecs/ecs-agent.tar
%{_localstatedir}/cache/ecs/state


%pre
%service_add_pre %{short_name}.service

Expand Down
9 changes: 7 additions & 2 deletions packaging/suse/amazon-ecs.service
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,17 @@
Description=Amazon Elastic Container Service - container agent
Documentation=https://aws.amazon.com/documentation/ecs/
After=docker.service
After=network.target
After=network-online.target
Requires=docker.service
Requires=network.target
Requires=network-online.target

[Service]
Type=simple
Restart=on-failure
RestartPreventExitStatus=5
RestartSec=10s
EnvironmentFile=-/var/lib/ecs/ecs.config
EnvironmentFile=-/etc/ecs/ecs.config
ExecStartPre=/usr/sbin/amazon-ecs-init pre-start
ExecStart=/usr/sbin/amazon-ecs-init start
ExecStop=/usr/sbin/amazon-ecs-init stop
Expand Down