Packaging Amazon SSM Agent

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Packaging Amazon SSM Agent

Sean Marlow
Hi,

I'm new to packaging and to Go and I'm working on packaging the
amazon-ssm-agent (https://github.com/aws/amazon-ssm-agent). Using
version 1.2.290.0 on GitHub yields multiple vendor issues which seem to
be caused by the package structure, but I could very likely be doing
something wrong.

I'm using the spec file provided in the codebase,
https://github.com/aws/amazon-ssm-agent/blob/master/packaging/amazon-linux/amazon-ssm-agent.spec,
as an example to build the spec for SUSE. On "go build" an error is
produced:

imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: use of
vendored package not allowed

To resolve this I removed the vendor directory from aws-sdk-go as both
dependencies exist in the amazon-ssm-agent vendor directory. Is this the
correct resolution for this issue?

Now it produces another error:

imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: must be
imported as github.com/go-ini/ini

Searching the code base all imports for go-ini are imported as
github.com/go-ini/ini so I'm confused what this error is hinting to.
Does this mean go cannot find the dependency in the proper vendor
directory (amazon-ssm-agent/vendor/...)?

The final thing I noticed with this package is that vendor has an extra
src directory which doesn't match the Go documentation.
(amazon-ssm-agent/vendor/src/github.com rather than
amazon-ssm-agent/vendor/github.com)

I removed the src directory from the tree and attempted to re-build but
it yields the same error. My thinking is that go looks for the
dependencies at vendor/github.com/... and thus the extra directory
prevents all dependencies from being resolved. Is this assumption
correct or am I missing something here?

Sorry for the extensive email I hope it makes some sense and thanks in
advance for any help and/or knowledge you can share.

Cheers!

--
Sean Marlow
Public Cloud Developer
[hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Packaging Amazon SSM Agent

Peter Linnell-4
On Tue, 13 Dec 2016 17:06:23 -0700
Sean Marlow <[hidden email]> wrote:

> Hi,
>
> I'm new to packaging and to Go and I'm working on packaging the
> amazon-ssm-agent (https://github.com/aws/amazon-ssm-agent). Using
> version 1.2.290.0 on GitHub yields multiple vendor issues which seem
> to be caused by the package structure, but I could very likely be
> doing something wrong.
>
> I'm using the spec file provided in the codebase,
> https://github.com/aws/amazon-ssm-agent/blob/master/packaging/amazon-linux/amazon-ssm-agent.spec,
> as an example to build the spec for SUSE. On "go build" an error is
> produced:
>
> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: use of
> vendored package not allowed
>
> To resolve this I removed the vendor directory from aws-sdk-go as both
> dependencies exist in the amazon-ssm-agent vendor directory. Is this
> the correct resolution for this issue?
>
> Now it produces another error:
>
> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: must
> be imported as github.com/go-ini/ini
>
> Searching the code base all imports for go-ini are imported as
> github.com/go-ini/ini so I'm confused what this error is hinting to.
> Does this mean go cannot find the dependency in the proper vendor
> directory (amazon-ssm-agent/vendor/...)?
>
> The final thing I noticed with this package is that vendor has an
> extra src directory which doesn't match the Go documentation.
> (amazon-ssm-agent/vendor/src/github.com rather than
> amazon-ssm-agent/vendor/github.com)
>
> I removed the src directory from the tree and attempted to re-build
> but it yields the same error. My thinking is that go looks for the
> dependencies at vendor/github.com/... and thus the extra directory
> prevents all dependencies from being resolved. Is this assumption
> correct or am I missing something here?
>
> Sorry for the extensive email I hope it makes some sense and thanks in
> advance for any help and/or knowledge you can share.
>
> Cheers!
>

Hi Sean,

Not fun to have to start learning packaging with GO, which has its
quirks.

Can you show us the OBS link or is it internal? If internal, ping me on
IM and I can help.

Thanks,

Peter
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Packaging Amazon SSM Agent

Sean Marlow
Hi Peter,

On 12/13/2016 05:55 PM, Peter Linnell wrote:

> On Tue, 13 Dec 2016 17:06:23 -0700
> Sean Marlow <[hidden email]> wrote:
>
>> Hi,
>>
>> I'm new to packaging and to Go and I'm working on packaging the
>> amazon-ssm-agent (https://github.com/aws/amazon-ssm-agent). Using
>> version 1.2.290.0 on GitHub yields multiple vendor issues which seem
>> to be caused by the package structure, but I could very likely be
>> doing something wrong.
>>
>> I'm using the spec file provided in the codebase,
>> https://github.com/aws/amazon-ssm-agent/blob/master/packaging/amazon-linux/amazon-ssm-agent.spec,
>> as an example to build the spec for SUSE. On "go build" an error is
>> produced:
>>
>> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: use of
>> vendored package not allowed
>>
>> To resolve this I removed the vendor directory from aws-sdk-go as both
>> dependencies exist in the amazon-ssm-agent vendor directory. Is this
>> the correct resolution for this issue?
>>
>> Now it produces another error:
>>
>> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: must
>> be imported as github.com/go-ini/ini
>>
>> Searching the code base all imports for go-ini are imported as
>> github.com/go-ini/ini so I'm confused what this error is hinting to.
>> Does this mean go cannot find the dependency in the proper vendor
>> directory (amazon-ssm-agent/vendor/...)?
>>
>> The final thing I noticed with this package is that vendor has an
>> extra src directory which doesn't match the Go documentation.
>> (amazon-ssm-agent/vendor/src/github.com rather than
>> amazon-ssm-agent/vendor/github.com)
>>
>> I removed the src directory from the tree and attempted to re-build
>> but it yields the same error. My thinking is that go looks for the
>> dependencies at vendor/github.com/... and thus the extra directory
>> prevents all dependencies from being resolved. Is this assumption
>> correct or am I missing something here?
>>
>> Sorry for the extensive email I hope it makes some sense and thanks in
>> advance for any help and/or knowledge you can share.
>>
>> Cheers!
>>
>
> Hi Sean,
>
> Not fun to have to start learning packaging with GO, which has its
> quirks.
>
> Can you show us the OBS link or is it internal? If internal, ping me on
> IM and I can help.

The project is on OBS at
https://build.opensuse.org/package/show/home:seanmarlow:go/amazon-ssm-agent.
The spec file is a mess at the moment as I've been tinkering with it
quite a bit.

Right now my focus is getting the build section working properly so I
haven't tested anything beyond that.

It seems like vendoring might be disabled in the build environment when
building against the current spec. This doesn't make sense from
documentation which mentions Go > 1.5 has it enabled by default.

As a side note the code base in GitHub is a bit neglected at the moment
as the Amazon team is still developing the package on an internal git
repo and not keeping GitHub up-to-date. However, I'm able to run `make
build-linux` locally and build the service without any issues.

>
> Thanks,
>
> Peter
>

--
Sean Marlow
Public Cloud Developer
[hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Re: Packaging Amazon SSM Agent

Sean Marlow


On 12/15/2016 10:45 AM, Sean Marlow wrote:

> Hi Peter,
>
> On 12/13/2016 05:55 PM, Peter Linnell wrote:
>> On Tue, 13 Dec 2016 17:06:23 -0700
>> Sean Marlow <[hidden email]> wrote:
>>
>>> Hi,
>>>
>>> I'm new to packaging and to Go and I'm working on packaging the
>>> amazon-ssm-agent (https://github.com/aws/amazon-ssm-agent). Using
>>> version 1.2.290.0 on GitHub yields multiple vendor issues which seem
>>> to be caused by the package structure, but I could very likely be
>>> doing something wrong.
>>>
>>> I'm using the spec file provided in the codebase,
>>> https://github.com/aws/amazon-ssm-agent/blob/master/packaging/amazon-linux/amazon-ssm-agent.spec,
>>> as an example to build the spec for SUSE. On "go build" an error is
>>> produced:
>>>
>>> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: use of
>>> vendored package not allowed
>>>
>>> To resolve this I removed the vendor directory from aws-sdk-go as both
>>> dependencies exist in the amazon-ssm-agent vendor directory. Is this
>>> the correct resolution for this issue?
>>>
>>> Now it produces another error:
>>>
>>> imports github.com/aws/aws-sdk-go/vendor/github.com/go-ini/ini: must
>>> be imported as github.com/go-ini/ini
>>>
>>> Searching the code base all imports for go-ini are imported as
>>> github.com/go-ini/ini so I'm confused what this error is hinting to.
>>> Does this mean go cannot find the dependency in the proper vendor
>>> directory (amazon-ssm-agent/vendor/...)?
>>>
>>> The final thing I noticed with this package is that vendor has an
>>> extra src directory which doesn't match the Go documentation.
>>> (amazon-ssm-agent/vendor/src/github.com rather than
>>> amazon-ssm-agent/vendor/github.com)
>>>
>>> I removed the src directory from the tree and attempted to re-build
>>> but it yields the same error. My thinking is that go looks for the
>>> dependencies at vendor/github.com/... and thus the extra directory
>>> prevents all dependencies from being resolved. Is this assumption
>>> correct or am I missing something here?
>>>
>>> Sorry for the extensive email I hope it makes some sense and thanks in
>>> advance for any help and/or knowledge you can share.
>>>
>>> Cheers!
>>>
>>
>> Hi Sean,
>>
>> Not fun to have to start learning packaging with GO, which has its
>> quirks.
>>
>> Can you show us the OBS link or is it internal? If internal, ping me on
>> IM and I can help.
>
> The project is on OBS at
> https://build.opensuse.org/package/show/home:seanmarlow:go/amazon-ssm-agent.
> The spec file is a mess at the moment as I've been tinkering with it
> quite a bit.
>
> Right now my focus is getting the build section working properly so I
> haven't tested anything beyond that.
>
> It seems like vendoring might be disabled in the build environment when
> building against the current spec. This doesn't make sense from
> documentation which mentions Go > 1.5 has it enabled by default.
>
> As a side note the code base in GitHub is a bit neglected at the moment
> as the Amazon team is still developing the package on an internal git
> repo and not keeping GitHub up-to-date. However, I'm able to run `make
> build-linux` locally and build the service without any issues.
>

So I tested this initially with the latest code from GitHub and it works
fine. Checking out version tag 1.2.290.0 fails. I'm going to attempt the
OBS build with a package containing latest source and see if I can make
it any further.

>>
>> Thanks,
>>
>> Peter
>>
>

--
Sean Marlow
Public Cloud Developer
[hidden email]
--
To unsubscribe, e-mail: [hidden email]
To contact the owner, e-mail: [hidden email]