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 

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 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 = script.prepare(*args, **kwargs) 

55 script.submit(config=config, workflow=workflow, **kwargs) 

56 

57 

58@click.command(cls=BpsCommand) 

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

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

61 help="Workload Management System service class") 

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

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

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

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

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

67 default=0.0, 

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

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

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

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

72 """Display execution status for submitted workflows. 

73 """ 

74 script.report(*args, **kwargs)