diff -Nru oar-2.5.8~rc8/CHANGELOG oar-2.5.8/CHANGELOG --- oar-2.5.8~rc8/CHANGELOG 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/CHANGELOG 2019-01-04 18:17:09.000000000 +0000 @@ -30,6 +30,7 @@ - [drawgantt-svg] improve the label_display_regex text replacement mechanism - [drawgantt-svg/oarstat] fix past and current moldable jobs display - [drawgantt-svg] fix drain display + - [drawgantt-svg] fix nav_filter with only one option - [oar.conf] update SSH options to the one of OpenSSH 7.6p1 - [oar-database] support --db-is-local (UNIX socket) for MySQL (MariaDB) - [oar-node] fix warnings with OAR's sshd configuration diff -Nru oar-2.5.8~rc8/debian/changelog oar-2.5.8/debian/changelog --- oar-2.5.8~rc8/debian/changelog 2018-12-13 21:17:30.000000000 +0000 +++ oar-2.5.8/debian/changelog 2019-01-04 20:06:58.000000000 +0000 @@ -1,3 +1,14 @@ +oar (2.5.8-1) unstable; urgency=medium + + [ Pierre Neyron ] + * New upstream release + * Remove patches as they were applied upstream + [ Vincent Danjean ] + * Switch to dh 12 + * Bump Standards-Version (no change needed) + + -- Vincent Danjean Fri, 04 Jan 2019 21:06:58 +0100 + oar (2.5.8~rc8-3) unstable; urgency=medium * Really fix Makefile for parallel builds (Closes: #916304) diff -Nru oar-2.5.8~rc8/debian/control oar-2.5.8/debian/control --- oar-2.5.8~rc8/debian/control 2018-12-13 21:17:30.000000000 +0000 +++ oar-2.5.8/debian/control 2019-01-04 20:06:58.000000000 +0000 @@ -3,11 +3,11 @@ Uploaders: Vincent Danjean Section: utils Priority: optional -Build-Depends: debhelper-compat (= 11), +Build-Depends: debhelper-compat (= 12), po-debconf, perl, python3-sphinx -Standards-Version: 4.2.1 +Standards-Version: 4.3.0 Vcs-Git: https://github.com/oar-team/oar.git/ -b debian.org Vcs-Browser: https://github.com/oar-team/oar Homepage: http://oar.imag.fr/ @@ -15,6 +15,7 @@ Package: liboar-perl Architecture: any Section: perl +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -31,6 +32,7 @@ Package: oar-common Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -49,6 +51,7 @@ Package: oar-server Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -77,6 +80,7 @@ Package: oar-server-mysql Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -93,6 +97,7 @@ Package: oar-server-pgsql Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -109,6 +114,7 @@ Package: oar-node Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, openssh-client, @@ -125,6 +131,7 @@ Package: oar-user Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -146,6 +153,7 @@ Package: oar-user-mysql Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -160,6 +168,7 @@ Package: oar-user-pgsql Architecture: any +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, @@ -175,6 +184,7 @@ Package: oar-web-status Architecture: all Section: web +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, apache2 | httpd-cgi, @@ -197,6 +207,7 @@ Package: oar-doc Architecture: all Section: doc +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, libjs-jquery, libjs-underscore @@ -209,6 +220,7 @@ Package: oar-restful-api Architecture: any Section: net +Pre-Depends: ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends}, ${perl:Depends}, diff -Nru oar-2.5.8~rc8/debian/patches/fix-build.patch oar-2.5.8/debian/patches/fix-build.patch --- oar-2.5.8~rc8/debian/patches/fix-build.patch 2018-12-13 21:17:30.000000000 +0000 +++ oar-2.5.8/debian/patches/fix-build.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,39 +0,0 @@ -Add missing dependency in Makefile ---- a/Makefiles/shared/shared.mk -+++ b/Makefiles/shared/shared.mk -@@ -47,8 +47,9 @@ - - - clean_shared: clean_templates clean_man1 clean_setup_scripts -+ $(RM) -f setup/templates/header-*.sh.in -+ $(RM) -f setup/templates/header-*.sh - build_shared: build_templates build_man1 build_setup_scripts -- rm -f setup/templates/header.sh - - install_shared: $(patsubst %, install_%,$(SHARED_ACTIONS)) install_setup_scripts - setup_shared: run_setup_scripts -@@ -79,10 +80,12 @@ - $(CGIDIR_FILES) \ - $(WWWDIR_FILES) \ - $(MODULE_SETUP_SOURCE_FILES) \ -- setup/templates/header.sh.in \ -+ setup/templates/header-$(MODULE).sh.in \ - ) - TEMPLATE_BUILDED_FILES=$(patsubst %.in,%,$(TEMPLATE_SOURCE_FILES)) - -+setup/templates/header-$(MODULE).sh.in: setup/templates/header.sh.in -+ cp $^ $@ - - build_templates: $(TEMPLATE_BUILDED_FILES) - -@@ -140,8 +143,8 @@ - - build_setup_scripts: $(MODULE_SETUP_BUILDED_FILES) - --$(MODULE_SETUP_BUILDED_FILES): $(MODULE_SETUP_TOBUILD_FILES) -- cat setup/templates/header.sh $< > $@ -+$(MODULE_SETUP_BUILDED_FILES): $(MODULE_SETUP_TOBUILD_FILES) setup/templates/header-$(MODULE).sh -+ cat setup/templates/header-$(MODULE).sh $< > $@ - - clean_setup_scripts: - -rm -f $(MODULE_SETUP_BUILDED_FILES) diff -Nru oar-2.5.8~rc8/debian/patches/fix-perms.patch oar-2.5.8/debian/patches/fix-perms.patch --- oar-2.5.8~rc8/debian/patches/fix-perms.patch 2018-12-13 21:17:30.000000000 +0000 +++ oar-2.5.8/debian/patches/fix-perms.patch 1970-01-01 00:00:00.000000000 +0000 @@ -1,23 +0,0 @@ -Bash snipsets to be sourced are not binaries -diff --git a/Makefiles/shared/shared.mk b/Makefiles/shared/shared.mk -index 7a484262..2fbb0755 100644 ---- a/Makefiles/shared/shared.mk -+++ b/Makefiles/shared/shared.mk -@@ -151,7 +151,7 @@ uninstall_setup_scripts: - - $(MODULE_SETUP_TARGET_FILES): $(MODULE_SETUP_BUILDED_FILES) - install -d $(DESTDIR)$(OARDIR)/setup -- install -m 0755 $< $@ -+ install -m 0644 $< $@ - - # - # OAR_PERLLIB -diff --git a/setup/templates/header.sh.in b/setup/templates/header.sh.in -index 9f08dec3..584b0e7e 100644 ---- a/setup/templates/header.sh.in -+++ b/setup/templates/header.sh.in -@@ -1,4 +1,3 @@ --#! /bin/sh - - set -e - diff -Nru oar-2.5.8~rc8/debian/patches/series oar-2.5.8/debian/patches/series --- oar-2.5.8~rc8/debian/patches/series 2018-12-13 21:17:30.000000000 +0000 +++ oar-2.5.8/debian/patches/series 2019-01-04 20:06:58.000000000 +0000 @@ -1,2 +0,0 @@ -fix-build.patch -fix-perms.patch diff -Nru oar-2.5.8~rc8/Makefiles/shared/shared.mk oar-2.5.8/Makefiles/shared/shared.mk --- oar-2.5.8~rc8/Makefiles/shared/shared.mk 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/Makefiles/shared/shared.mk 2019-01-04 18:17:09.000000000 +0000 @@ -47,8 +47,9 @@ clean_shared: clean_templates clean_man1 clean_setup_scripts + $(RM) -f setup/templates/header-*.sh.in + $(RM) -f setup/templates/header-*.sh build_shared: build_templates build_man1 build_setup_scripts - rm -f setup/templates/header.sh install_shared: $(patsubst %, install_%,$(SHARED_ACTIONS)) install_setup_scripts setup_shared: run_setup_scripts @@ -79,10 +80,12 @@ $(CGIDIR_FILES) \ $(WWWDIR_FILES) \ $(MODULE_SETUP_SOURCE_FILES) \ - setup/templates/header.sh.in \ + setup/templates/header-$(MODULE).sh.in \ ) TEMPLATE_BUILDED_FILES=$(patsubst %.in,%,$(TEMPLATE_SOURCE_FILES)) +setup/templates/header-$(MODULE).sh.in: setup/templates/header.sh.in + cp $^ $@ build_templates: $(TEMPLATE_BUILDED_FILES) @@ -140,8 +143,8 @@ build_setup_scripts: $(MODULE_SETUP_BUILDED_FILES) -$(MODULE_SETUP_BUILDED_FILES): $(MODULE_SETUP_TOBUILD_FILES) - cat setup/templates/header.sh $< > $@ +$(MODULE_SETUP_BUILDED_FILES): $(MODULE_SETUP_TOBUILD_FILES) setup/templates/header-$(MODULE).sh + cat setup/templates/header-$(MODULE).sh $< > $@ clean_setup_scripts: -rm -f $(MODULE_SETUP_BUILDED_FILES) @@ -151,7 +154,7 @@ $(MODULE_SETUP_TARGET_FILES): $(MODULE_SETUP_BUILDED_FILES) install -d $(DESTDIR)$(OARDIR)/setup - install -m 0755 $< $@ + install -m 0644 $< $@ # # OAR_PERLLIB diff -Nru oar-2.5.8~rc8/setup/templates/header.sh.in oar-2.5.8/setup/templates/header.sh.in --- oar-2.5.8~rc8/setup/templates/header.sh.in 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/setup/templates/header.sh.in 2019-01-04 18:17:09.000000000 +0000 @@ -1,4 +1,3 @@ -#! /bin/sh set -e diff -Nru oar-2.5.8~rc8/sources/core/common-libs/lib/OAR/IO.pm oar-2.5.8/sources/core/common-libs/lib/OAR/IO.pm --- oar-2.5.8~rc8/sources/core/common-libs/lib/OAR/IO.pm 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/sources/core/common-libs/lib/OAR/IO.pm 2019-01-04 18:17:09.000000000 +0000 @@ -5821,7 +5821,10 @@ $state = "STOP" if ($state ne "START"); + my $log_scheduluer_priority_changes = (is_conf("LOG_SCHEDULER_PRIORITY_CHANGES") and lc(get_conf("LOG_SCHEDULER_PRIORITY_CHANGES")) eq "yes")?1:0; + if (is_conf("SCHEDULER_PRIORITY_HIERARCHY_ORDER")){ + my $date = get_date($dbh); my $types = OAR::IO::get_job_types_hash($dbh,$job_id); if (((defined($types->{besteffort})) or (defined($types->{timesharing}))) and (($state eq "START" and (is_an_event_exists($dbh,$job_id,"SCHEDULER_PRIORITY_UPDATED_START") <= 0)) @@ -5857,7 +5860,15 @@ WHERE $f IN (".$value_str.") "; - $dbh->do($req); + $dbh->do($req); + if ($log_scheduluer_priority_changes) { + $dbh->do("INSERT INTO resource_logs (resource_id,attribute,value,date_start,finaud_decision) + SELECT resources.resource_id,\'scheduler_priority\',CONCAT(resources.scheduler_priority,\' ($value*$index*$coeff\@job $job_id/$f)\'),\'$date\',\'NO\' + FROM resources + WHERE + $f IN (".$value_str.") + "); + } } add_new_event($dbh,"SCHEDULER_PRIORITY_UPDATED_$state",$job_id,"Scheduler priority for job $job_id updated (".get_conf("SCHEDULER_PRIORITY_HIERARCHY_ORDER").")"); } diff -Nru oar-2.5.8~rc8/sources/core/common-libs/lib/OAR/Version.pm oar-2.5.8/sources/core/common-libs/lib/OAR/Version.pm --- oar-2.5.8~rc8/sources/core/common-libs/lib/OAR/Version.pm 2018-10-01 19:04:51.000000000 +0000 +++ oar-2.5.8/sources/core/common-libs/lib/OAR/Version.pm 2019-01-04 18:20:53.000000000 +0000 @@ -1,7 +1,7 @@ package OAR::Version; require Exporter; -my $OARVersion = "2.5.8+rc8"; +my $OARVersion = "2.5.8"; my $OARName = "Canicule"; sub get_version(){ diff -Nru oar-2.5.8~rc8/sources/core/tools/oar.conf.in oar-2.5.8/sources/core/tools/oar.conf.in --- oar-2.5.8~rc8/sources/core/tools/oar.conf.in 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/sources/core/tools/oar.conf.in 2019-01-04 18:17:09.000000000 +0000 @@ -255,6 +255,11 @@ # "scheduler_priority" depends of the position of the field name. SCHEDULER_PRIORITY_HIERARCHY_ORDER="network_address/resource_id" +# Log scheduler priority changes to the resource_logs table +# Useful for debug only, Can be displayed with drawgantt-svg with +# "scheduler_priority" set a query argument) +# LOG_SCHEDULER_PRIORITY_CHANGES="no" + # You can specify a type of resources that will be always assigned for each job # (for exemple: enable all jobs to be able to log on the cluster frontales) # For more information, see the FAQ diff -Nru oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config.inc.php oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config.inc.php --- oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config.inc.php 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config.inc.php 2019-01-04 18:17:09.000000000 +0000 @@ -11,14 +11,14 @@ // Configuration //////////////////////////////////////////////////////////////////////////////// -// Default settings for the default view +// Default settings for the default view $CONF['default_start'] = ""; // default start and stop times (ctime values) ; unless you want to always show a -$CONF['default_stop'] = ""; // same time frame, keep those values to "" +$CONF['default_stop'] = ""; // same time frame, keep those values to "" $CONF['default_relative_start'] = ""; // default relative start and stop times ([+-]), mind setting it $CONF['default_relative_stop'] = ""; // accordingly to the nav_forecast values below, eg -24*3600*0.1 and 24*3600*0.9 $CONF['default_timespan'] = 6*3600; // default timespan, should be one of the nav_timespans below $CONF['default_resource_base'] = 'cpuset'; // default base resource, should be one of the nav_resource_bases below -$CONF['default_scale'] = 10; // default vertical scale of the grid, should be one of the nav_scales bellow +$CONF['default_scale'] = 10; // default vertical scale of the grid, should be one of the nav_scales below // Navigation bar configuration $CONF['nav_timespans'] = array( // proposed timespan in the "set" bar @@ -78,7 +78,7 @@ $CONF['db_type']="pg"; // choices: mysql for Mysql or pg for PostgreSQL $CONF['db_server']="127.0.0.1"; $CONF['db_port']="5432"; // usually 3306 for Mysql or 5432 for PostgreSQL -$CONF['db_name']="oar"; // OAR read only user account +$CONF['db_name']="oar"; // OAR read only user account $CONF['db_user']="oar_ro"; $CONF['db_passwd']="oar_ro"; $CONF['db_max_job_rows']=20000; // max number of job rows retrieved from database, which can be handled. @@ -86,31 +86,36 @@ // Data display configuration $CONF['timezone'] = "UTC"; $CONF['site'] = "My OAR resources"; // name for your infrastructure or site -$CONF['resource_labels'] = array('network_address','cpuset'); // properties to describe resources (labels on the left). Must also be part of resource_hierarchy below +$CONF['resource_labels'] = array('network_address','cpuset'); // properties to describe resources (labels on the left). Must also be part of resource_hierarchy below $CONF['cpuset_label_display_string'] = "%02d"; $CONF['label_display_regex'] = array( // shortening regex for labels (e.g. to shorten node-1.mycluster to node-1). label will be replaced with the 1st selection of the regex, unless an array is used with the replacement string as the second argument. 'network_address' => '/^([^.]+)\..*$/', - ); + 'type' => array('/^default$/','proc'), +); +$CONF['label_display_functions'] = array( // custom functions to format labels for display. The function takes the resource object as argument. This object returns the value for each property of the resource in $obj->data[property] +); $CONF['label_cmp_regex'] = array( // substring selection regex for comparing and sorting labels (resources) 'network_address' => '/^([^-]+)-(\d+)\..*$/', - ); +); +$CONF['label_cmp_functions'] = array( // custom functions to format labels for comparison. The function takes the resource object as argument. This object returns the value for each property of the resource in $obj->data[property]. +); $CONF['resource_properties'] = array( // properties to display in the pop-up on top of the resources labels (on the left) 'deploy', 'cpuset', 'besteffort', 'network_address', 'type', 'drain'); $CONF['resource_hierarchy'] = array( // properties to use to build the resource hierarchy drawing 'network_address','cpuset', - ); +); $CONF['resource_base'] = "cpuset"; // base resource of the hierarchy/grid $CONF['resource_group_level'] = "network_address"; // level of resources to separate with blue lines in the grid $CONF['resource_drain_property'] = "drain"; // if set, must also be one of the resource_properties above to activate the functionnality $CONF['state_colors'] = array( // colors for the states of the resources in the gantt 'Absent' => 'url(#absentPattern)', 'Suspected' => 'url(#suspectedPattern)', 'Dead' => 'url(#deadPattern)', 'Standby' => 'url(#standbyPattern)', 'Drain' => 'url(#drainPattern)'); $CONF['job_colors'] = array( // colors for the types of the jobs in the gantt - 'besteffort' => 'url(#besteffortPattern)', - 'deploy(=\w)?' => 'url(#deployPattern)', - 'container(=\w+)?' => 'url(#containerPattern)', - 'timesharing=(\*|user),(\*|name)' => 'url(#timesharingPattern)', + 'besteffort' => 'url(#besteffortPattern)', + 'deploy(=\w)?' => 'url(#deployPattern)', + 'container(=\w+)?' => 'url(#containerPattern)', + 'timesharing=(\*|user),(\*|name)' => 'url(#timesharingPattern)', 'placeholder=\w+' => 'url(#placeholderPattern)', - ); +); $CONF['job_click_url'] = ''; // set a URL to open when a job is double-clicked, %%JOBID%% is to be replaced by the jobid in the URL $CONF['resource_click_url'] = ''; // set a URL to open when a resource is double-clicked, %%TYPE%% is to be replaced by the resource type and %%ID%% by the resource id in the URL @@ -139,41 +144,41 @@ - + - + - + - + - + C - + B - + P - + D - + T - + EOT; // Standby state display options for the part shown in the future @@ -196,8 +201,8 @@ // return (int)(360 * fmod($job->job_id * $magic_number, 1)); // } // // Other example: get the color's hue value as a function of the job_user value -// protected $cache = array(); -// function job2int($job) { +// protected $cache = array(); +// function job2int($job) { // // shuffled number based on the job_user: // if (! array_key_exists($job->job_user, $this->cache)) { // $n = (int) base_convert(substr(md5($job->job_user) ,0, 5), 16, 10); diff -Nru oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config-subnets.inc.php oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config-subnets.inc.php --- oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config-subnets.inc.php 1970-01-01 00:00:00.000000000 +0000 +++ oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt-config-subnets.inc.php 2019-01-04 18:17:09.000000000 +0000 @@ -0,0 +1,270 @@ + + * + */ + +// OAR Drawgantt SVG configuration file + +//////////////////////////////////////////////////////////////////////////////// +// Configuration +//////////////////////////////////////////////////////////////////////////////// + +// Default settings for the default view +$CONF['default_start'] = ""; // default start and stop times (ctime values) ; unless you want to always show a +$CONF['default_stop'] = ""; // same time frame, keep those values to "" +$CONF['default_relative_start'] = ""; // default relative start and stop times ([+-]), mind setting it +$CONF['default_relative_stop'] = ""; // accordingly to the nav_forecast values below, eg -24*3600*0.1 and 24*3600*0.9 +$CONF['default_timespan'] = 6*3600; // default timespan, should be one of the nav_timespans below +$CONF['default_resource_base'] = 'slash_22'; // default base resource, should be one of the nav_resource_bases below +$CONF['default_scale'] = 10; // default vertical scale of the grid, should be one of the nav_scales bellow + +// Navigation bar configuration +$CONF['nav_timespans'] = array( // proposed timespan in the "set" bar + '1 hour' => 3600, + '3 hours' => 3*3600, + '6 hours' => 6*3600, + '12 hours' => 12*3600, + '1 day' => 24*3600, + '3 day' => 3*24*3600, + '1 week' => 7*24*3600, +); + +$CONF['nav_forecast'] = array( // forecast display + '1 day' => 24*3600, + '3 days' => 3*24*3600, + '1 week' => 7*24*3600, + '2 weeks' => 2*7*24*3600, + '3 weeks' => 3*7*24*3600, +); + +$CONF['nav_forecast_past_part'] = 0.1; // past part to show (percentage if < 1, otherwise: number of seconds) + +$CONF['nav_scales'] = array( // proposed scales for resources + 'small' => 10, + 'big' => 20, + 'huge' => 40, +); + +$CONF['nav_timeshifts'] = array( // proposed time-shifting buttons + '1h' => 3600, + '6h' => 6*3600, + '1d' => 24*3600, + '1w' => 7*24*3600, +); + +$CONF['nav_filters'] = array( + 'subnet' => "type='subnet'", +); + +$CONF['nav_resource_bases'] = array( // proposed base resources + 'slash_16', + 'slash_17', + 'slash_18', + 'slash_19', + 'slash_20', + 'slash_21', + 'slash_22', +); + +$CONF['nav_timezones'] = array( // proposed timezones in the "misc" bar (the first one will be selected by default) + 'UTC', + 'Europe/Paris', +); + +$CONF['nav_custom_buttons'] = array( // custom buttons, click opens the url in a new window + 'my label' => 'http://my.url' // remove all lines to disable (empty array) +); + +// Database access configuration +$CONF['db_type']="pg"; // choices: mysql for Mysql or pg for PostgreSQL +$CONF['db_server']="oardb.luxembourg.grid5000.fr"; +$CONF['db_port']="5432"; // usually 3306 for Mysql or 5432 for PostgreSQL +$CONF['db_name']="oar2"; // OAR read only user account +$CONF['db_user']="oarreader"; +$CONF['db_passwd']="read"; +$CONF['db_max_job_rows']=70000; // max number of job rows retrieved from database, which can be handled. + +// Data display configuration +$CONF['timezone'] = "Europe/Paris"; +$CONF['site'] = "Nancy"; // name for your infrastructure or site +$CONF['resource_labels'] = array( // properties to describe resources (labels on the left). Must also be part of resource_hierarchy below. If empty, the base_resource will be used as label. +); +$CONF['cpuset_label_display_string'] = "%02d"; +$CONF['label_display_regex'] = array( // shortening regex for labels (e.g. to shorten node-1.mycluster to node-1 +); +$CONF['label_display_functions'] = array( // functions that compute labels (e.g. to shorten node-1.mycluster to node-1 + 'slash_16' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_17' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_18' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_19' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_20' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_21' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, + 'slash_22' => function($obj) { + return (long2ip(ip2long($obj->data["subnet_address"]) & (pow(2,32) - pow(2,32-substr($obj->type,6)))))."/". substr($obj->type,6); + }, +); +$CONF['label_cmp_regex'] = array( // substring selection regex for comparing and sorting labels (resources) +); + +$CONF['label_cmp_functions'] = array( // functions for comparing and sorting labels (resources) + 'slash_16' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_17' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_18' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_19' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_20' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_21' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, + 'slash_22' => function($obj) { + return ip2long($obj->data['subnet_address']); + }, +); + +$CONF['resource_properties'] = array( // properties to display in the pop-up on top of the resources labels (on the left) + 'subnet_address', 'subnet_prefix', +); + +$CONF['resource_hierarchy'] = array( // properties to use to build the resource hierarchy drawing + 'slash_16', 'slash_17', 'slash_18', 'slash_19', 'slash_20', 'slash_21', 'slash_22', +); +$CONF['resource_base'] = "slash_22"; // base resource of the hierarchy/grid +$CONF['resource_group_level'] = "slash_16"; // level of resources to separate with blue lines in the grid +$CONF['resource_drain_property'] = "drain"; // if set, must also be one of the resource_properties above to activate the functionnality +$CONF['state_colors'] = array( // colors for the states of the resources in the gantt + 'Absent' => 'url(#absentPattern)', 'Suspected' => 'url(#suspectedPattern)', 'Dead' => 'url(#deadPattern)', 'Standby' => 'url(#standbyPattern)', 'Drain' => 'url(#drainPattern)'); +$CONF['job_colors'] = array( // colors for the types of the jobs in the gantt + 'besteffort' => 'url(#besteffortPattern)', + 'deploy(=\w)?' => 'url(#deployPattern)', + 'container(=\w+)?' => 'url(#containerPattern)', + 'timesharing=(\*|user),(\*|name)' => 'url(#timesharingPattern)', + 'placeholder=\w+' => 'url(#placeholderPattern)', + ); +$CONF['job_click_url'] = ''; // set a URL to open when a job is double-clicked, %%JOBID%% is to be replaced by the jobid in the URL +$CONF['resource_click_url'] = ''; // set a URL to open when a resource is double-clicked, %%TYPE%% is to be replaced by the resource type and %%ID%% by the resource id in the URL + +// Geometry customization +$CONF['hierarchy_resource_width'] = 10; // default: 10 +$CONF['scale'] = 10; // default: 10 +$CONF['text_scale'] = 10; // default: 10 +$CONF['time_ruler_scale'] = 6; // default: 6 +$CONF['time_ruler_steps'] = array(60,120,180,300,600,1200,1800,3600,7200,10800,21600,28800,43200,86400,172800,259200,604800); +$CONF['gantt_top'] = 50; // default: 50 +$CONF['bottom_margin'] = 45; // default: 45 +$CONF['right_margin'] = 30; // default 30 +$CONF['label_right_align'] = 105; // default: 105 +$CONF['hierarchy_left_align'] = 110; // default: 110 +$CONF['gantt_left_align'] = 160; // default: 160 +$CONF['gantt_min_width'] = 900; // default: 900 +$CONF['gantt_min_height'] = 100; // default: 100 +$CONF['gantt_min_job_width_for_label'] = 40; // default: 40 +$CONF['min_state_duration'] = 2; // default: 2 + +// Colors and fill patterns for jobs and states +$CONF['job_color_saturation_lightness'] = "75%,75%"; // default: "75%,75%" +$CONF['job_color_saturation_lightness_highlight'] = "50%,50%"; // default: "50%,50%" +$CONF['static_patterns'] = << + + + + + + + + + + + + + + + + + + + + + + + + +C + + +B + + +P + + +D + + +T + +EOT; + +// Standby state display options for the part shown in the future +$CONF['standby_truncate_state_to_now'] = 1; // default: 1 +// Besteffort job display options for the part shown in the future +$CONF['besteffort_truncate_job_to_now'] = 1; // default: 1 +$CONF['besteffort_pattern'] = << + +' +EOT; + +// Advanced customization for the computation of the colors of the jobs +// Uncomment and adapt the following to override the default function +//class MyShuffle extends Shuffle { +// // Default function: get the color's hue value as a function of the job_id +// function job2int($job) { +// // compute a suffled number for job_id, so that colors are not too close +// $magic_number = (1+sqrt(5))/2; +// return (int)(360 * fmod($job->job_id * $magic_number, 1)); +// } +// // Other example: get the color's hue value as a function of the job_user value +// protected $cache = array(); +// function job2int($job) { +// // shuffled number based on the job_user: +// if (! array_key_exists($job->job_user, $this->cache)) { +// $n = (int) base_convert(substr(md5($job->job_user) ,0, 5), 16, 10); +// $magic_number = (1+sqrt(5))/2; +// $this->cache[$job->job_user] = (int)(360 * fmod($n * $magic_number, 1)); +// } +// return $this->cache[$job->job_user]; +// } +//} +//Shuffle::init(new MyShuffle()); // this line must be uncommented for the overiding to take effect + +// Minimum timespan the gantt can handle +$CONF['min_timespan']= 480; // gantt does not show if (stop date - start date) < 8 minutes + +// Debugging +$CONF['debug'] = 5; // Set to > 0 to enable debug prints in the web server error logs + +?> diff -Nru oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt.php.in oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt.php.in --- oar-2.5.8~rc8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt.php.in 2018-10-01 18:42:04.000000000 +0000 +++ oar-2.5.8/sources/visualization_interfaces/DrawGantt-SVG/drawgantt.php.in 2019-01-04 18:17:09.000000000 +0000 @@ -5,15 +5,26 @@ * */ -//////////////////////////////////////////////////////////////////////////////////////////////////// -// Configuration: DO NOT EDIT HERE. Customization must go in /etc/oar/drawgantt-config.inc.php -//////////////////////////////////////////////////////////////////////////////////////////////////// +//////////////////////////////////////////////////////////////////////////////// +// DO NOT EDIT CONFIGURATION HERE +// Customization must go either in: +// - %%OARCONFDIR%%/drawgantt-config.inc.php +// or in: +// - %%OARCONFDIR%%/drawgantt-config-SUFFIX.inc.php with SUFFIX being either: +// - set in a "config=SUFFIX" query param. SUFFIX must be made of alphanumeric +// or _ characters only +// or +// - guessed from the script path (latest word in the dirpath). The directory +// name must use alphanumeric or _ characters only, and the resulting +// configuration file must exist. +// (mostly useful for a multi-drawgantt setup) +//////////////////////////////////////////////////////////////////////////////// $CONF=array(); -// Default settings for the default view +// Default settings for the default view $CONF['default_start'] = ""; // default start and stop times (ctime values) ; unless you want to always show a -$CONF['default_stop'] = ""; // same time frame, keep those values to "" +$CONF['default_stop'] = ""; // same time frame, keep those values to "" $CONF['default_relative_start'] = ""; // default relative start and stop times ([+-]), mind setting it $CONF['default_relative_stop'] = ""; // accordingly to the nav_forecast values below, eg -24*3600*0.1 and 24*3600*0.9 $CONF['default_timespan'] = 6*3600; // default timespan, should be one of the nav_timespans below @@ -74,22 +85,40 @@ 'my label' => 'http://my.url' // remove all lines to disable (empty array) ); -// Overwrite configuration with values from drawgantt-config.inc.php +// Manage the configuration file define('CONFIG_DIR', '%%OARCONFDIR%%'); -define('CONFIG_FILE', CONFIG_DIR . '/drawgantt-config.inc.php'); -if (is_readable(CONFIG_FILE)) { - require CONFIG_FILE; +$config_file_suffix = ''; +// Look for a config file suffix in the query params +if (array_key_exists('config',$_GET) and preg_match('/^\w+$/', $_GET['config'])) { + $config_file_suffix = $_GET['config']; + error_log('drawgantt: config suffix found in query params: '.$config_file_suffix); +// Look for a config file suffix in the script path +} elseif (preg_match('/^.*\W(\w+)\/.*$/',$_SERVER['SCRIPT_NAME'],$match) and is_file(CONFIG_DIR . '/drawgantt-config-'.$match[1].'.inc.php')) { + $config_file_suffix = $match[1]; + error_log('drawgantt: config suffix guessed from URL: '.$config_file_suffix); +} +$config_file = CONFIG_DIR . '/drawgantt-config'.($config_file_suffix?'-'.$config_file_suffix:'').'.inc.php'; +if (is_readable($config_file)) { + error_log('drawgantt: use config file '.$config_file); + require $config_file; +} else { + error_log('drawgantt: config file not readable: '.$config_file.', use default values.'); } +//////////////////////////////////////////////////////////////////////////////// +// Script parameters (GET) +//////////////////////////////////////////////////////////////////////////////// $resource_base = array_key_exists('resource_base',$_GET)?$_GET['resource_base']:$CONF['default_resource_base']; -$filter = array_key_exists('filter',$_GET)?$_GET['filter']:reset($CONF['nav_filters']); -$timezone = array_key_exists('timezone',$_GET)?$_GET['timezone']:reset($CONF['nav_timezones']); +$filter = array_key_exists('filter',$_GET)?$_GET['filter']:array_keys($CONF['nav_filters'])[0]; +$filterSQL=$CONF['nav_filters'][$filter]; +$timezone = array_key_exists('timezone',$_GET)?$_GET['timezone']:$CONF['nav_timezones'][0]; $relative_start = array_key_exists('relative_start',$_GET)?$_GET['relative_start']:$CONF['default_relative_start']; $relative_stop = array_key_exists('relative_stop',$_GET)?$_GET['relative_stop']:$CONF['default_relative_stop']; $start = array_key_exists('start',$_GET)?$_GET['start']:$CONF['default_start']; $stop = array_key_exists('stop',$_GET)?$_GET['stop']:$CONF['default_stop']; $timespan = array_key_exists('timespan',$_GET)?$_GET['timespan']:$CONF['default_timespan']; $scale = array_key_exists('scale',$_GET)?$_GET['scale']:$CONF['default_scale']; +$scheduler_priority = array_key_exists('scheduler_priority',$_GET)?'&scheduler_priority':''; $output = << @@ -192,12 +221,13 @@ + + + + + + + + + +
    +
  • +
    head1
    +
    + +
    + +
  • +
  • +
    head2
    +
    + +
    + +
  • +
+ +