You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@bigtop.apache.org by Jun He <ju...@linaro.org> on 2017/07/17 04:46:36 UTC

Cannot build bigtop/slaves-ubuntu-16.04 with fresh built puppet image

Hi,

I cloned latest code (297cf3da616dc)@master, tried following steps on
x86_64/ubuntu16.04 platform:
1. build bigtop/puppet:
    cd docker/bigtop-puppet/ubuntu-16.04 && ./build.sh
And I got following output:
=========================================
Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└── puppetlabs-stdlib (v4.17.1)
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└─┬ puppetlabs-apt (v4.1.0)
  └── puppetlabs-stdlib (v4.17.1)
 ---> 4267f1b7fd08
Removing intermediate container 3ba642c18260
Successfully built 4267f1b7fd08
=========================================
2. cd ~/bigtop && docker build -t bigtop/slaves:trunk-ubuntu-16.04 -f
docker/bigtop-slaves/ubuntu-16.04/Dockerfile .

And I got:
=========================================
Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
Fetched 306 kB in 2s (118 kB/s)
Reading package lists...
Error: Syntax error at 'Hash'; expected ')' at
/etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
Error: Syntax error at 'Hash'; expected ')' at
/etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
The command '/bin/sh -c apt-get clean && apt-get update && puppet apply -e
"include bigtop_toolchain::installer"' returned a non-zero code: 1
=========================================

Seems the latest puppet-apt code doesn't work with puppet v3.8.5 in
bigtop/puppet-ubuntu-16.04 image.

I found that Kengo Seki has a change(BIGTOP-2774) for this issue.
My question is how I can execute it to reinstall puppetlabs-apt for
puppet<v4.*
I've tried to modify bigtop_toolchain/manifests/installer.pp, to add
following lines:
+  stage { 'first':
+    require => Stage['main'],
+  }
+  class { 'bigtop_toolchain::puppet-modules': stage => 'first' }
+

But it doesn't work. Can anyone pls enlight me?

Thanks & regards,

Jun

Re: Cannot build bigtop/slaves-ubuntu-16.04 with fresh built puppet image

Posted by Konstantin Boudnik <co...@apache.org>.
Ok, after thinking about this for a second, I believe the only way to
get it fixed relatively quickly is by introducing the same logic into
puppetize.sh. Namely, if the body of the last case statement is
changed like this
 case ${ID} in
    debian|ubuntu)
-      puppet module install puppetlabs-apt;;
+       version=""
+       if [ `puppet --version | cut -c1` -lt "4" ]; then
+           version="--version 2.4.0"
+       fi
+      puppet module install puppetlabs-apt $version;;
 esac

ubuntu-16.04 is getting build like a charm. I don't like to keep the
logic in two different places but it seems the only option. Is there a
JIRA for this?

--
  With regards,
Konstantin (Cos) Boudnik
2CAC 8312 4870 D885 8616  6115 220F 6980 1F27 E622

Disclaimer: Opinions expressed in this email are those of the author,
and do not necessarily represent the views of any company the author
might be affiliated with at the moment of writing.


On Tue, Jul 18, 2017 at 3:41 PM, Konstantin Boudnik <co...@apache.org> wrote:
> Let's see... if I am reading this right, then the following should
> happen only on a system with Puppet version >= 4
>
> /etc/puppet/modules
> └─┬ puppetlabs-apt (v4.1.0)
>
> right?
>
> Yet, even on Puppet v3.8.5 the same version gets installed instead of
> expected 2.4.0. And indeed, looking into puppetize,sh we find this at
> the very end:
>
> case ${ID} in
>    debian|ubuntu)
>       puppet module install puppetlabs-apt;;
> esac
>
> So, looks like whatever is being done by the bigtop_toolchain recipe,
> it is a bit late because the apt module (the latest version of it) has
> been already installed in the puppetized image. A kind of race
> condition. Not sure how to fix it elegantly...
>
> --
>   With regards,
> Konstantin (Cos) Boudnik
> 2CAC 8312 4870 D885 8616  6115 220F 6980 1F27 E622
>
> Disclaimer: Opinions expressed in this email are those of the author,
> and do not necessarily represent the views of any company the author
> might be affiliated with at the moment of writing.
>
>
> On Sun, Jul 16, 2017 at 9:46 PM, Jun He <ju...@linaro.org> wrote:
>> Hi,
>>
>> I cloned latest code (297cf3da616dc)@master, tried following steps on
>> x86_64/ubuntu16.04 platform:
>> 1. build bigtop/puppet:
>>     cd docker/bigtop-puppet/ubuntu-16.04 && ./build.sh
>> And I got following output:
>> =========================================
>> Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
>> Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
>> Notice: Preparing to install into /etc/puppet/modules ...
>> Notice: Downloading from https://forgeapi.puppetlabs.com ...
>> Notice: Installing -- do not interrupt ...
>> /etc/puppet/modules
>> └── puppetlabs-stdlib (v4.17.1)
>> Notice: Preparing to install into /etc/puppet/modules ...
>> Notice: Downloading from https://forgeapi.puppetlabs.com ...
>> Notice: Installing -- do not interrupt ...
>> /etc/puppet/modules
>> └─┬ puppetlabs-apt (v4.1.0)
>>   └── puppetlabs-stdlib (v4.17.1)
>>  ---> 4267f1b7fd08
>> Removing intermediate container 3ba642c18260
>> Successfully built 4267f1b7fd08
>> =========================================
>> 2. cd ~/bigtop && docker build -t bigtop/slaves:trunk-ubuntu-16.04 -f
>> docker/bigtop-slaves/ubuntu-16.04/Dockerfile .
>>
>> And I got:
>> =========================================
>> Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
>> Fetched 306 kB in 2s (118 kB/s)
>> Reading package lists...
>> Error: Syntax error at 'Hash'; expected ')' at
>> /etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
>> Error: Syntax error at 'Hash'; expected ')' at
>> /etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
>> The command '/bin/sh -c apt-get clean && apt-get update && puppet apply -e
>> "include bigtop_toolchain::installer"' returned a non-zero code: 1
>> =========================================
>>
>> Seems the latest puppet-apt code doesn't work with puppet v3.8.5 in
>> bigtop/puppet-ubuntu-16.04 image.
>>
>> I found that Kengo Seki has a change(BIGTOP-2774) for this issue.
>> My question is how I can execute it to reinstall puppetlabs-apt for
>> puppet<v4.*
>> I've tried to modify bigtop_toolchain/manifests/installer.pp, to add
>> following lines:
>> +  stage { 'first':
>> +    require => Stage['main'],
>> +  }
>> +  class { 'bigtop_toolchain::puppet-modules': stage => 'first' }
>> +
>>
>> But it doesn't work. Can anyone pls enlight me?
>>
>> Thanks & regards,
>>
>> Jun

Re: Cannot build bigtop/slaves-ubuntu-16.04 with fresh built puppet image

Posted by Konstantin Boudnik <co...@apache.org>.
Let's see... if I am reading this right, then the following should
happen only on a system with Puppet version >= 4

/etc/puppet/modules
└─┬ puppetlabs-apt (v4.1.0)

right?

Yet, even on Puppet v3.8.5 the same version gets installed instead of
expected 2.4.0. And indeed, looking into puppetize,sh we find this at
the very end:

case ${ID} in
   debian|ubuntu)
      puppet module install puppetlabs-apt;;
esac

So, looks like whatever is being done by the bigtop_toolchain recipe,
it is a bit late because the apt module (the latest version of it) has
been already installed in the puppetized image. A kind of race
condition. Not sure how to fix it elegantly...

--
  With regards,
Konstantin (Cos) Boudnik
2CAC 8312 4870 D885 8616  6115 220F 6980 1F27 E622

Disclaimer: Opinions expressed in this email are those of the author,
and do not necessarily represent the views of any company the author
might be affiliated with at the moment of writing.


On Sun, Jul 16, 2017 at 9:46 PM, Jun He <ju...@linaro.org> wrote:
> Hi,
>
> I cloned latest code (297cf3da616dc)@master, tried following steps on
> x86_64/ubuntu16.04 platform:
> 1. build bigtop/puppet:
>     cd docker/bigtop-puppet/ubuntu-16.04 && ./build.sh
> And I got following output:
> =========================================
> Processing triggers for sgml-base (1.26+nmu4ubuntu1) ...
> Processing triggers for dbus (1.10.6-1ubuntu3.3) ...
> Notice: Preparing to install into /etc/puppet/modules ...
> Notice: Downloading from https://forgeapi.puppetlabs.com ...
> Notice: Installing -- do not interrupt ...
> /etc/puppet/modules
> └── puppetlabs-stdlib (v4.17.1)
> Notice: Preparing to install into /etc/puppet/modules ...
> Notice: Downloading from https://forgeapi.puppetlabs.com ...
> Notice: Installing -- do not interrupt ...
> /etc/puppet/modules
> └─┬ puppetlabs-apt (v4.1.0)
>   └── puppetlabs-stdlib (v4.17.1)
>  ---> 4267f1b7fd08
> Removing intermediate container 3ba642c18260
> Successfully built 4267f1b7fd08
> =========================================
> 2. cd ~/bigtop && docker build -t bigtop/slaves:trunk-ubuntu-16.04 -f
> docker/bigtop-slaves/ubuntu-16.04/Dockerfile .
>
> And I got:
> =========================================
> Get:4 http://archive.ubuntu.com/ubuntu xenial-backports InRelease [102 kB]
> Fetched 306 kB in 2s (118 kB/s)
> Reading package lists...
> Error: Syntax error at 'Hash'; expected ')' at
> /etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
> Error: Syntax error at 'Hash'; expected ')' at
> /etc/puppet/modules/apt/manifests/init.pp:6 on node d4f93cc44884.lab
> The command '/bin/sh -c apt-get clean && apt-get update && puppet apply -e
> "include bigtop_toolchain::installer"' returned a non-zero code: 1
> =========================================
>
> Seems the latest puppet-apt code doesn't work with puppet v3.8.5 in
> bigtop/puppet-ubuntu-16.04 image.
>
> I found that Kengo Seki has a change(BIGTOP-2774) for this issue.
> My question is how I can execute it to reinstall puppetlabs-apt for
> puppet<v4.*
> I've tried to modify bigtop_toolchain/manifests/installer.pp, to add
> following lines:
> +  stage { 'first':
> +    require => Stage['main'],
> +  }
> +  class { 'bigtop_toolchain::puppet-modules': stage => 'first' }
> +
>
> But it doesn't work. Can anyone pls enlight me?
>
> Thanks & regards,
>
> Jun