Skip to content

Commit

Permalink
Merge pull request #60 from cmsdaq/hltd-160-candidate
Browse files Browse the repository at this point in the history
hltd 1.6.0 merge to master
  • Loading branch information
smorovic committed Jan 30, 2015
2 parents c2161dd + 1b32f34 commit 1a021f6
Show file tree
Hide file tree
Showing 45 changed files with 3,052 additions and 1,260 deletions.
11 changes: 11 additions & 0 deletions cgi/cloud_mode_active_cgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env python2.6
import cgi
import os
print "Content-Type: text/html" # HTML is following
print

try:
cloud = os.listdir('/etc/appliance/resources/cloud')
print len(cloud)
except Exception as ex:
print ex
15 changes: 15 additions & 0 deletions cgi/exclude_cgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python2.6
import cgi
import os
form = cgi.FieldStorage()
print "Content-Type: text/html" # HTML is following
print
print "<TITLE>CGI script exclude</TITLE>"

try:
os.unlink('exclude')
except:
pass
fp = open('exclude','w+')
fp.close()

15 changes: 15 additions & 0 deletions cgi/include_cgi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python2.6
import cgi
import os
form = cgi.FieldStorage()
print "Content-Type: text/html" # HTML is following
print
print "<TITLE>CGI script exclude</TITLE>"

try:
os.unlink('include')
except:
pass
fp = open('include','w+')
fp.close()

9 changes: 7 additions & 2 deletions cgi/suspend_cgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,15 @@
print "Content-Type: text/html" # HTML is following
print
print "<TITLE>CGI script suspend</TITLE>"

portsuffix=""
if "port" in form:
portsuffix=form["port"].value

try:
os.unlink('suspend')
os.unlink('suspend'+portsuffix)
except:
pass
fp = open('suspend','w+')
fp = open('suspend'+portsuffix,'w+')
fp.close()

Binary file added esplugins/head-master.zip
Binary file not shown.
Binary file added esplugins/hq-master.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions esplugins/install.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cd $1
echo installing elasticsearch plugins...
bin/plugin --url file:///opt/fff/esplugins/$2 --install $3
echo installing elasticsearch plugin $3 ...
bin/plugin -s --url file:///opt/fff/esplugins/$2 --install $3

Binary file added esplugins/paramedic-master.zip
Binary file not shown.
3 changes: 2 additions & 1 deletion esplugins/uninstall.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#!/bin/bash
cd $1
bin/plugin --remove $2
echo uninstalling elastic plugin $2 ...
bin/plugin -s --remove $2

5 changes: 3 additions & 2 deletions etc/hltd.conf
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
[General]
enabled = False
instance = main
exec_directory = /opt/hltd
user = daqlocal
watch_directory = /fff/data
Expand All @@ -9,19 +10,19 @@ mount_command = mount
mount_type = nfs4
mount_options_ramdisk = rw,noatime,vers=4,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys,noac
mount_options_output = rw,vers=4,rsize=65536,wsize=65536,namlen=255,hard,proto=tcp,timeo=600,retrans=2,sec=sys
micromerge_output = /fff/BU0/output
delete_run_dir = True
output_adler32 = True

[Monitoring]
use_elasticsearch = True
close_es_index = False
close_es_index = True
es_cmssw_log_level = DISABLED
es_hltd_log_level = ERROR
es_local = localhost

[Web]
cgi_port = 9000
cgi_instance_port_offset = 0
soap2file_port = 8010

[Resources]
Expand Down
27 changes: 27 additions & 0 deletions etc/instances.input
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"DISABLED-dvbu-c2f34-30-01":
{
"names":["main","testing"],
"sizes":[20,30]
},
"DISABLED-dvrubu-c2f34-17-03":
{
"names":["testing"],
"sizes":[0]
},
"DISABLED-dvrubu-c2f34-17-04":
{
"names":["testing"],
"sizes":[0]
},
"bu-vm-01-01.cern.ch":
{
"names":["main","testing"],
"sizes":[1000,500]
},
"fu-vm-02-02.cern.ch":
{
"names":["testing"],
"sizes":[0]
}
}
47 changes: 16 additions & 31 deletions json/runapplianceTemplate.json
Original file line number Diff line number Diff line change
Expand Up @@ -274,50 +274,35 @@
}
}
},
"hltrates-legend": {
"qstatus": {
"properties": {
"path-names": {
"type": "string",
"index": "not_analyzed"
},
"dataset-names": {
"type": "string",
"index": "not_analyzed"
}
}
},
"hltrates": {
"properties": {
"ls": {
"type": "integer"
},
"pid": {
"type": "integer"
},
"processed": {
"type": "integer"
},
"path-wasrun": {
"numQueuedLS": {
"type": "integer"
},
"path-afterl1seed": {
"maxQueuedLS": {
"type": "integer"
},
"path-afterprescale": {
"numReadFromQueueLS": {
"type": "integer"
},
"path-accepted": {
"maxClosedLS": {
"type": "integer"
},
"path-rejected": {
"numReadOpenLS": {
"type": "integer"
},
"path-errors": {
"type": "integer"
"fm_date": {
"type": "date"
},
"dataset-accepted": {
"type": "integer"
"host": {
"type": "string",
"index":"not_analyzed"
}
},
"_timestamp": {
"enabled": true,
"store": "yes",
"path": "fm_date"
}
},
"cmsswlog": {
Expand Down
72 changes: 72 additions & 0 deletions lib/python-procname/procnamemodule.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
/*
* Copyright (C) 2008 Eugene A. Lisitsky
*
* The procname library for Python.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
* */

#include <Python.h>
#include <sys/prctl.h>

void Py_GetArgcArgv(int*, char***);

PyDoc_STRVAR(procname__doc__, "Module for setting/getting process name");

static PyObject *
procname_check(PyObject *self, PyObject *args) {
return Py_BuildValue("i", 1);
};


static PyObject *
procname_getprocname(PyObject *self, PyObject *args) {
int argc;
char **argv;
Py_GetArgcArgv(&argc, &argv);
return Py_BuildValue("s", argv[0]);
};


static PyObject *
procname_setprocname(PyObject *self, PyObject *args) {
int argc;
char **argv;
char *name;
if (!PyArg_ParseTuple(args, "s", &name))
return NULL;
Py_GetArgcArgv(&argc, &argv);
strncpy(argv[0], name , strlen(name));
memset(&argv[0][strlen(name)], '\0', strlen(&argv[0][strlen(name)]));
prctl (15 /* PR_SET_NAME */, name, 0, 0, 0);
Py_INCREF(Py_None);
return Py_None;
};


static PyMethodDef procname_methods[] = {
{"check", procname_check, METH_VARARGS, "Test func"},
{"getprocname", procname_getprocname, METH_VARARGS,
"Get procname.\nReturns name (string)"},
{"setprocname", procname_setprocname, METH_VARARGS,
"Set procname.\n name (string) -> new process name.\nReturns None."},
{NULL, NULL, 0, NULL}
};

PyMODINIT_FUNC
initprocname(void) {
(void) Py_InitModule3("procname", procname_methods, procname__doc__);
}

17 changes: 17 additions & 0 deletions lib/python-procname/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env python

import distutils.core
import distutils.util

platform = distutils.util.get_platform()


distutils.core.setup(
name='procname',
version='0.1',
description='Process name renaming',
author="Eugene A Lisitsky",
license='LGPL',
platforms='Linux',
ext_modules=[distutils.core.Extension('procname', sources=['procnamemodule.c'])],
)
Loading

0 comments on commit 1a021f6

Please sign in to comment.