NAME
PkgForge::Handler::Incoming - Package Forge handler for the incoming directory
VERSION
This documentation refers to PkgForge::Handler::Incoming version 1.1.10
SYNOPSIS
use PkgForge::Handler::Incoming;
my $handler = PkgForge::Handler::Incoming->new();
# or
my $handler = PkgForge::Handler::Incoming->new_with_options();
# or
my $handler = PkgForge::Handler::Incoming->new_with_config();
$handler->execute();
DESCRIPTION
This Package Forge handler handles the incoming jobs queue. The incoming queue is represented with a PkgForge::Queue and is processed in order of submission time. Any entry which does not look like a job will be erased immediately. Anything else will be loaded as a PkgForge::Job object and validated. If the job is valid the handler will move the job to the accepted queue and register the job for the relevant build daemons.
ATTRIBUTES
See PkgForge::Handler for all the attributes inherited by application of that role. This class also adds the following attributes:
- wait_for_job
-
The time (in seconds) to wait for a job to be considered fully submitted, the default is 5 minutes. Submitted jobs are considered for acceptance on every pass of the incoming queue made by this handler. If the job appears to be incomplete for any reason this is the length of time the handler will wait for further data to appear. After this time has passed any incomplete job may be erased.
SUBROUTINES/METHODS
See PkgForge::Handler for all methods inherited from that class. This class implements the required execute
method.
- execute()
- preflight()
-
Runs through a set of pre-flight checks which must be correct before running the
execute
method. This is separated out so that it can be called after the handler object is created but before the execution is begun. This is particularly useful for when running as a daemon. - load_queue()
-
This method scans the incoming build job directory and loads anything found into a PkgForge::Queue object. If it is not possible to scan the directory then this method will die since such a failure renders this handler useless. It will remove anything which does not appear to be a valid build job entry. The queue object will be returned.
- load_job($qentry)
-
This method takes a PkgForge::Queue::Entry object and attempts to convert it into a full PkgForge::Job object. If successfully loaded the job will be registered in the Package Forge registry with a status of
incoming
. If the loading fails then a period of grace is given in case the files associated with the job are still in transit. If the failure continues to occur after the end of the grace period then the submitted job will be deleted. On success the PkgForge::Job object will be returned, on failure (either temporary or permanent) the undef value be returned. - validate_job($job)
-
This method takes a PkgForge::Job object and carries out validation. Mostly this validation it to ensure that the submitted job has not been corrupted during the submission process. If successful the job will be marked in the Package Forge registry as
valid
. If the job is found to be invalid then, in a similar way to theload_job
method, a grace period is permitted. If the validation failure continues to occur after the end of the grace period then the submitted job will be deleted and marked in the registry asinvalid
. On success a true value will be returned, otherwise it will return a false value.Please note that this method does not do any authorization checks.
- transfer_job($job)
-
This method takes a PkgForge::Job object and attempts to transfer the job to the
accepted
directory. If successful then the job will be marked asaccepted
in the Package Forge registry and a new PkgForge::Object will be returned which represents the accepted job. If the transfer fails then the submitted job will be deleted and it will be marked in the registry asfailed
, the method will then return undef. - register_tasks($job)
-
A convenience wrapper for the method of the same name provided by PkgForge::Registry. Will log errors, returns false on failure and true on success.
- remove_from_incoming($object)
-
This method will take either a PkgForge::Queue::Entry or a PkgForge::Job object. It erases the entire directory holding all files associated with the job, it also kills the object as it no longer has any physical meaning. In each case, the
scrub
method is called, see the specific documentation for further details. - update_job_status( $job, $status_name )
-
A convenience wrapper for the method of the same name provided by PkgForge::Registry. Will log errors, returns false on failure and true on success.
CONFIGURATION AND ENVIRONMENT
By default Package Forge handlers can be configured via the /etc/pkgforge/handlers.yml
YAML file. This class will also examine the file /etc/pkgforge/incoming.yml
, if it exists, and settings in that file will have precedence. You can override the path to the configuration file via the configfile
attribute.
By default, the logging system can be configured via /etc/pkgforge/incoming.log
. If the file does not exist then the handler will log to stderr.
DEPENDENCIES
This module is powered by Moose and also uses MooseX::Types, Readonly.
SEE ALSO
PkgForge, PkgForge::Handler, PkgForge::Job, PkgForge::Queue, PkgForge::Queue::Entry
PLATFORMS
This is the list of platforms on which we have tested this software. We expect this software to work on any Unix-like platform which is supported by Perl.
ScientificLinux5, Fedora13
BUGS AND LIMITATIONS
Please report any bugs or problems (or praise!) to bugs@lcfg.org, feedback and patches are also always very welcome.
AUTHOR
Stephen Quinney <squinney@inf.ed.ac.uk>
LICENSE AND COPYRIGHT
Copyright (C) 201O University of Edinburgh. All rights reserved.
This library is free software; you can redistribute it and/or modify it under the terms of the GPL, version 2 or later.