Skip to content
Snippets Groups Projects
Commit c107dcc1 authored by brian's avatar brian
Browse files

Addition of the static graphs RPM.

git-svn-id: svn://t2.unl.edu/brian/GraphUsers/gratia@4419 1fda6f16-4416-0410-bfd6-867a04880151
parent 2cffc6d1
No related branches found
No related tags found
No related merge requests found
include setuptools-0.6c11-py2.4.egg
include config/static_graphs
include config/osg_graphs.conf
include config/GratiaStaticGraphs.cron
01 0-23/8 * * * nobody static_graphs -config /etc/osg_graphs.conf > /dev/null
[General]
Source=http://t2.unl.edu/gratia
Enabled=false
#Dest=/afs/fnal.gov/files/expwww/gratia/html/Files/osg_gratia_display
Dest=/tmp/osg_graphs
Suffix=.png
UTCOffset=-6
StartDate=2010-11-01
Replace=false
[non_hep_vos]
image=/pie_graphs/osg_vo_hours?vo=nanohub%7Cglow%7Csdss%7Cdteam%7Cligo%7Cosg%7Cengage%7Cosgedu%7Ctigre%7Cnysgrid%7Ccigi%7Ccompbiogrid%7Cdes%7Cfmri%7Cgpn%7Cgrase%7Cgugrid%7Ci2u2%7Cmariachi%7Cnwicg%7Csbgrid%7Cstar&starttime=:today-52*7*86400&endtime=:today
[vo_bar_smry]
image=/bar_graphs/vo_hours_bar_smry?span=604800&starttime=:today-52*7*86400&endtime=:today
[facility_bar_smry]
image=/bar_graphs/facility_hours_bar_smry?span=604800&starttime=:today-52*7*86400&endtime=:today
[osg_wall_hours]
image=/bar_graphs/osg_wall_hours
[osg_wall_cumulative]
image=/cumulative_graphs/osg_wall_cumulative
[monthly_non_hep]
image=/bar_graphs/monthly_non_hep
[vo_job_count]
image=/bar_graphs/vo_job_cnt?span=604800&starttime=time.time()-365*86400
[animated_thumbnail1]
width=254
source= facility_bar_smry.png, vo_bar_smry.png, osg_wall_hours.png, osg_wall_cumulative.png, monthly_non_hep.png, vo_job_count.png
output=osg.gif
[animated_thumbnail2]
height=800
source=facility_bar_smry.png, vo_bar_smry.png, osg_wall_hours.png, osg_wall_cumulative.png, monthly_non_hep.png, vo_job_count.png
output=osg2.gif
[animated_thumbnail3]
height=200
source=facility_bar_smry.png, vo_bar_smry.png, osg_wall_hours.png, osg_wall_cumulative.png, monthly_non_hep.png, vo_job_count.png
output=osg3.gif
grey=True
[variables]
vo=http://t2.unl.edu/gratia/xml/
#!/usr/bin/python
import gratia.tools.static_graphs
gratia.tools.static_graphs.main()
[bdist_rpm]
requires = graphtool >= 0.6.4 python-setuptools
release = 2
[install]
optimize=1
import ez_setup
ez_setup.use_setuptools()
from setuptools import setup, find_packages
from distutils.core import setup
setup(name="GratiaStaticGraphs",
version="0.2",
version="0.3",
author="Brian Bockelman",
author_email="bbockelm@math.unl.edu",
author_email="bbockelm@cse.unl.edu",
url="http://t2.unl.edu/documentation/gratia_graphs",
description="Static Graph Generator.",
package_dir={"": "src"},
packages=find_packages("src"),
include_package_data=True,
classifiers = [
'Development Status :: 2 - Pre-Alpha',
'Intended Audience :: Developers',
'Programming Language :: Python',
'Natural Language :: English',
'Operating System :: POSIX'
],
dependency_links = ['http://effbot.org/downloads/Imaging-1.1.6.tar.gz' \
'#egg=PIL-1.1.6'],
install_requires=["PIL"],
packages=["gratia", "gratia.tools", "gratia.graphs"],
entry_points={
'console_scripts': [
'static_graphs = gratia.tools.static_graphs:main',
],
'setuptools.installation' : [
'static_graphs = gratia.tools.static_graphs:main',
data_files=[("/etc/cron.d", ["config/GratiaStaticGraphs.cron"]),
("/usr/bin", ["config/static_graphs"]),
("/etc", ["config/osg_graphs.conf"]),
]
},
namespace_packages = ['gratia']
)
......@@ -114,7 +114,10 @@ def generate(cp, entry=None):
utcOffset = cp.getint("General", "UTCOffset")
suffix = cp.get("General", "Suffix")
replace = cp.getboolean("General", "Replace")
try:
generate_hist_graphs = cp.getboolean("General", "GenerateHistoricalGraphs")
except:
generate_hist_graphs = False
variables = parse_variables(cp)
today_date = datetime.date.today()
......@@ -125,6 +128,8 @@ def generate(cp, entry=None):
curDate = today
while curDate >= firstDate:
if (today - curDate).days > 30:
continue
timestamp = int(curDate.strftime('%s')) + 3600*utcOffset
if curDate == today:
dest = os.path.join(orig_dest, 'today')
......@@ -213,15 +218,26 @@ def main():
for config_file in config_files:
if not os.path.exists(config_file):
print >> sys.stderr, "Config file %s not found." % config_file
sys.exit(-1)
sys.exit(1)
if not config_files:
config_files = ["/etc/osg_graphs.conf"]
cp = ConfigParser.ConfigParser()
try:
cp.readfp(resource_stream("gratia.config", "static_generator.cfg"))
except IOError:
pass
cp.read(config_files)
try:
if not cp.getboolean("General", "Enabled"):
print "Config file %s does not have Enabled=true in [General]." % \
", ".join(config_files)
print "Exiting 0 as requested."
sys.exit(0)
except SystemExit:
raise
except:
print "Unable to determine if config file %s has been enabled." % ", ".join(config_files)
sys.exit(1)
if 'entry' in kwArgs:
generate(cp, entry=kwArgs['entry'])
else:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment