Skip to content

Instantly share code, notes, and snippets.

@willb
willb / gist:1035680
Created June 20, 2011 14:18
Example session with tagging support in the Wallaby client library
import wallaby
# the "tagging" module patches the Wallaby client library with
# support for tag operations
import tagging
# We'll start by setting up a Wallaby client library session against
# the broker on localhost
from qmf.console import Session
console = Session()
@willb
willb / gist:953980
Created May 3, 2011 19:03
Walkthrough for interactive demo
The condor_configd daemon:
- Part of the configuration_tools git repo
- Provides a configuration file (99configd.config) that can be dropped into LOCAL_CONFIG_DIR
- The configd configuration defines LOCAL_CONFIG_FILE
- The configd augments existing configuration, but is authoritative for DAEMON_LIST
- Needs to know the location of the AMQP broker that is communicating with wallaby (QMF_BROKER_HOST)
Setting up a node with the configd daemon:
- Install the configd on each condor node to be managed
- Ensure the 99configd.config is place in LOCAL_CONFIG_DIR
# cmd_slacker_nodes.rb
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@willb
willb / gist:743525
Created December 16, 2010 15:33
Example transcript from interacting with the Python wallaby client
Python 2.6.2 (r262:71600, Jan 25 2010, 18:46:47)
[GCC 4.4.2 20091222 (Red Hat 4.4.2-20)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from qmf.console import Session
>>> import wallaby
>>>
>>> # create a new console object
... console = Session()
>>>
>>> # connect to the broker (on localhost:5672, by default)
#!/usr/bin/env python
# dencx removes the ncx namespace from an epub file so that you can
# use it as the input to kindlegen.
import zipfile
import re
with zipfile.ZipFile(sys.argv[1], 'r') as inZip:
with zipfile.ZipFile(sys.argv[2], 'w') as outZip:
# cmd_api_version.rb: Prints the API version of the Wallaby service.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@willb
willb / skel.rb
Created October 20, 2010 06:47
Skeleton wallaby shell command file.
#!/usr/bin/env ruby
# skel: template wallaby-shell class
#
# Copyright (c) 2009--2010 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
@willb
willb / wallaby-inventory-constraints.txt
Created October 18, 2010 16:48
Some examples of the new --constraint support in the wallaby inventory tool.
# Constraints can make use of simple syntactic sugar for specifying times.
wallaby:master!? % wallaby inventory -c "not last_checkin.is_never && last_checkin < 2.hours_ago"
node name is provisioned? last checkin
--------- --------------- ------------
Aldridge-Brownhills provisioned Mon Oct 18 11:23:47 -0500 2010
# Constraints can be defined over any property of a node.
wallaby:master!? % wallaby inventory -c "memberships.size == 0"
localhost ~/devel/wallaby
19808 wallaby % curl http://localhost:4567/help
The Wallaby HTTP server provides read-only access to node
configurations. It understands the following requests:
GET /config/$NODENAME/
returns a configuration file with the last activated
configuration for $NODENAME.
GET /config/$NODENAME/at/$VERSION/
#name EightStartds
#depends Master
#depends NodeAccess
USE_PROCD=FALSE
COLLECTOR_HOST=condor-collector.freevariable.com
ALLOW_WRITE=*.freevariable.com
ALLOW_READ=*.freevariable.com
SEC_DEFAULT_AUTHENTICATION_METHODS=CLAIMTOBE
MASTER.PLUGINS = $(LIB)/plugins/MgmtMasterPlugin-plugin.so
STARTD.PLUGINS = $(LIB)/plugins/MgmtStartdPlugin-plugin.so