reservation = forms.CharField(label=u"Rezerwacja", max_length=100, required=False)
# TODO grid ftp
- input = forms.MultipleChoiceField(label=u"Standardowe wejście", required=False)
+ input = forms.CharField(label=u"Standardowe wejście", max_length=500, required=False)
stage_in = forms.MultipleChoiceField(label=u"Stage in", required=False)
# stage_out = forms.MultipleChoiceField(label=u"Stage out", required=False)
self.fields['arguments'].choices += ((v, v) for v in data.getlist('arguments'))
self.fields['properties'].choices += ((v, v) for v in data.getlist('properties'))
self.fields['native'].choices += ((v, v) for v in data.getlist('native'))
- self.fields['input'].choices += ((v, v) for v in data.getlist('input'))
self.fields['stage_in'].choices += ((v, v) for v in data.getlist('stage_in'))
# self.fields['stage_out'].choices += ((v, v) for v in data.getlist('stage_out'))
def clean_nodes(self):
return map(int, self.cleaned_data['nodes'].split(':', 2)) if self.cleaned_data['nodes'] else ''
+ def clean_input(self):
+ return 'gsiftp://' + self.cleaned_data['input'] if self.cleaned_data['input'] else ''
+
+ def clean_stage_in(self):
+ return ['gsiftp://' + item for item in self.cleaned_data['stage_in']]
class EnvForm(forms.Form):
name = forms.CharField(label=u"Nazwa", max_length=100, validators=[env_name_validator],
from pyqcg import QCG
from pyqcg.description import JobDescription
from pyqcg.service import Registry
-from pyqcg.utils import Credential, TimePeriod
+from pyqcg.utils import Credential, TimePeriod, JobStatus, TaskStatus
logger = logging.getLogger(__name__)
# Jobs
###################################
jts = time.time()
- jobs = registry.jobs(**changed_filter)
+ jobs = registry.jobs(stats=[v for k, v in vars(JobStatus).iteritems() if not k.startswith('__')],
+ **changed_filter)
jte = time.time()
jobs_count = 0
# Tasks
###################################
tts = time.time()
- tasks = registry.tasks(**changed_filter)
+ tasks = registry.tasks(stats=[v for k, v in vars(TaskStatus).iteritems() if not k.startswith('__')],
+ **changed_filter)
tte = time.time()
jobs_cache = {j.job_id: j for j in Job.objects.filter(owner=user)}
desc = JobDescription(Credential(proxy))
direct_map = ('env_variables', 'executable', 'arguments', 'note', 'grant', 'hosts', 'properties', 'queue', 'procs',
- 'wall_time', 'memory', 'memory_per_slot', 'modules', 'native', 'notify', 'preprocess', 'postprocess',
- 'persistent')
+ 'wall_time', 'memory', 'memory_per_slot', 'modules', 'input', 'stage_in', 'native', 'notify',
+ 'preprocess', 'postprocess', 'persistent')
for name in direct_map:
if params[name]:
if params['watch_output']:
desc.set_watch_output(params['watch_output'], params['watch_output_pattern'])
# TODO script
- # TODO executable
- # TODO input
- # TODO stage_in
# TODO stage_out
# TODO monitoring
'data-target': '#gridftp'
});
- $('#id_master_file,#id_executable,#id_preprocess_script,#id_postprocess_script').before(function() {
+ function fullPath(path, file) {
+ var res = path + file.get('name');
+
+ if (file.isDir())
+ res += '/';
+
+ return res;
+ }
+
+ $('#id_master_file,#id_executable,#id_input,#id_preprocess_script,#id_postprocess_script').before(function() {
var target = this;
return gridftpButton.clone().click(function() {
$('#select-btn').off().click(function() {
return;
}
- var file = filex.host + filex.path.full() + '/' + selected[0].get('name');
+ var file = fullPath(filex.host + filex.path.full() + '/', selected[0]);
+
+ target.selectize.clear();
target.selectize.addOption({value: file, text: file});
target.selectize.addItem(file);
target.selectize.refreshItems();
});
}).wrap('<div style="margin-right: 80px"></div>');
- $('#id_input,#id_stage_in').before(function() {
+ $('#id_stage_in').before(function() {
var target = this;
return gridftpButton.clone().click(function() {
$('#select-btn').off().click(function() {
var path = filex.host + filex.path.full() + '/';
_.each(filex.selectedFiles(), function(item) {
- console.log(arguments);
- var file = path + item.get('name');
+ var file = fullPath(path, item);
target.selectize.addOption({value: file, text: file});
target.selectize.addItem(file);
});