Fai-updater: Difference between revisions

From FAIWiki
Jump to navigation Jump to search
 
(17 intermediate revisions by 2 users not shown)
Line 1: Line 1:
== fai-updater - run and supervise softupdates on many machines at the same time ==
== fai-updater - run and supervise softupdates on many machines at the same time ==
=== Screenshots ===
=== Screenshots ===
Everybody likes screenshots, so here are two. Note: they were done using fai-updater's dry-run mode,
Everybody likes screenshots, so here are two.
which does not touch the hosts, but feeds fai-updater with random log snippets instead to test the
updaters log parser.


General logic is the following:
General logic is the following:
* clients are put into the "waiting" queue (the ''right'' column), by default in randomized order
* clients are put into the "waiting" queue (the ''left'' column), by default in randomized order
* as soon as a slot in the "running" queue gets free (the second column from the right), the first
* as soon as a slot in the "running" queue gets free (the second column), the first "waiting" client gets updated/put into the "running" status and stays there until the update task finished
  "waiting" client gets updated/put into the "running" status and stays there until the update task finished
* Depending on the outcome, the client is sorted in one of the last three columns:
* Depending on the outcome, the client is sorted in one of the first three columns:
** Unreachable: the host was unreachable or the fai softupdate could not be started there
** Unreachable: the host was unreachable or the fai softupdate could not be started there
** Error: the updater detected an error during the update (basically, it parses for the error string produced
** Error: the updater detected an error during the update (basically, it parses for the error string produced by a logcheck script such as hooks/savelog.LAST in the simple example)
  by a logcheck script such as hooks/savelog.LAST in the simple example)
** Success: the update finished and no error was detected
** Success: the update finished and no error was detected
==== Fai-updater in its basic mode ====
==== Fai-updater in its basic mode ====
[[Image:Fai-updater.png]]
https://user-images.githubusercontent.com/516503/241696679-6e4227d8-9069-408c-8063-0401c44a6bc0.png


==== Fai-updater with an open logfile viewer ====
==== Fai-updater with an open logfile viewer ====
[[Image:fai-updater-viewer.png]]
https://github.com/glaweh/fai-updater/assets/516503/df17f8d1-ba7f-476f-8536-2d8f7eceb656


=== License ===
=== License ===
Line 24: Line 20:


=== Download ===
=== Download ===
Until I figure out how to upload a tarball to the wiki, you can download  
You can download the FAI updater from here:
fai-updater from
 
[http://www.physik.fu-berlin.de/~glaweh/pfai/fai-updater-20060321.tar.gz]
https://github.com/glaweh/fai-updater


=== Required packages ===
=== Required packages ===
Line 38: Line 34:


=== Install ===
=== Install ===
Just unpack the tarball.
Just run
 
git clone https://github.com/glaweh/fai-updater.git


=== Command line options ===
=== Command line options ===
  updater-curses [options] <netgroup|-H host1,host2,...>
<nowiki>
   --help           display this help message
Usage: ./bin/fai-updater-ncurses [options] <@netgroup|host [...]>
   --version         print version
 
   -o               ordered mode: don't randomize order of hosts
Help Options:
   -s <number>       number of updates running simultanously
   -h, --help                 display this help message
   -n               dryrun mode: use a dummy-script instead of really  
   --version                 print version information
                    contacting the clients
 
Application Options:
   -o, --ordered              ordered mode: don't randomize order of hosts
   -s, --simultaneous <NUM>   run updates on NUM hosts simultanously
                            (default: 4)
   -n, --dryrun              dryrun mode: use a dummy-script instead of
                            really contacting the clients
</nowiki>


=== Connecting to the clients ===
=== Connecting to the clients ===
Line 74: Line 79:


Henning Glawe <glaweh (at) debian (dot) org>
Henning Glawe <glaweh (at) debian (dot) org>
[[Category:Howto]]

Latest revision as of 09:54, 29 May 2023

fai-updater - run and supervise softupdates on many machines at the same time

Screenshots

Everybody likes screenshots, so here are two.

General logic is the following:

  • clients are put into the "waiting" queue (the left column), by default in randomized order
  • as soon as a slot in the "running" queue gets free (the second column), the first "waiting" client gets updated/put into the "running" status and stays there until the update task finished
  • Depending on the outcome, the client is sorted in one of the last three columns:
    • Unreachable: the host was unreachable or the fai softupdate could not be started there
    • Error: the updater detected an error during the update (basically, it parses for the error string produced by a logcheck script such as hooks/savelog.LAST in the simple example)
    • Success: the update finished and no error was detected

Fai-updater in its basic mode

https://user-images.githubusercontent.com/516503/241696679-6e4227d8-9069-408c-8063-0401c44a6bc0.png

Fai-updater with an open logfile viewer

https://github.com/glaweh/fai-updater/assets/516503/df17f8d1-ba7f-476f-8536-2d8f7eceb656

License

I put this code under the GPLv2

Download

You can download the FAI updater from here:

https://github.com/glaweh/fai-updater

Required packages

for the frontend, you need the Curses::UI perl module, in Debian you get it via

apt-get install libcurses-ui-perl

On the client side, fai-client is needed and of course a FAI configuration which is update-safe.

Install

Just run

git clone https://github.com/glaweh/fai-updater.git

Command line options

Usage: ./bin/fai-updater-ncurses [options] <@netgroup|host [...]>

Help Options:
  -h, --help                 display this help message
  --version                  print version information

Application Options:
  -o, --ordered              ordered mode: don't randomize order of hosts
  -s, --simultaneous <NUM>   run updates on NUM hosts simultanously
                             (default: 4)
  -n, --dryrun               dryrun mode: use a dummy-script instead of
                             really contacting the clients
 

Connecting to the clients

A script using ssh is included, but of course you can edit it to match your own needs.

To be able to connect to the clients using the provided libexec/faiupdate, you need to have some way to access them via ssh as root without entering a password.

A solution for this is to install a matching file as /root/.ssh/authorized_keys, start ssh-agent and load the private key into it _before_ starting fai-updater.

Another, but from a security point of view dangerous, possibility is to use a passphrase-less ssh private key into the account under which you run fai-updater.

Some comments on the code

I know the code is quite rough, as though I tried programming cleanly, a lot of hacks have slipped in, and I don't have the time to clean up the code right now due to my diploma thesis' deadline ;)

If you have any questions or suggestions, feel free to write me.

Henning Glawe <glaweh (at) debian (dot) org>