Giter Club home page Giter Club logo

Comments (14)

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Bumping this to high priority because it hasn't been tested as much as #48.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

This seems to be more complicated than I anticipated. The issue is that the current Beaker setup assumes one host, on which it can do the install and validate the state of the system. Once we start doing two installs, we need two different hosts.

It wasn't immediately obvious how to do this, but after digging through the Beaker API in some detail it seems that it provides enough support for working with individual hosts to make it possible.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

This discovered, and is now blocked on, #53.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

This is blocked on #57.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

#54 added support for kicking off these tarball install Beaker tests via a dedicated, new rake command (rake centos_tarball).

However, because it's not possible to have Beaker install a Puppet module on a host from a GitHub branch, I can't point the tarball Beaker tests at the proposed PR, pre-merge version of camptocamp-archive that supports a strip_components=n param.

This is part of the output of a bundle exec rake centos_tarball. Note that it installs the version of camptocamp-archive that's on the forge.

centos-7-tarball 13:20:14$ puppet module install camptocamp-archive
Notice: Preparing to install into /etc/puppet/modules ...
Notice: Downloading from https://forgeapi.puppetlabs.com ...
Notice: Installing -- do not interrupt ...
/etc/puppet/modules
└── camptocamp-archive (v0.3.6)

The tarball install Beaker tests will fail until this is resolved.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Note that I can work around the Beaker issue described above and do manual testing via the vagrant-opendaylight project's support for provisioning using the tarball install method of this Puppet module.

All of this looks good:

[~/vagrant-opendaylight]$ vagrant ssh cent7_puppet_tarball
Last login: Tue Jul 22 03:42:16 2014 from 10.0.2.2
[vagrant@localhost ~]$ ls /usr/src/
debug  kernels  opendaylight-0.2.2.tar.gz  opendaylight-systemd.tar.gz  vboxguest-4.3.14
[vagrant@localhost ~]$ ls /opt/
opendaylight-0.2.2  VBoxGuestAdditions-4.3.14
[vagrant@localhost ~]$ ls /opt/opendaylight-0.2.2/
bin  configuration  data  deploy  etc  externalapps  lib  system  version.properties
[vagrant@localhost ~]$ ls /usr/lib/systemd/system | grep -i opend
opendaylight.service
[vagrant@localhost ~]$ which java
/usr/bin/java

This is what #51 will address (should be owned by odl:odl):

[vagrant@localhost ~]$ ls -l /opt/
drwxr-xr-x. 10 root root 4096 Feb 27 21:40 opendaylight-0.2.2
[vagrant@localhost ~]$ getent passwd odl
[vagrant@localhost ~]$ getent group odl
[vagrant@localhost ~]$

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Using the manual method described above, the tarball install seems to be working well:

[vagrant@localhost ~]$ sudo systemctl status opendaylight
opendaylight.service - OpenDaylight SDN Controller
   Loaded: loaded (/usr/lib/systemd/system/opendaylight.service; enabled)
   Active: active (running) since Sat 2015-02-28 18:13:01 UTC; 1h 29min ago
     Docs: https://wiki.opendaylight.org/view/Main_Page
           http://www.opendaylight.org/
 Main PID: 11603 (java)
   CGroup: /system.slice/opendaylight.service
           └─11603 java -server -Xms128M -Xmx2048m -XX:+UnlockDiagnosticVMOptions -XX:+...

Feb 28 18:13:01 localhost.localdomain systemd[1]: Started OpenDaylight SDN Controller.
[vagrant@localhost ~]$ pgrep java
11603
[vagrant@localhost vagrant]$ ./scripts/connect.sh 
Will repeatedly attempt connecting to Karaf shell until it's ready
Warning: Permanently added '[localhost]:8101' (DSA) to the list of known hosts.
Authenticated with partial success.

    ________                       ________                .__  .__       .__     __       
    \_____  \ ______   ____   ____ \______ \ _____  ___.__.|  | |__| ____ |  |___/  |_     
     /   |   \\____ \_/ __ \ /    \ |    |  \\__  \<   |  ||  | |  |/ ___\|  |  \   __\    
    /    |    \  |_> >  ___/|   |  \|    `   \/ __ \\___  ||  |_|  / /_/  >   Y  \  |      
    \_______  /   __/ \___  >___|  /_______  (____  / ____||____/__\___  /|___|  /__|      
            \/|__|        \/     \/        \/     \/\/            /_____/      \/          


Hit '<tab>' for a list of available commands
and '[cmd] --help' for help on a specific command.
Hit '<ctrl-d>' or type 'system:shutdown' or 'logout' to shutdown OpenDaylight.

opendaylight-user@root>

Relevant to fixes added for #62.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

To summarize the situation with this issue at the moment: We either need the ability to install Puppet modules on Beaker hosts from git repos or for my PR against camptocamp-archive get merged (#57). We are able to do a manual test of the tarball install method (compared to Beaker's more automated tests) using the vagrant-opendaylight project, which supports standing up ODL in many ways, including from this Puppet mod using the tarball install method. It seems to be working properly, but of course that can't be strongly asserted without proper test coverage.

As recommended in the Puppetlabs Jira ticket linked above, I raised an issue against Beaker to start the discussion about adding a helper to Beaker for git-based module installs.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

My camptocamp-archive PR was merged, so #57 is closed, so this is no longer blocked.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

As I mentioned in the last relevant commit message:

All tarball tests passing except a general one, debugging.

The issue is a bit obscure (of course, Puppet). Our install_odl acceptance test helper fn applies our ODL install manifest twice, once to check for failures and a second time to check for idempotency.

    # Apply our Puppet manifest on the Beaker host
    apply_manifest(pp, :catch_failures => true)
    # Run it twice to test for idempotency
    apply_manifest(pp, :catch_changes  => true)

Here's the highest order bits of Beaker's failure message:

  1) opendaylight class testing install methods should work idempotently with no errors
     Failure/Error: apply_manifest(pp, :catch_changes  => true)
     Beaker::Host::CommandFailure:
       Host 'centos-7' exited with 2 running:
        puppet apply --verbose --detailed-exitcodes /tmp/apply_manifest.pp.hv0DaE

Note that puppet-apply exit code 2 mentioned here:

       Host 'centos-7' exited with 2 running:

Means there was a change during the apply:

--detailed-exitcodes
Provide transaction information via exit codes. If this is enabled, an exit code of '2' means there were changes, an exit code of '4' means there were failures during the transaction, and an exit code of '6' means there were both changes and failures.

Digging into the stack trace, we see that the Karaf config file was changed (at least the owner/group/mode, maybe content?)

       Last 10 lines of output were:
        Info: /Stage[main]/Opendaylight::Config/File[org.apache.karaf.features.cfg]: Filebucketed /opt/opendaylight-0.2.2/etc/org.apache.karaf.features.cfg to puppet with sum ebe3dbe5595f28c3b32b35b59e1d36cc
        Notice: /Stage[main]/Opendaylight::Config/File[org.apache.karaf.features.cfg]/content: content changed '{md5}ebe3dbe5595f28c3b32b35b59e1d36cc' to '{md5}bf207ae2ade316ddc100da27488fa722'
        Notice: /Stage[main]/Opendaylight::Config/File[org.apache.karaf.features.cfg]/owner: owner changed 'root' to 'odl'
        Notice: /Stage[main]/Opendaylight::Config/File[org.apache.karaf.features.cfg]/group: group changed 'root' to 'odl'
        Notice: /Stage[main]/Opendaylight::Config/File[org.apache.karaf.features.cfg]/mode: mode changed '0644' to '0775'
        Notice: /File[org.apache.karaf.features.cfg]/seluser: seluser changed 'unconfined_u' to 'system_u'

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

Digging into the stack trace, we see that the Karaf config file was changed (at least the owner/group/mode, maybe content?)

The owner/group/mode of a file doesn't seem to change its hash, so the content seems to have changed as well.

[/tmp]$ touch foo
[/tmp]$ sha256sum foo
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  foo
[/tmp]$ sudo chown root:root foo
[/tmp]$ sha256sum foo
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  foo
[/tmp]$ ls -l foo
-rw-rw-r--. 1 root root 0 Mar  9 17:50 foo
[/tmp]$ sudo chmod +x foo
[/tmp]$ sha256sum foo
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855  foo
[/tmp]$ echo "bar" > foo
[/tmp]$ sha256sum foo
7d865e959b2466918c9863afca942d0fb89d7c9ac0c99bafc3749504ded97730  foo

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

The cleaner owner/group/mode config that will be implemented by #65 may fix our idempotency test failure as a side effect.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

The idempotency test failure is actually just a result of the tarball extraction not being idempotent. When the puppet-apply is re-run during Beaker tests, the extraction is done again, which replaces all of the content manged by the archive resources.

All of the files in the archive are changing, not just the Karaf config file highlighted by the "helpful" stack extract. It just was unlucky/confusing that the trace was 10 lines, and the last 10 lines seemed to clearly focus on the Karaf config file.

I'm not sure if this is a problem, or if we can safely ignore the failure. If it is a problem, it's a pretty deep one with the archive mod, not the ODL mod.

from puppet-opendaylight.

dfarrell07 avatar dfarrell07 commented on September 13, 2024

All of the current Beaker tests for tarball installs are (finally!) passing.

Finished in 11 minutes 38 seconds (files took 1 minute 58 seconds to load)
36 examples, 0 failures

Need to add some coverage.

from puppet-opendaylight.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.