system-config/modules/openstack_project/manifests/wheel_mirror.pp
Michael Krotscheck 787b408d84 Add wheel mirror to mirrors
This patch adds a new "wheel" directory to the pypi mirrors,
as an rsync target for our built wheel packages.

A rewrite rule has been added in anticipation of serving
the wheels from an AFS drive. Since AFS has a practical
folder size limit, we are using /a/a /s/sp/split /s/st/style
directory structure that should be AFS-tolerant. The rewrite
rule creates the necessary mappings that make the packages
available to pip.

Example: HTTP GET /Babel/ -> /B/Ba/Babel/

Furthermore, a cron job has been added to periodically generate
a human-readable index of these mappings, in accordance with
PEP503. While frequently regenerated, this index should only
change meaningfully if a new package is added to the wheel, as
it only represents the package names themselves, rather than
the available versions of said package.

Change-Id: I743fc3ec629eea225c981d6e870751f33e77d7c6
2016-01-15 08:07:53 -08:00

44 lines
1.1 KiB
Puppet

# == Class: openstack_project::wheel_mirror
#
class openstack_project::wheel_mirror (
$data_directory = '/srv/static/wheel',
$config_directory = '/etc/wheel_mirror'
) {
# The wheel mirror is a directory of python wheels, which have been rsynced'
# from the wheel build slaves.
file { "${data_directory}":
ensure => directory,
owner => 'root',
group => 'root',
}
file { "${config_directory}":
ensure => directory,
owner => 'root',
group => 'root',
}
file { "${config_directory}/rebuild_wheel_afs_index.sh":
ensure => present,
owner => 'root',
group => 'root',
mode => '0755',
source => "puppet:///modules/openstack_project/mirror/rebuild_wheel_afs_index.sh",
require => [
File["${config_directory}"],
]
}
# */15 * * * *
cron { 'rebuild wheel afs index':
name => 'rebuild-wheel-afs-index.cron',
command => "/bin/bash ${config_directory}/rebuild_wheel_afs_index.sh ${data_directory}",
user => root,
minute => '*/15',
require => [
File["${config_directory}/rebuild_wheel_afs_index.sh"],
]
}
}