Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# This file is part of ctrl_bps. 

2# 

3# Developed for the LSST Data Management System. 

4# This product includes software developed by the LSST Project 

5# (https://www.lsst.org). 

6# See the COPYRIGHT file at the top-level directory of this distribution 

7# for details of code ownership. 

8# 

9# This program is free software: you can redistribute it and/or modify 

10# it under the terms of the GNU General Public License as published by 

11# the Free Software Foundation, either version 3 of the License, or 

12# (at your option) any later version. 

13# 

14# This program is distributed in the hope that it will be useful, 

15# but WITHOUT ANY WARRANTY; without even the implied warranty of 

16# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 

17# GNU General Public License for more details. 

18# 

19# You should have received a copy of the GNU General Public License 

20# along with this program. If not, see <https://www.gnu.org/licenses/>. 

21import click 

22from lsst.daf.butler.cli.utils import MWCommand, cli_handle_exception 

23from .. import opt 

24from .. import script 

25 

26 

27class BpsCommand(MWCommand): 

28 """Command subclass with bps-command specific overrides.""" 

29 

30 extra_epilog = "See 'bps --help' for more options." 

31 

32 

33@click.command(cls=BpsCommand) 

34@opt.config_file_argument(required=True) 

35def transform(*args, **kwargs): 

36 """Transform a quantum graph to a workflow graph. 

37 """ 

38 raise NotImplementedError 

39 

40 

41@click.command(cls=BpsCommand) 

42@opt.config_file_argument(required=True) 

43def prepare(*args, **kwargs): 

44 """Prepare a workflow for submission. 

45 """ 

46 cli_handle_exception(script.prepare, *args, **kwargs) 

47 

48 

49@click.command(cls=BpsCommand) 

50@opt.config_file_argument(required=True) 

51def submit(*args, **kwargs): 

52 """Submit a workflow for execution. 

53 """ 

54 config, workflow = cli_handle_exception(script.prepare, *args, **kwargs) 

55 cli_handle_exception(script.submit, config=config, workflow=workflow, 

56 **kwargs) 

57 

58 

59@click.command(cls=BpsCommand) 

60@click.option("--wms", "wms_service", 

61 default="lsst.ctrl.bps.wms.htcondor.htcondor_service.HTCondorService", 

62 help="Workload Management System service class") 

63@click.option("--user", 

64 help="Restrict report to specific user.") 

65@click.option("--id", "run_id", 

66 help="Restrict report to specific WMS run id.") 

67@click.option("--hist", "hist_days", 

68 default=0.0, 

69 help="Search WMS history X days for completed info.") 

70@click.option("--pass-thru", 

71 help="Pass the given string to the WMS service class") 

72def report(*args, **kwargs): 

73 """Display execution status for submitted workflows. 

74 """ 

75 cli_handle_exception(script.report, *args, **kwargs)