686f6c6d | 7 Feb 15:02

Unified bcfg2.spec file?

Hello list,
all the talk about the spec file last week made me wonder why we
currently have two of them (misc/bcfg2.spec and redhat/bcfg2.spec.in)
and who is using which one.

Them educationated folks on IRC clarified for me that the latter file
can be used to build with "make rpmdist" from git (or previously, from
svn) directly (at least as long as you retain the .git/ directory,
from which the version info is fetched). The misc/ file can be used
with the open build service, rpmbuild, and mock, and it seems to have
received a little more love recently (the redhat one does not build
the bcfg2-web package, f.e.). But then again, the misc/ version still
uses the debian init-scripts and /etc/defaults directory (and so does
the, most likely derived, fedora package, and some of my own
packages).

On IRC, everybody seemed to be using the file in misc/. Is anybody on
this list using the redhat/ flavor?

On top of the above differences, at least the Fedora project (Fabian
Affolter et al) and myself (openSUSE, someday maybe even SLES again)
roll our own, so we have all these versions:
    https://github.com/Bcfg2/bcfg2/blob/master/misc/bcfg2.spec
    https://github.com/Bcfg2/bcfg2/blob/master/redhat/bcfg2.spec.in
    http://pkgs.fedoraproject.org/gitweb/?p=bcfg2.git;a=blob;f=bcfg2.spec;hb=HEAD
    https://build.opensuse.org/package/view_file?file=bcfg.spec&package=bcfg2-stable&project=home%3Am4z&rev=97acdd17c95e23e1cb99cd4bfcddf2f7
(that's one out of five-and-a-half different ones I currently have to
build.)

In other words, we have a zoo of different files that I'd like to either
(Continue reading)

Jonathan Billings | 30 Jan 18:15
Picon
Favicon
Gravatar

Making the bcfg2.spec mock-friendly

In an effort to make the .../misc/bcfg2.spec buildable in mock
(https://fedorahosted.org/mock/) I think we need to remove the part of
the specfile that runs the 'rpm' command, which doesn't work under
mock.

To address this issue, I went back to see why it was added in the
first place.  It appears to have been added to address a requirement
difference between RHEL and SUSE:
https://github.com/Bcfg2/bcfg2/commit/f5bb417f750cc4b39d8b6cc6cae31e5c95800c67
(to address ticket 445
http://trac.mcs.anl.gov/projects/bcfg2/ticket/445).

Now, I'm looking at the OpenSUSE repos, I only see python-lxml
packages anyway, so would it be ok to revert to just requiring
python-lxml?  I don't have any installed SUSE systems so I'm not sure
if older versions of OpenSUSE or the commercial distro still require a
simple 'lxml' package.  If so, I think we should simply use the RPM
spec macro language and distro variables to detect that platform and
require lxml, rather than executing the rpm command.

Any comments?

--

-- 
Jonathan Billings <jsbillin <at> umich.edu>
College of Engineering - CAEN - Unix and Linux Support

Chris St. Pierre | 27 Jan 21:38
Picon
Gravatar

Bcfg2 1.2.1 released

A new release for Bcfg2 1.2.1 is now available at:

ftp://ftp.mcs.anl.gov/pub/bcfg

Bcfg2 1.2.1 is primarily a bugfix release, with over 2 dozen reported
bugs and dozens more unreported bugs fixed. The only significant
change from 1.2.0 is that regular expression support in Rules is now
optional, and off by default; see
http://docs.bcfg2.org/server/plugins/generators/rules.html#using-regular-expressions-in-rules
for more details.

A full list of bug fixes and cool new features is available at
https://trac.mcs.anl.gov/projects/bcfg2/wiki/ReleaseAnnouncement/1.2.1

--

-- 
Chris St. Pierre

Gordon Messmer | 23 Jan 20:38
Favicon

Re: Bcfg2 server rearchitecture

On 01/23/2012 05:59 AM, Chris St. Pierre wrote:
> On Sun, Jan 22, 2012 at 7:20 PM, Gordon Messmer<yinyang <at> eburg.com>  wrote:
>> If you don't mind questions: How long does it take to copy that data from
>> disk to tmpfs?  How long does it take to start up on tmpfs?  Did you try a
>> readahead process before moving to tmpfs?
>
> I'm not sure, since that only happens on _server_ restart, not on
> _service_ restart; the latter is far more common.  The bottleneck in
> the initial checkout is, of course, the SVN server.
>
> Our startup times dropped to 10-15 minutes when we moved to tmpfs.  We
> eventually got rid of Ohai altogether -- that much probe data doesn't
> even remotely scale currently -- and server startup times are down to
> around 4-5 minutes.

OK, but let us acknowledge that you reduced the bcfg2-server startup 
time from 45 minutes to 10-15, while adding some unknown amount of time 
required to mount a tmpfs and check out your data (which presumably came 
off of a disk) as well as adding a big chunk of fixed memory dedicated 
to the bcfg2-server process in the form of an in-memory filesystem.

> No, we didn't try readahead.  We liked tmpfs to speed up the new
> Packages stuff anyway, so went with it as a general solution.

That's unfortunate.  tmpfs is essentially fixed cached data.  Readahead 
should get you the same benefits without the cost of a permanent chunk 
of memory.

>> Maybe you mean that you'll keep all of
>> the XML files in tmpfs and parse them for each request.  That doesn't really
(Continue reading)

Raul Cuza | 23 Jan 06:04
Picon
Gravatar

Proposal: Bcfg2 Branching Model

http://trac.mcs.anl.gov/projects/bcfg2/wiki/DevelopmentBranchingModel

I've created a wiki page with a proposed branching model and request
your feedback. The goal of this wiki is to document how branches in
the Bcfg2 code repo will be managed. My hope is that it meets the
following stories:

 * As a user, I want to easily clone Bcfg2 and have confidence that it
will work in my environment.

 * As a developer, I want clear guidelines on how to contribute code
and work with others on features and fixes.

 * As QA or release manager, I want to change the CI server's job
configurations as little as possible.

--
Raul Cuza

Chris St. Pierre | 20 Jan 15:23
Picon
Gravatar

Bcfg2 server rearchitecture

As hinted at earlier this week, I've been working on writing up a plan
for overhauling the Bcfg2 server architecture to make it more
scalable.  I'm finally done with the first draft, and it's long.
Really long.  I've put it up on Github so we can work on it
collaboratively:

https://github.com/stpierre/bcfg2-rearchitecture/

If you're interested in this kind of stuff and get a few spare
moments, please read it over, critique it, and, ideally, fork and
improve it.

Thanks!

--

-- 
Chris St. Pierre

Chris St. Pierre | 18 Jan 20:50
Picon
Gravatar

Bcfg2 server architecture -- backend storage

I'm working on a writeup of what I see as the path forward to
rearchitect the server portion of Bcfg2 to make it more scalable --
or, really, scalable at all -- according to some discussions I've had
with Narayan and Sol, plus my own half-baked ideas.  I need some input
on what the best way to store the data is going to be as we move to a
more distributed architecture.

My thought is that we can split up the server into a few basic
components which, with proper asynchronous message passing, could be
run on a single machine or on multiple machines to let people scale
where their bottlenecks are.  The components are:

1.  A "master" process that handles SSL, authentication, and request
routing.  This would be fairly lightweight; ideally, something like a
WSGI app under Nginx/Apache, a Mongrel2 app, or a Twisted app.  (All
of those have benefits and drawbacks that I will be exploring further
as I feel this process out.)  It would probably also handle the
initial portion of the client-server discussion -- asserting profiles,
getting probes, receiving probe data, and getting decision lists.
2.  A configuration render process that does all the actual heavy
lifting of rendering templates, generating package lists, and so on.
This is most people's bottleneck nowadays, so I figure most people
would want to run multiple renderers.
3.  Some sort of document/content store to hold the data that is today
stored on the filesystem.  This is my sticking point.

The plain old boring filesystem actually works really great for this,
for a number of reasons:

1.  Really simple retrieval of documents stored in a tree hierarchy.
(Continue reading)

Chris St. Pierre | 18 Jan 03:22
Picon
Gravatar

Metadata group parsing improvements

This is another BEP - a Bcfg2 Enhancement Proposal.

I'd like to rewrite the groups.xml Metadata parser to implement
several new features:

1.  Nested group tags.

Currently, Bcfg2 does not support nesting group tags in groups.xml,
although it's supported everywhere else.  This reduces consistency,
and also makes it difficult to specify certain types of
configurations.  You can implement this sort of logic in Bundler, but
you cannot push out Cfg specific files to compositions of groups.
This would be implemented as, e.g.:

<Group name="foo">
  <Group name="bar">
    <Group name="baz"/>
    <Bundle name="quux"/>
  </Group>
  <Bundle name="xyzzy"/>
</Group>

2.  Client tags.

Client tags are supported in most other structural files -- anything
that uses the StructFile object for its internal modeling.  This
includes Bundler, info.xml, Decisions, Properties, and plenty of
others.  Adding Client tags to groups.xml will increase consistency.
It does not add any features that cannot already be obtained with
GroupPatterns, but it can reduce the complexity of both groups.xml and
(Continue reading)

John Reddy | 17 Jan 21:23
Favicon

Packages plugin acting wonky


So the environment: RHEL 6, x86_64, having the rhel software mirrored via mrepo.  Running Bcfg2 1.2.0 stable release.  I am able to install packages via yum through these repositories without a problem.

This is a brand new install.  I've only created 2 bundles (1 for ssh, 1 for bcfg2 clients), and am trying to add repositories to the Packages plugin.

From /etc/bcfg2.conf:
[server]
repository = /var/lib/bcfg2
plugins = Bundler,Cfg,Metadata,Rules,SSHbase,Packages


From /var/lib/bcfg2/Packages/sources.xml:
<Sources>
    <Source type='yum' rawurl='http://[hostname]/mrepo/rhel-server-6-x86_64/RPMS.os'>
        <Arch>x86_64</Arch>
    </Source>
</Sources>


However, when I run bcfg2-repo-validate on the bcfg2 server, I get what looks like an error message:

# bcfg2-repo-validate
Packages: File read failed; falling back to file download
Packages: Failed to load data for Source of ['http://[hostname]/mrepo/rhel-server-6-x86_64/RPMS.os/repodata/filelists.xml.gz', 'http://[hostname]/mrepo/rhel-server-6-x86_64/RPMS.os/repodata/primary.xml.gz']. Some Packages will be missing.
Packages: File read failed; falling back to file download
Packages: Failed to load data for Source of ['http://[hostname]/mrepo/rhel-server-6-x86_64/RPMS.os/repodata/filelists.xml.gz', 'http://[hostname]/mrepo/rhel-server-6-x86_64/RPMS.os/repodata/primary.xml.gz']. Some Packages will be missing.


That said, bcfg2 is able to partially populate /var/lib/bcfg2/Packages/cache:
# ls -l /var/lib/bcfg2/Packages/cache/
total 10168
-rw-r--r-- 1 root root 3480052 Jan 17 20:19 http: <at> <at> [hostname] <at> mrepo <at> rhel-server-6-x86_64 <at> RPMS.os <at> repodata <at> filelists.xml.gz
-rw-r--r-- 1 root root 1722028 Jan 17 20:19 http: <at> <at> [hostname] <at> mrepo <at> rhel-server-6-x86_64 <at> RPMS.os <at> repodata <at> primary.xml.gz



What am I doing wrong that is generating these error messages to bcfg2-repo-validate and to my log files?

-Skip

--
John "Skip" Reddy, jreddy <at> alcf.anl.gov
Office 1120, Bldg 240
9700 S. Cass Ave
Argonne, IL 60439
Office: 630-252-1377

"To do, one must first imagine."

Alexander Tiurin | 13 Jan 15:41
Picon

Re: bcfg2-server and NAT

Yes, I think the same way about NAT.

tcpdump on the Bcfg2 server

18:01:01.651073 IP 8.8.8.8.48336 > 10.11.110.111.6789: Flags [S], seq 1863191799, win 65535, options [mss 1460,nop,nop,sackOK], length 0
18:01:01.651095 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:04.578897 IP 8.8.8.8.48336 > 10.11.110.111.6789: Flags [S], seq 1863191799, win 65535, options [mss 1460,nop,nop,sackOK], length 0
18:01:04.578918 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:04.856950 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:06.056945 IP 10.11.110.111.6789 > 8.8.8.8.48304: Flags [S.], seq 195973425, ack 1411788650, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:10.612614 IP 8.8.8.8.48336 > 10.11.110.111.6789: Flags [S], seq 1863191799, win 65535, options [mss 1460,nop,nop,sackOK], length 0
18:01:10.612632 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:11.256947 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:24.056952 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:48.057078 IP 10.11.110.111.6789 > 8.8.8.8.48336: Flags [S.], seq 840793119, ack 1863191800, win 5840, options [mss 1460,nop,nop,sackOK], length 0
18:01:54.056943 IP 10.11.110.111.6789 > 8.8.8.8.48304: Flags [S.], seq 195973425, ack 1411788650, win 5840, options [mss 1460,nop,nop,sackOK], length 0

on the client

18:01:02.038243 IP 8.8.8.8.48336 > 4.4.4.4.6789: Flags [S], seq 2541594619, win 5840, options [mss 1460,sackOK,TS val 3654813583 ecr 0,nop,wscale 7], length 0
18:01:02.040345 IP 4.4.4.4.6789 > 8.8.8.8.48336: Flags [S.], seq 3765359903, ack 2541594620, win 16384, options [mss 1460,nop,wscale 0,nop,nop,TS val 0 ecr 0,nop,nop,sackOK], length 0
18:01:02.040384 IP 8.8.8.8.48336 > 4.4.4.4.6789: Flags [.], ack 1, win 46, options [nop,nop,TS val 3654813584 ecr 0], length 0
18:01:02.040985 IP 8.8.8.8.48336 > 4.4.4.4.6789: Flags [P.], seq 1:106, ack 1, win 46, options [nop,nop,TS val 3654813584 ecr 0], length 105
18:01:02.154631 IP 4.4.4.4.6789 > 8.8.8.8.48336: Flags [.], ack 106, win 65430, options [nop,nop,TS val 488223659 ecr 3654813584], length 0
18:01:23.080056 IP 4.4.4.4.6789 > 8.8.8.8.48336: Flags [R.], seq 1, ack 106, win 0, length 0




On 01/13/2012 04:43 PM, Chris St. Pierre wrote:
To be honest, it looks like your NAT might be set up incorrectly, as that traceback usually indicates a timeout of some sort. Do you see anything in the Bcfg2 server logs that indicates a connection has been made? What about a tcpdump on the Bcfg2 server? On Fri, Jan 13, 2012 at 3:40 AM, Alexander Tiurin <alexanderyt <at> gmail.com> wrote:
Hello! This is my scheme of bcfg2-server <> clients client                  gate (NAT)          bcfg2-server 8.8.8.8     <->    4.4.4.4       <->   10.11.110.111 On gate I opened port 6789->10.11.110.111. Then I run bcfg2 # bcfg2 -qvn -p ovz-ubuntu10 Traceback (most recent call last):   File "/usr/sbin/bcfg2", line 340, in <module>     client.run()   File "/usr/sbin/bcfg2", line 191, in run     proxy.AssertProfile(self.setup['profile'])   File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__     return self.__send(self.__name, args)   File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request     verbose=self.__verbose   File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 304, in request     self.send_content(h, request_body)   File "/usr/lib/python2.6/xmlrpclib.py", line 1349, in send_content     connection.endheaders()   File "/usr/lib/python2.6/httplib.py", line 904, in endheaders     self._send_output()   File "/usr/lib/python2.6/httplib.py", line 776, in _send_output     self.send(msg)   File "/usr/lib/python2.6/httplib.py", line 735, in send     self.connect()   File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 186, in connect     self._connect_py26ssl()   File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 220, in _connect_py26ssl     self.sock.connect((self.host, self.port))   File "/usr/lib/python2.6/ssl.py", line 309, in connect     self.do_handshake()   File "/usr/lib/python2.6/ssl.py", line 293, in do_handshake     self._sslobj.do_handshake() socket.error: [Errno 104] Connection reset by peer tcpdump on 8.8.8.8 12:20:22.950748 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 0 12:20:22.952753 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0 12:20:22.952788 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 0 12:20:22.953610 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 105 12:20:23.151201 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0 12:20:44.076819 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0 bcfc2.conf 8.8.8.8 [communication] protocol = xmlrpc/ssl user = 3ED9E831-A914-3906-662BA06A44A64F29 password = 123 ca = /etc/bcfg2.crt [components] encoding = UTF-8 bcfg2 = https://4.4.4.4:6789 I read about NAT http://docs.bcfg2.org/appendix/guides/nat_howto.html , but I can't understand, how use those HOWTO in my choice. Any ideas are welcomed.

Alexander Tiurin | 13 Jan 09:40
Picon

bcfg2-server and NAT

Hello!


This is my scheme of bcfg2-server <> clients

client                  gate (NAT)          bcfg2-server
8.8.8.8     <->    4.4.4.4       <->   10.11.110.111

On gate I opened port 6789->10.11.110.111.

Then I run bcfg2

# bcfg2 -qvn -p ovz-ubuntu10

Traceback (most recent call last):
  File "/usr/sbin/bcfg2", line 340, in <module>
    client.run()
  File "/usr/sbin/bcfg2", line 191, in run
    proxy.AssertProfile(self.setup['profile'])
  File "/usr/lib/python2.6/xmlrpclib.py", line 1199, in __call__
    return self.__send(self.__name, args)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1489, in __request
    verbose=self.__verbose
  File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 304, in request
    self.send_content(h, request_body)
  File "/usr/lib/python2.6/xmlrpclib.py", line 1349, in send_content
    connection.endheaders()
  File "/usr/lib/python2.6/httplib.py", line 904, in endheaders
    self._send_output()
  File "/usr/lib/python2.6/httplib.py", line 776, in _send_output
    self.send(msg)
  File "/usr/lib/python2.6/httplib.py", line 735, in send
    self.connect()
  File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 186, in connect
    self._connect_py26ssl()
  File "/usr/lib/pymodules/python2.6/Bcfg2/Proxy.py", line 220, in _connect_py26ssl
    self.sock.connect((self.host, self.port))
  File "/usr/lib/python2.6/ssl.py", line 309, in connect
    self.do_handshake()
  File "/usr/lib/python2.6/ssl.py", line 293, in do_handshake
    self._sslobj.do_handshake()
socket.error: [Errno 104] Connection reset by peer


tcpdump on 8.8.8.8

12:20:22.950748 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 0
12:20:22.952753 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0
12:20:22.952788 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 0
12:20:22.953610 IP 8.8.8.8.55147 > 4.4.4.4.6789: tcp 105
12:20:23.151201 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0
12:20:44.076819 IP 4.4.4.4.6789 > 8.8.8.8.55147: tcp 0

bcfc2.conf 8.8.8.8
[communication]
protocol = xmlrpc/ssl
user = 3ED9E831-A914-3906-662BA06A44A64F29
password = 123
ca = /etc/bcfg2.crt

[components]
encoding = UTF-8
bcfg2 = https://4.4.4.4:6789

I read about NAT http://docs.bcfg2.org/appendix/guides/nat_howto.html , but I can't understand, how use those HOWTO in my choice.

Any ideas are welcomed.

Gmane