Message-ID: <358070189.9153.1711723992009.JavaMail.confluence@host3.pipelinefx.com> Subject: Exported From Confluence MIME-Version: 1.0 Content-Type: multipart/related; boundary="----=_Part_9152_1921985309.1711723992008" ------=_Part_9152_1921985309.1711723992008 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Content-Location: file:///C:/exported.html flightChecks

flightChecks

Overview

Flight checks, AKA preflights and postflights, new in Qube 6.6, are prog= rams and/or scripts that are run on the worker just before and after t= he actual job or agenda starts.

The exit codes of flight checks determine the processing and exit status= of their respective job instances or agendas.  

System-wide vs Job-specif= ic

System-wide flight checks are installed by the site administrator into&n= bsp;predefined locations on the worker systems, and are run for every job. = By default, system-wide flight checks are installed in one of four sub= directories under $QBDIR/flightCheck on the= worker. More precisely:

where $QBDIR is the system's Qube install loc= ation, which is, by default, "/usr/local/pfx/qube" on Linux,= "/Applications/pfx/qube" on Mac OS X, and "C:\Program = Files\Pfx\Qube" on Windows.

The worker parameter worker_flight_check_path may be set in qb.co= nf (or qbwrk.conf), to override the default "$QBDIR/flightCheck&q= uot;

Any file with a ".txt" extension in those subdirectories are i= gnored, but every other file will be attempted to run at their respect= ive timings. It is expected that those files are all proper ex= ecutables for the platforms on which they are intended to run= -- otherwise, they will fail and thus jobs will fail.

Individual Jobs may also specify their own flight checks at submission. = For example, the "qbsub= " command now supports options such as "-preflights", "= -postflights", "-agenda_postflights" and &= quot;-agenda_postflights" that may be used to specify a comma-= separated list of full-paths to flight c= heck executables on a per-submission basis. See the "qbsub" documentation for = details. The Qube API's job submit routine also may be used to= specify flight checks when submitting jobs. These API jo= b attribute names are "preflights" and "postflights" fo= r instance-level, and "agenda_preflights" and "agenda_postfl= ights" for agenda-level flight checks.

As with the system-wide flight checks (see: Universal Callbacks), these job-specific ones al= so need to be proper executables for the target platform.

Multiple flight checks may be installed or specified for a single j= ob. Job-specific flight checks are run before the system-wide ones. No= te that if any flight check program fails (i.e., returns non-zero), all sub= sequent flight checks for that job instance or agenda are not run.

The postflight checks are still run if an instance or agenda-item fails.=

Instance-level vs Agenda-level flight checks and the effe= ct of their exit codes

Instance-level preflights and postflights are run on the worker just bef= ore and after job instances are processed, respectively. Similarly, agenda-= level preflights and postflights are run just before and after agendas are = processed, respectively.

A non-zero exit code returned from a flight check will abort the process= ing of any additional flight checks for the respective job instance or agen= da, and also affect their exit status. More specifically:

Qube-specific environment variables set in the flightCheck en= vironments

Variables in both instance-level and agenda-level flightChecks:

Addi= tional variables in agenda-level flightChecks:

Addtional vari= ables in postFlight checks

In postflight scripts, access the status of the last-processed = ;frame or instance via the QB_FRAME_STATUS and&n= bsp;QB_INSTANCE_STATUS environment variables, respect= ively. These will be set to strings such as "complete" and "= failed".

 

Universal Callbac= ks vs. FlightChecks

At first glance, Universal Callbacks and the&= nbsp;Job Pre- and Post-FlightChecks appear similar, but they h= ave an important difference:

Tips 

When writing postflight scripts for cmdline and cmdrange jobs, you can query the environment variable QB_SYSTEM_EXIT_CODE to find out the numerical exit code of = the last command that was run.

 

------=_Part_9152_1921985309.1711723992008--