From d2701b0d6a57d0a35fc64643400636e29ce802ee Mon Sep 17 00:00:00 2001 From: Reid <61492567+reidliu41@users.noreply.github.com> Date: Sat, 22 Feb 2025 00:06:25 +0800 Subject: [PATCH] chore: remove configure subcommand (#1202) # What does this PR do? [Provide a short summary of what this PR does and why. Link to relevant issues if applicable.] When tried to use `configure`, and found it `DEPRECATED`, and found pr https://github.com/meta-llama/llama-stack/pull/371 to remove it, not sure why not remove the `configure.py`? ``` $ llama stack configure /tmp/test.yaml usage: llama stack configure [-h] [--output-dir OUTPUT_DIR] config llama stack configure: error: DEPRECATED! llama stack configure has been deprecated. Please use llama stack run instead. Please see example run.yaml in /distributions folder. ``` It would better better to tell when user check it how to use with `--help` first: ``` before: $ llama stack configure --help usage: llama stack configure [-h] [--output-dir OUTPUT_DIR] config Configure a llama stack distribution positional arguments: after: $ llama stack configure --help usage: llama stack configure [-h] [--output-dir OUTPUT_DIR] config Configure a llama stack distribution DEPRECATED! llama stack configure has been deprecated. Please use llama stack run instead. Please see example run.yaml in /distributions folder. ``` [//]: # (If resolving an issue, uncomment and update the line below) [//]: # (Closes #[issue-number]) ## Test Plan [Describe the tests you ran to verify your changes with result summaries. *Provide clear instructions so the plan can be easily re-executed.*] [//]: # (## Documentation) --------- Signed-off-by: reidliu Co-authored-by: reidliu --- llama_stack/cli/stack/configure.py | 46 ------------------------------ llama_stack/cli/stack/stack.py | 2 -- 2 files changed, 48 deletions(-) delete mode 100644 llama_stack/cli/stack/configure.py diff --git a/llama_stack/cli/stack/configure.py b/llama_stack/cli/stack/configure.py deleted file mode 100644 index 2bb3f7313..000000000 --- a/llama_stack/cli/stack/configure.py +++ /dev/null @@ -1,46 +0,0 @@ -# Copyright (c) Meta Platforms, Inc. and affiliates. -# All rights reserved. -# -# This source code is licensed under the terms described in the LICENSE file in -# the root directory of this source tree. - -import argparse - -from llama_stack.cli.subcommand import Subcommand - - -class StackConfigure(Subcommand): - """Llama cli for configuring llama toolchain configs""" - - def __init__(self, subparsers: argparse._SubParsersAction): - super().__init__() - self.parser = subparsers.add_parser( - "configure", - prog="llama stack configure", - description="Configure a llama stack distribution", - formatter_class=argparse.RawTextHelpFormatter, - ) - self._add_arguments() - self.parser.set_defaults(func=self._run_stack_configure_cmd) - - def _add_arguments(self): - self.parser.add_argument( - "config", - type=str, - help="Path to the build config file (e.g. ~/.llama/builds//-build.yaml). For container, this could also be the name of the container image. ", - ) - - self.parser.add_argument( - "--output-dir", - type=str, - help="Path to the output directory to store generated run.yaml config file. If not specified, will use ~/.llama/build//-run.yaml", - ) - - def _run_stack_configure_cmd(self, args: argparse.Namespace) -> None: - self.parser.error( - """ - DEPRECATED! llama stack configure has been deprecated. - Please use llama stack run instead. - Please see example run.yaml in /distributions folder. - """ - ) diff --git a/llama_stack/cli/stack/stack.py b/llama_stack/cli/stack/stack.py index 10e49f8c9..431f7b98e 100644 --- a/llama_stack/cli/stack/stack.py +++ b/llama_stack/cli/stack/stack.py @@ -10,7 +10,6 @@ from importlib.metadata import version from llama_stack.cli.subcommand import Subcommand from .build import StackBuild -from .configure import StackConfigure from .list_apis import StackListApis from .list_providers import StackListProviders from .run import StackRun @@ -37,7 +36,6 @@ class StackParser(Subcommand): # Add sub-commands StackBuild.create(subparsers) - StackConfigure.create(subparsers) StackListApis.create(subparsers) StackListProviders.create(subparsers) StackRun.create(subparsers)