mirror of
https://github.com/meta-llama/llama-stack.git
synced 2025-08-05 18:22:41 +00:00
no need for dockerfiles
This commit is contained in:
parent
0f21075575
commit
58d38ad3fa
2 changed files with 5 additions and 29 deletions
|
@ -81,14 +81,6 @@ class StackBuild(Subcommand):
|
|||
default="conda",
|
||||
)
|
||||
|
||||
self.parser.add_argument(
|
||||
"--dockerfile-only",
|
||||
type=bool,
|
||||
default=False,
|
||||
action=argparse.BooleanOptionalAction,
|
||||
help="Whether to generate a Dockerfile only (only valid when image-type is docker)",
|
||||
)
|
||||
|
||||
def _run_stack_build_command(self, args: argparse.Namespace) -> None:
|
||||
import textwrap
|
||||
|
||||
|
@ -100,12 +92,6 @@ class StackBuild(Subcommand):
|
|||
|
||||
from llama_stack.distribution.distribution import get_provider_registry
|
||||
|
||||
if args.dockerfile_only and args.image_type != "docker":
|
||||
self.parser.error(
|
||||
"dockerfile-only flag is only valid when image-type is docker"
|
||||
)
|
||||
return
|
||||
|
||||
if args.list_templates:
|
||||
self._run_template_list_cmd(args)
|
||||
return
|
||||
|
@ -123,7 +109,6 @@ class StackBuild(Subcommand):
|
|||
self._run_stack_build_command_from_build_config(
|
||||
build_config,
|
||||
template_name=args.template,
|
||||
dockerfile_only=args.dockerfile_only,
|
||||
)
|
||||
return
|
||||
|
||||
|
@ -195,7 +180,7 @@ class StackBuild(Subcommand):
|
|||
name=name, image_type=image_type, distribution_spec=distribution_spec
|
||||
)
|
||||
self._run_stack_build_command_from_build_config(
|
||||
build_config, dockerfile_only=args.dockerfile_only
|
||||
build_config,
|
||||
)
|
||||
return
|
||||
|
||||
|
@ -206,7 +191,7 @@ class StackBuild(Subcommand):
|
|||
self.parser.error(f"Could not parse config file {args.config}: {e}")
|
||||
return
|
||||
self._run_stack_build_command_from_build_config(
|
||||
build_config, dockerfile_only=args.dockerfile_only
|
||||
build_config,
|
||||
)
|
||||
|
||||
def _generate_run_config(self, build_config: BuildConfig, build_dir: Path) -> None:
|
||||
|
@ -284,7 +269,6 @@ class StackBuild(Subcommand):
|
|||
self,
|
||||
build_config: BuildConfig,
|
||||
template_name: Optional[str] = None,
|
||||
dockerfile_only: bool = False,
|
||||
) -> None:
|
||||
import json
|
||||
import os
|
||||
|
@ -304,7 +288,7 @@ class StackBuild(Subcommand):
|
|||
to_write = json.loads(build_config.model_dump_json())
|
||||
f.write(yaml.dump(to_write, sort_keys=False))
|
||||
|
||||
return_code = build_image(build_config, build_file_path, dockerfile_only)
|
||||
return_code = build_image(build_config, build_file_path)
|
||||
if return_code != 0:
|
||||
return
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ if [ "$#" -lt 4 ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
special_pip_deps="$7"
|
||||
special_pip_deps="$6"
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
|
@ -28,7 +28,6 @@ docker_base=$2
|
|||
build_file_path=$3
|
||||
host_build_dir=$4
|
||||
pip_dependencies=$5
|
||||
dockerfile_only=$6
|
||||
|
||||
# Define color codes
|
||||
RED='\033[0;31m'
|
||||
|
@ -109,6 +108,7 @@ if [ -n "$LLAMA_STACK_DIR" ]; then
|
|||
else
|
||||
if [ -n "$TEST_PYPI_VERSION" ]; then
|
||||
# these packages are damaged in test-pypi, so install them first
|
||||
echo "Installing fastapi libcst"
|
||||
add_to_docker "RUN pip install fastapi libcst"
|
||||
add_to_docker <<EOF
|
||||
RUN pip install --no-cache --extra-index-url https://test.pypi.org/simple/ \
|
||||
|
@ -176,14 +176,6 @@ fi
|
|||
# Add version tag to image name
|
||||
image_tag="$image_name:$version_tag"
|
||||
|
||||
if [ "$dockerfile_only" = "True" ]; then
|
||||
echo "Skipping docker build as dockerfile_only=True"
|
||||
dockerfile_name="Dockerfile.${image_tag}"
|
||||
cp "$TEMP_DIR/Dockerfile" "./${dockerfile_name}"
|
||||
printf "Dockerfile saved to ./${dockerfile_name}\n\n"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Detect platform architecture
|
||||
ARCH=$(uname -m)
|
||||
if [ -n "$BUILD_PLATFORM" ]; then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue