Skip to content

Commit

Permalink
Merge pull request #10 from djw8605/package_webutils
Browse files Browse the repository at this point in the history
Package webutils
  • Loading branch information
bbockelm authored Nov 2, 2016
2 parents 18cd2dc + c06bdb8 commit c93676c
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ configure_file (
install(PROGRAMS src/condor-ce src/condor-ce-collector DESTINATION ${SYSCONF_INSTALL_DIR}/rc.d/init.d)
install(PROGRAMS src/condor_ce_startup src/condor_ce_startup_internal src/condor_ce_env_bootstrap src/condor_ce_client_env_bootstrap src/condor_ce_router_defaults src/osg-wrapper src/condor_ce_jobmetrics src/condor_ce_metric src/condor_ce_view src/bdii/condor_ce_bdii_generate_glue1.py src/bdii/condor_ce_bdii_generate_glue2.py src/gratia_cleanup.py DESTINATION ${SHARE_INSTALL_PREFIX}/condor-ce)
install(PROGRAMS src/condor_ce_config_generator src/condor_ce_config_val src/condor_ce_history src/condor_ce_hold src/condor_ce_info_status src/condor_ce_q src/condor_ce_qedit src/condor_ce_release src/condor_ce_rm src/condor_ce_submit src/condor_ce_version src/condor_ce_reconfig src/condor_ce_router_q src/condor_ce_status src/condor_ce_reschedule src/condor_ce_run src/condor_ce_trace src/condor_ce_ping src/condor_ce_off src/condor_ce_on src/condor_ce_restart src/condor_ce_job_router_info src/condor_ce_host_network_check DESTINATION ${CMAKE_INSTALL_PREFIX}/bin)
install(FILES src/htcondorce/__init__.py src/htcondorce/web.py src/htcondorce/rrd.py src/htcondorce/tools.py src/htcondorce/info_query.py DESTINATION ${PYTHON_SITELIB}/htcondorce)
install(FILES src/htcondorce/__init__.py src/htcondorce/web_utils.py src/htcondorce/rrd.py src/htcondorce/tools.py src/htcondorce/info_query.py DESTINATION ${PYTHON_SITELIB}/htcondorce)

install(FILES config/condor_config config/condor_mapfile DESTINATION ${SYSCONF_INSTALL_DIR}/condor-ce)
install(FILES config/metrics.d/00-metrics-defaults.conf config/metrics.d/00-example-metrics.conf DESTINATION ${SYSCONF_INSTALL_DIR}/condor-ce/metrics.d)
Expand Down
4 changes: 2 additions & 2 deletions config/02-ce-pbs-defaults.conf
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@ JOB_ROUTER_ENTRIES = \
# GridResource = "batch pbs"; \
# TargetUniverse = 9; \
# name = "Local_PBS_cms"; \
# set_remote_queue = "cms"; \
# set_default_queue = "cms"; \
# Requirements = target.x509UserProxyVOName =?= "cms"; \
# ] \
# [ \
# GridResource = "batch pbs"; \
# TargetUniverse = 9; \
# name = "Local_PBS_other"; \
# set_remote_queue = "other"; \
# set_default_queue = "other"; \
# Requirements = target.x509UserProxyVOName =!= "cms"; \
# ]

4 changes: 2 additions & 2 deletions config/02-ce-pbs.conf
Original file line number Diff line number Diff line change
Expand Up @@ -19,14 +19,14 @@ JOB_ROUTER_ENTRIES = \
# GridResource = "batch pbs"; \
# TargetUniverse = 9; \
# name = "Local_PBS_cms"; \
# set_remote_queue = "cms"; \
# set_default_queue = "cms"; \
# Requirements = target.x509UserProxyVOName =?= "cms"; \
# ] \
# [ \
# GridResource = "batch pbs"; \
# TargetUniverse = 9; \
# name = "Local_PBS_other"; \
# set_remote_queue = "other"; \
# set_default_queue = "other"; \
# Requirements = target.x509UserProxyVOName =!= "cms"; \
# ]

25 changes: 22 additions & 3 deletions config/htcondor-ce.spec
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
#define gitrev osg

Name: htcondor-ce
Version: 2.0.9
Release: 3%{?gitrev:.%{gitrev}git}%{?dist}
Version: 2.0.11
Release: 1%{?gitrev:.%{gitrev}git}%{?dist}
Summary: A framework to run HTCondor as a CE
BuildArch: noarch

Expand All @@ -27,7 +27,16 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

# Requires a bug fix in config conditionals
# https://htcondor-wiki.cs.wisc.edu/index.cgi/tktview?tn=5914
# TODO Replace Conflicts with "Requires: condor >= 8.6.0" in OSG 3.4
Requires: condor >= 8.4.9
Conflicts: condor = 8.5.0
Conflicts: condor = 8.5.1
Conflicts: condor = 8.5.2
Conflicts: condor = 8.5.3
Conflicts: condor = 8.5.4
Conflicts: condor = 8.5.5
Conflicts: condor = 8.5.6

# This ought to pull in the HTCondor-CE specific version of the blahp
Requires: blahp

Expand Down Expand Up @@ -333,7 +342,7 @@ fi
%defattr(-,root,root,-)

# Web package
%{python_sitelib}/htcondorce/web.py*
%{python_sitelib}/htcondorce/web_utils.py*
%{python_sitelib}/htcondorce/rrd.py*

%{_datadir}/condor-ce/templates/index.html
Expand Down Expand Up @@ -463,6 +472,16 @@ fi
%attr(1777,root,root) %dir %{_localstatedir}/lib/gratia/condorce_data

%changelog
* Mon Oct 24 2016 Brian Lin <[email protected]> - 2.0.11-1
- Accept all DaemonCore options in htcondor-ce-view (SOFTWARE-2481)
- Fix incorrect comment in htcondor-ce-pbs template config (SOFTWARE-2476)

* Tue Oct 11 2016 Brian Lin <[email protected]> - 2.0.10-1
- Fix CE View so that it handles new DaemonCore options in Condor 8.5.7

* Tue Sep 27 2016 Brian Lin <[email protected]> - 2.0.9-4
- Add conflicts statements so we pseudo-require an condor 8.5.x >= 8.5.7

* Tue Sep 27 2016 Brian Lin <[email protected]> - 2.0.9-3
- Always reload daemons after package installation
- Drop daemon-reload in postun that is handled in post
Expand Down
35 changes: 28 additions & 7 deletions src/condor_ce_view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import os
import pwd
import errno
import sys
import socket
import logging
import optparse
Expand Down Expand Up @@ -81,18 +81,30 @@ def setup_logging():
cherrypy.log.access_log.addHandler(h)


def parse_opts():
def parse_opts(localname=None, pidfile=None):
parser = optparse.OptionParser()
parser.add_option("-p", "--pool", help="HTCondor-CE pool to consider.", dest="pool")
# Unimplemented, DaemonCore short-name options
parser.add_option("-a")
parser.add_option("-b", action="store_true")
parser.add_option("-c")
parser.add_option("-d", action="store_true")
parser.add_option("-f", action="store_true")
parser.add_option("-k")
parser.add_option("-l")
parser.add_option("-q", action="store_true")
parser.add_option("-r", type="int")
parser.add_option("-t", action="store_true")
parser.add_option("-v", action="store_true")
# Implemented options
parser.add_option("--pool", help="HTCondor-CE pool to consider.", dest="pool")
parser.add_option("-n", "--name", help="HTCondor-CE schedd to consider.", dest="name")
parser.add_option("--port", help="Port to use for webapp.", dest="port")
parser.add_option("--spool", help="Spool directory to use.", dest="spool")
parser.add_option("-f", help="Stay in foreground.", action="store_true")
parser.add_option("-p", "--port", help="Port to use for webapp.", dest="port")

opts = parser.parse_args()[0]

if hasattr(htcondor, 'set_subsystem'):
htcondor.set_subsystem("CEVIEW")
htcondor.set_subsystem(localname or 'CEVIEW')
setup_logging()

return opts
Expand Down Expand Up @@ -146,7 +158,16 @@ class WSGILogging(object):


def main():
opts = parse_opts()
dc_long_opts = {}
for long_opt in ['-local-name', '-pidfile']:
try:
long_opt_index = sys.argv.index(long_opt)
dc_long_opts[long_opt.replace('-', '')] = sys.argv.pop(long_opt_index + 1)
sys.argv.pop(long_opt_index)
except ValueError:
pass

opts = parse_opts(**dc_long_opts)

spooldir = htcondor.param.get("HTCONDORCE_VIEW_SPOOL")
if opts.spool:
Expand Down
Empty file modified src/gratia_cleanup.py
100644 → 100755
Empty file.

0 comments on commit c93676c

Please sign in to comment.