mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-10-05 04:17:32 +00:00
wip
This commit is contained in:
parent
ecd17ce9e9
commit
ebb57a0c67
5 changed files with 123 additions and 12 deletions
|
@ -78,15 +78,31 @@ class StackConfigure(Subcommand):
|
|||
self._configure_llama_distribution(build_config, args.output_dir)
|
||||
return
|
||||
|
||||
# if we get here, we need to prompt user to try configure inside docker image
|
||||
self.parser.error(
|
||||
f"""
|
||||
Could not find {build_config_file}. Did you download a docker image?
|
||||
Try running `docker run -it --entrypoint "/bin/bash" <image_name>`
|
||||
`llama stack configure llamastack-build.yaml --output-dir ./`
|
||||
to set a new run configuration file.
|
||||
""",
|
||||
# if we get here, we need to try to find the docker image
|
||||
cprint(
|
||||
f"Could not find {build_config_file}. Trying docker image name instead...",
|
||||
color="green",
|
||||
)
|
||||
docker_image = args.config
|
||||
builds_dir = BUILDS_BASE_DIR / ImageType.docker.value
|
||||
if args.output_dir:
|
||||
builds_dir = Path(output_dir)
|
||||
os.makedirs(builds_dir, exist_ok=True)
|
||||
|
||||
script = pkg_resources.resource_filename(
|
||||
"llama_stack", "distribution/configure_container.sh"
|
||||
)
|
||||
script_args = [script, docker_image, str(builds_dir)]
|
||||
|
||||
return_code = run_with_pty(script_args)
|
||||
|
||||
# we have regenerated the build config file with script, now check if it exists
|
||||
if return_code != 0:
|
||||
self.parser.error(
|
||||
f"Failed to configure container {docker_image} with return code {return_code}. Please run `llama stack build first`. "
|
||||
)
|
||||
return
|
||||
|
||||
return
|
||||
|
||||
def _configure_llama_distribution(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue