Skip to content
This repository was archived by the owner on Sep 10, 2021. It is now read-only.

Commit 3abcf2d

Browse files
Michael GraueryuzhengZ
authored andcommitted
ENH: Refs #209 First addition of the batchmake module and its configuration.
Added the batchmake module and configuration pages that attemp to model configuration on the way it is done generally in midas3.
1 parent b995004 commit 3abcf2d

File tree

17 files changed

+960
-0
lines changed

17 files changed

+960
-0
lines changed
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5+
69328 Lyon, FRANCE.
6+
7+
See Copyright.txt for details.
8+
This software is distributed WITHOUT ANY WARRANTY; without even
9+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10+
PURPOSE. See the above copyright notices for more information.
11+
=========================================================================*/
12+
13+
class Batchmake_AppController extends MIDAS_GlobalModule
14+
{
15+
public $moduleName='batchmake';
16+
17+
} //end class
18+
?>

modules/batchmake/Notification.php

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5+
69328 Lyon, FRANCE.
6+
7+
See Copyright.txt for details.
8+
This software is distributed WITHOUT ANY WARRANTY; without even
9+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10+
PURPOSE. See the above copyright notices for more information.
11+
=========================================================================*/
12+
13+
/** notification manager*/
14+
class Batchmake_Notification extends MIDAS_Notification
15+
{
16+
public $_models=array('User');
17+
18+
19+
/** init notification process*/
20+
public function init()
21+
{
22+
$this->addCallBack('CALLBACK_CORE_GET_DASHBOARD', 'getDasboard');
23+
$this->addTask('TASK_BATCHMAKE_TEST', 'testMethod', 'test');
24+
$this->addEvent('EVENT_CORE_CREATE_THUMBNAIL', 'TASK_BATCHMAKE_TEST');
25+
}//end init
26+
27+
28+
/** generate Dasboard information */
29+
public function getDasboard()
30+
{
31+
$config = Zend_Registry::get('configsModules');
32+
33+
$return = array();
34+
$return['notice'] = 'This notification needs to be improved';
35+
36+
return $return;
37+
}
38+
} //end class
39+
?>
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.local.ini
2+
*.local.ini.old
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[global]
2+
; version of the module
3+
version = 0.1.0
4+
; full name
5+
fullname= Batchmake
6+
; description
7+
description= Will run a Batchmake pipeline, either locally or via Condor
8+
;Category
9+
category= SSP
10+
11+
batchmake.tmp_dir =
12+
batchmake.bin_dir =
13+
batchmake.script_dir =
14+
batchmake.app_dir =
15+
batchmake.data_dir =
16+
batchmake.condor_bin_dir =
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
/*=========================================================================
3+
MIDAS Server
4+
Copyright (c) Kitware SAS. 20 rue de la Villette. All rights reserved.
5+
69328 Lyon, FRANCE.
6+
7+
See Copyright.txt for details.
8+
This software is distributed WITHOUT ANY WARRANTY; without even
9+
the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
10+
PURPOSE. See the above copyright notices for more information.
11+
=========================================================================*/
12+
define("CHECK_IF_READABLE", 0x2);
13+
define("CHECK_IF_WRITABLE", 0x4);
14+
define("CHECK_IF_RW", 0x6); // 0x2 + 0x4;
15+
define("CHECK_IF_EXECUTABLE", 0x8);
16+
define("CHECK_IF_CHMODABLE", 0x10);
17+
define("CHECK_IF_CHMODABLE_RW", 0x16); // 0x10 + 0x6
18+
19+
define("DEFAULT_MKDIR_MODE", 0775);
20+
21+
// Condor executables
22+
define("CONDOR_STATUS", "condor_status");
23+
define("CONDOR_QUEUE", "condor_q");
24+
define("CONDOR_SUBMIT", "condor_submit");
25+
define("CONDOR_SUBMIT_DAG", "condor_submit_dag");
26+
27+
// Batchmake executable
28+
define("BATCHMAKE_EXE", "BatchMake");
29+
30+
// Extension automatically appended to dagman
31+
// description file when 'condor_dag_submit' generates it
32+
define("CONDOR_DAGMAN_EXT", ".condor.sub");
33+
34+
// default extension for a dagjob
35+
define("CONDOR_SCRIPT_EXT", ".dagjob");
36+
37+
// properties set in the configuration
38+
define("TMP_DIR_PROPERTY", "tmp_dir");
39+
define("BIN_DIR_PROPERTY", "bin_dir");
40+
define("SCRIPT_DIR_PROPERTY", "script_dir");
41+
define("APP_DIR_PROPERTY", "app_dir");
42+
define("DATA_DIR_PROPERTY", "data_dir");
43+
define("CONDOR_BIN_DIR_PROPERTY", "condor_bin_dir");
44+
45+
// key for global config
46+
define("GLOBAL_CONFIG_NAME", "global");
47+
48+
// status types
49+
define("STATUS_TYPE_INFO", "info");
50+
define("STATUS_TYPE_WARNING", "warning");
51+
define("STATUS_TYPE_ERROR", "error");
52+
define("CONFIG_VALUE_MISSING", "config value missing");
53+
54+
55+
// config paths
56+
define("BATCHMAKE_MODULE", "batchmake");
57+
define("BATCHMAKE_CONFIGS_PATH", BASE_PATH . "/modules/" . BATCHMAKE_MODULE . "/configs/");
58+
define("BATCHMAKE_MODULE_CONFIG", BATCHMAKE_CONFIGS_PATH . "module.ini");
59+
define("BATCHMAKE_MODULE_LOCAL_CONFIG", BATCHMAKE_CONFIGS_PATH . "module.local.ini");
60+
define("BATCHMAKE_MODULE_LOCAL_OLD_CONFIG", BATCHMAKE_CONFIGS_PATH . "module.local.ini.old");
61+
62+
63+
64+
// strings
65+
define("CHANGES_SAVED_STRING", 'Changes saved');
66+
define("APPLICATION_STRING", 'Application:');
67+
define("PHP_PROCESS_STRING", 'PHP Process');
68+
define("PHP_PROCESS_USER_STRING", 'user');
69+
define("PHP_PROCESS_NAME_STRING", 'name');
70+
define("PHP_PROCESS_GROUP_STRING", 'group');
71+
define("PHP_PROCESS_HOME_STRING", 'home');
72+
define("PHP_PROCESS_SHELL_STRING", 'shell');
73+
define("UNKNOWN_STRING", 'unknown');
74+
define("AJAX_DIRECT_LOAD_ERROR_STRING", 'Why are you here ? Should be ajax.');
75+
define("SAVE_CONFIGURATION_STRING", 'Save configuration');
76+
define("EXIST_STRING", 'Exist');
77+
define("NOT_FOUND_ON_CURRENT_SYSTEM_STRING", 'Not found on the current system');
78+
define("FILE_OR_DIRECTORY_DOESNT_EXIST_STRING", "File or directory doesn't exist:");
79+
80+
81+
82+
83+
// property keys
84+
define("DIR_KEY",'dir');
85+
define("PROPERTY_KEY",'property');
86+
define("STATUS_KEY",'status');
87+
define("TYPE_KEY",'type');
88+
89+
90+
91+
92+
93+
?>

0 commit comments

Comments
 (0)