|
Using the `ark' toolThe most common way to control the `ARK engine' is through the ark tool, either from the command line or a shell script. (From Python, you have more direct control, and would simply use the Python API.)SynopsisThe general form of the ark tool is:ark<type> <method> [options] <thing-1> [<thing-2> ...]Examples might include: % ark package build --verbose coreutils--5.2.1 % ark package announce --format=html xemacs--21.1.10 emacs--20.7 % ark package verify --hosts=. ALL % ark package uninstall --pretend gcc--2.7.2 General descriptionIn principle, because the ark tool can be customized for your site, it could differ arbitrarily from what we describe here. You could have different types, different methods, and/or different options...In reality, you'll do package- and host-stuff just like we do, and so this description will probably help. So: package and host are the <type>s you are most likely to manipulate... many others possible, of course. The <method>s that you invoke will likely be those of the Sidai host and package management schemes... Other Sidai schemes which have (some?) documentation are mailing lists and users. The quickest way to get a snapshot of the options in play is to run ark --help. Some of the more common and/or involved options are explained in the options section. The <thing>s on which the <method> is to be invoked can be either `real' things or proto-things. In the package examples above, coreutils--5.2.1 is presumably a real package. ALL is almost certainly a proto-package, presumably one which expands out to all real packages at the site. By default, methods are run on as many hosts as it takes to complete the task across the whole site. Thus, something like ark package verify ALL will (in all probability) run the verify code on all hosts at the site, potentially a lot of work. Yes, there are options to constrain the hosts used... Exit statusAs supplied, traditional Unix: exit status 0 (zero) for success, and non-zero for failure. Site customizing could make it do something else; running ark --help might give useful info.Environment variablesThe essential environment variable is ARK_PROFILE, which names a file that provides the `profile' to be used. Team `sample1' provides some documentation about it.The ARK_DEBUG environment variable can be used to turn on debugging bits. I'm sure they're documented somewhere... I almost always use ARK_DEBUG=15. The DISPLAY environment variable is transmitted to jobs running on remote hosts. Other variables, e.g. PATH, are not transferred to jobs on remote hosts. That environment is constructed from facts in the ARK database; e.g. for a package method, from the ARK-BUILDING-PATH field. OptionsCommon options
Constraint-controlling and state-recording options
Host-related optionsRecall that the example scenario we're working with is:ark package compile ALLConceptually, we will run the <compile> on every single host. Sometimes that's a bit much. When developing, for example, we may be fairly happy for ARK activity to range across machines. However, for a machine's overnight cron jobs, you probably want activity to stay confined to that machine. You can limit the set of hosts with the --hosts command-line option. Examples include: --hosts=. (the host I'm running ark on), --hosts=sparc-solaris (all real hosts that have .:sparc-solaris as a prototype), and so on. It is very common to use --hosts=. when you're trying things out. The only issue left is ``jumping proxy hosts''... Let's imagine you're running: ark package reveal --hosts=foo wibble. You hit a constraint on a method that turns out to have a proxy-host of bar. Bearing in mind that --hosts is trying to limit activity to host foo, do you run the code for the method, or do you bail out? Well, normally you do want to run it, because that's the straightforward and obvious `get on with it' thing to do. However, this puts us in danger of --hosts being pointless. The thing to understand is that --hosts specifies the hosts for which the specified method is to be run, and that the --proxy-hosts method specifies other hosts that are ``acceptable hosts to use along the way''. The default for --proxy-hosts is ALL. If you want to constrain the hosts on which you might run something, then set --proxy-hosts to something else. For example, in a cron job that is only supposed to affect one machine, you might well do `--hosts=. --proxy-hosts=.'. ToDo: --down-hosts Options related to running backwards (undoing)
Options related to interactive and dangerous methods
Site customizationSee the ARK site generation documentation. |