-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: remove usage of build yaml for list-deps #4192
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cdoern
wants to merge
8
commits into
llamastack:main
Choose a base branch
from
cdoern:rm-build
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+870
−349
Open
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
6ffaae6
feat: remove usage of build yaml for list-deps
cdoern 4311641
chore: remove additional_pip_packages
cdoern c7afd49
Merge remote-tracking branch 'upstream/main' into rm-build
cdoern 17f8ab3
fix: library client usage of BuildConfig
cdoern 4a3f915
fix: rename StackRunConfig to StackConfig
cdoern 0cd98c9
chore: rename run.yaml to config.yaml
cdoern f05d513
fix: rename some more usages
cdoern 3916015
Merge remote-tracking branch 'upstream/main' into rm-build
cdoern File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,15 +11,9 @@ | |
| import yaml | ||
| from termcolor import cprint | ||
|
|
||
| from llama_stack.cli.stack.utils import ImageType | ||
| from llama_stack.core.build import get_provider_dependencies | ||
| from llama_stack.core.datatypes import ( | ||
| BuildConfig, | ||
| BuildProvider, | ||
| DistributionSpec, | ||
| ) | ||
| from llama_stack.core.datatypes import Provider, StackRunConfig | ||
| from llama_stack.core.distribution import get_provider_registry | ||
| from llama_stack.core.stack import replace_env_vars | ||
| from llama_stack.log import get_logger | ||
| from llama_stack_api import Api | ||
|
|
||
|
|
@@ -72,7 +66,7 @@ def run_stack_list_deps_command(args: argparse.Namespace) -> None: | |
| try: | ||
| from llama_stack.core.utils.config_resolution import Mode, resolve_config_or_distro | ||
|
|
||
| config_file = resolve_config_or_distro(args.config, Mode.BUILD) | ||
| config_file = resolve_config_or_distro(args.config, Mode.RUN) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| except ValueError as e: | ||
| cprint( | ||
| f"Could not parse config file {args.config}: {e}", | ||
|
|
@@ -84,9 +78,7 @@ def run_stack_list_deps_command(args: argparse.Namespace) -> None: | |
| with open(config_file) as f: | ||
| try: | ||
| contents = yaml.safe_load(f) | ||
| contents = replace_env_vars(contents) | ||
leseb marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| build_config = BuildConfig(**contents) | ||
| build_config.image_type = "venv" | ||
| run_config = StackRunConfig(**contents) | ||
| except Exception as e: | ||
| cprint( | ||
| f"Could not parse config file {config_file}: {e}", | ||
|
|
@@ -95,7 +87,7 @@ def run_stack_list_deps_command(args: argparse.Namespace) -> None: | |
| ) | ||
| sys.exit(1) | ||
| elif args.providers: | ||
| provider_list: dict[str, list[BuildProvider]] = dict() | ||
| provider_list: dict[str, list[Provider]] = dict() | ||
| for api_provider in args.providers.split(","): | ||
| if "=" not in api_provider: | ||
| cprint( | ||
|
|
@@ -114,8 +106,9 @@ def run_stack_list_deps_command(args: argparse.Namespace) -> None: | |
| ) | ||
| sys.exit(1) | ||
| if provider_type in providers_for_api: | ||
| provider = BuildProvider( | ||
| provider = Provider( | ||
| provider_type=provider_type, | ||
| provider_id=provider_type.split("::")[1], | ||
| module=None, | ||
| ) | ||
| provider_list.setdefault(api, []).append(provider) | ||
|
|
@@ -126,20 +119,16 @@ def run_stack_list_deps_command(args: argparse.Namespace) -> None: | |
| file=sys.stderr, | ||
| ) | ||
| sys.exit(1) | ||
| distribution_spec = DistributionSpec( | ||
| providers=provider_list, | ||
| description=",".join(args.providers), | ||
| ) | ||
| build_config = BuildConfig(image_type=ImageType.VENV.value, distribution_spec=distribution_spec) | ||
| run_config = StackRunConfig(providers=provider_list, image_name="providers-run") | ||
|
|
||
| normal_deps, special_deps, external_provider_dependencies = get_provider_dependencies(build_config) | ||
| normal_deps, special_deps, external_provider_dependencies = get_provider_dependencies(run_config) | ||
| normal_deps += SERVER_DEPENDENCIES | ||
|
|
||
| # Add external API dependencies | ||
| if build_config.external_apis_dir: | ||
| if run_config.external_apis_dir: | ||
| from llama_stack.core.external import load_external_apis | ||
|
|
||
| external_apis = load_external_apis(build_config) | ||
| external_apis = load_external_apis(run_config) | ||
| if external_apis: | ||
| for _, api_spec in external_apis.items(): | ||
| normal_deps.extend(api_spec.pip_packages) | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.