Source code for ska_sdp_piper.app.cli
import logging
from ..piper.command import CLIArgument, Command
from ..piper.utils import LogUtil
from .executable_pipeline import ExecutablePipeline
logger = logging.getLogger(__name__)
app = Command()
[docs]
@app.sub_command(
"install",
CLIArgument(
"pipeline_name", type=str, help="Name of the pipeline to install"
),
CLIArgument(
"pipeline_path",
type=str,
help="Path to the pipeline script to be installed",
),
help="Install a pipeline",
)
def install(
pipeline_name,
pipeline_path,
):
"""
Pipeline framework command to install pipelines
Parameters
----------
pipeline_name: str
Name of the pipeline to install
pipeline_path: str
Path to the pipeline script to be installed
"""
LogUtil.configure()
logger.info("=============== START INSTALL =====================")
executable_pipeline = ExecutablePipeline(pipeline_name, pipeline_path)
executable_pipeline.validate_pipeline()
executable_pipeline.install()
logger.info("=============== FINISH INSTALL ====================")
[docs]
@app.sub_command(
"uninstall",
CLIArgument(
"pipeline_name", type=str, help="Name of the pipeline to uninstall"
),
help="Uninstall a pipeline",
)
def uninstall(pipeline_name):
"""
Pipeline framework command to uninstall pipelines
Parameters
----------
pipeline_name: str
Name of the pipeline to uninstall
"""
LogUtil.configure()
logger.info("=============== START UNINSTALL =====================")
executable_pipeline = ExecutablePipeline(pipeline_name)
executable_pipeline.validate_pipeline()
executable_pipeline.uninstall()
logger.info("=============== FINISH UNINSTALL ====================")