Subversion Repositories DevTools

Rev

Rev 1042 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1038 dpurdie 1
Notes on the blat package transfer system
2
-----------------------------------------
3
 
4
Reason for its creation
5
-----------------------
6
Need to transfer packages from dpkg_archive to remote sites in a timely manner.
7
Rsync was considered but it has several problems:
8
 
9
1) Does not handle symlinks in a suitable manner
10
2) Works with all the files in the repository. Experience has
11
   shown that this can be very slow
12
3) Still requires significant scripting in order to be useful
13
 
14
Blat can make several assumptions about the package system.
15
Blat will:
16
    Support multiple transfer target destinations
17
    Allow for rapid detection of new packages that need to be transferred
18
    Allow for multiple Releases to be synchronized
19
    Allow for all (not-closed) releases in a Project to be synchronized
20
    Easily configured - and can be configured on the fly
21
    Atomically transfer packages
22
    Transfer a PackageList for future cleanup operations
23
    Logging and debug facilities
24
 
25
Overview of Blat
26
---------------
27
There are two main components in Blat
28
    Daemon supervisor
29
        Responsible for start and restarting configured daemons
30
    Transfer Daemons
31
        Responsible for the package sync operations for one target
32
        Multiple Daemons ( targets ) are supported
33
 
34
Each Blat Daemon performs three main operations
35
    1) Fast package transfer
36
    2) Repository synchronization
37
    3) PackageList creation
38
 
39
Fast package transfer
40
===============================
41
This is mechanism whereby Blat will detect the need to transfer a newly built
42
package to the target system.
43
 
44
It works by monitoring a directory of tags. It is the responsibility of Release
45
Manager to populate the directory.
46
 
47
The responsiveness of the detection can be configured, but a period of 5
48
seconds is suggested.
49
 
50
Repository synchronization
51
===============================
52
The daemon will request a list of packages that are present on the target and
53
determine the list of packages that should be on the target. Discrepancies will
54
be transferred to the target. Excess packages are left on the target.
55
 
56
Blat will request the target to create and transfer a list of packages.
57
This is done by invoking a small program on the target to perform the work.
58
 
59
Blat will interrogate the Release Manager database for Releases to be processed
60
and packages in those Releases.
61
 
62
A package will be transferred to the target if:
63
    * The package is required, but not present on the target
64
    * The time-stamps of the descpkg files differ
65
 
66
Package transfer may be delayed if the source package is writable, unless it
67
has been writable for longer than a configured time period.
68
 
69
The frequency of the Repository synchronization can be configured. A time of
70
several hours is suggested.
71
 
72
 
73
PackageList creation
74
===============================
75
Blat will create and send to the target a list of package-version that are
76
in the current set. This list may be used to clean out the package archive,
77
but this functionality has not yet been implemented.
78
 
79
 
80
Host System Requirements
81
========================
82
1) Unix
83
   It has been designed for a Unix environment - not Windows
84
2) Perl
85
   Blat is written in Perl
86
3) Java
87
   Required for the Database interface
88
4) Shell
89
   Start and stop scripts are in shell
90
5) Utilities
91
    ssh
92
    gtar
93
    gzip
94
 
95
Target System Requirements
96
========================
97
1) Unix
98
   It has been designed for a Unix environment - not Windows
99
2) Perl
100
3) Shell
101
   Blat will execute a number of scripts on the target inn order
102
   to control the process. These are in shell and perl
103
4) Utilities
104
    ssh
105
    gtar
106
    gunzip
107
5) User with write access to the dpkg_archive
108
6) Link for the users home directory to the package archive
109
   This link is called 'dpkg_archive'
110
 
111
Shared requirements
112
===================
113
Blat uses ssh for the transfer process. It uses an 'identity' file to allow
114
passwordless authentication with the target. The public part of the identify
115
file must be appended to the target users .ssh/authorized_keys file.
116
 
117
The private part of the identity file is held by the Blat Daemon.
118
 
119
Design assumptions
120
================================================================================
121
Blat is designed to transfer dpkg_archive packages in one direction.
122
 
123
Blat makes assumptions on the structure of a package
124
    - They contain a descpkg file
125
    - They are read-only when fully released
126
    - The contents of packages does not change
127
    - It is not necessary to check every file in the package
128
 
129
The Blat master is designed to run in a single directory tree.
130
The config file should be in a 'config' directory under the location
131
of the blat master program.
132
 
133
Installation :: Target System
134
=============================
135
1) Create or aquire a user that has write access to the packaeg archive
136
 
137
2) Create or aquire a passwordless identity file and associated public key
138
   of the identity file. One set is available in the 'ssh' subdirectory.
139
 
140
   Append the public part of the idenity file (id_rsa_pkg_admin.pub) to
141
   ~/.ssh/authorized_keys
142
 
143
3) Create a link from the users home directory to dpkg_archive
144
   The must be called dpkg_archive
145
 
146
4) Transfer the blat receiver scripts to a directory accessable to the
147
   transfer user. ie: ~/bin
148
   The reqired receiver files are:
149
        get_plist.pl
150
        receive_file
151
        receive_package
152
        delete_package
153
   Ensure the programs are execuatable by the transfer user.
154
 
155
Installation :: Host System
156
=============================
157
This section really deals with the configuration of a new target.
158
 
159
1) Create a new config file in Blat's config directory - with a .conf
160
   suffix. This is best done by cloning an existing entry.
161
 
162
   Note: The blat master will automatically spawn a daemon as soon
163
   as a new config file is seen. Its best to create the file elsewhere
164
   and copy it to the directory when ready.
165
 
166
   Note: The Blat daemon will detect changes to its own config file and
167
   re-read it on the fly.
168
 
169
Useful Tricks
170
=============
171
 
172
kill -usr1 pid-of-daemon
173
    Will force the daemon to perform a repository sync check.
174
 
175
kill -hup pid-of-daemon
176
    Will force the daemon to roll its own log files
177
 
178
Debug verbosity is controlled via the 'verbose' config item
179
 
180
The pkg.xxxx config items are very special.
181
If the named package-versio is a symlink, then both the
182
link and the liink the package addresses will be transferred.
183
The link MUST address another version of the same package.
184
This is intended to support the 'jats2_current' link.
185
When a new version of JATS is released, then the new package
186
will be transferred, as will the new link.
187
 
188
Config items that control a time period allow the following sufixes:
189
    s - Seconds. Same as no suffix
190
    m - Minutes
191
    h - Hours
192
    d - Days
193
Multiple are allowed. ie: 1h10h
194
 
195
Config items that control a file size in blocks allow the following suffixes:
196
    k - Kilobytes (Same as no suffix)
197
    b - Blocks    (Same as no suffix)
198
    m - Megabytes
199
    g - Gigabytes
200
 
201
 
202
ToDo
203
======================
204
 
205
1) Purging packages on target
206
   Can set deletePackages to delete excess packages when the release sync
207
   is performed.
208
 
209
2) Better handling of soft-links for core_devl
210
   Works, but its prone to error
211
   There is no test to ensure the link exists. If the link
212
   is deleted, then it won't be recreated.