From 33772da8e0dded442fa73e69a99c38ff51e47dc8 Mon Sep 17 00:00:00 2001 From: Xi Yan Date: Fri, 13 Sep 2024 13:17:17 -0700 Subject: [PATCH] remove configure from build --- llama_toolchain/core/build_conda_env.sh | 2 +- llama_toolchain/core/build_container.sh | 4 +- llama_toolchain/core/package.py | 58 ++++++++++++------------- 3 files changed, 32 insertions(+), 32 deletions(-) diff --git a/llama_toolchain/core/build_conda_env.sh b/llama_toolchain/core/build_conda_env.sh index 664f8ad02..a49b168c3 100755 --- a/llama_toolchain/core/build_conda_env.sh +++ b/llama_toolchain/core/build_conda_env.sh @@ -118,4 +118,4 @@ ensure_conda_env_python310 "$env_name" "$pip_dependencies" printf "${GREEN}Successfully setup conda environment. Configuring build...${NC}\n" -$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $config_file +# $CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $config_file diff --git a/llama_toolchain/core/build_container.sh b/llama_toolchain/core/build_container.sh index 3d2fc466f..7571ec4c8 100755 --- a/llama_toolchain/core/build_container.sh +++ b/llama_toolchain/core/build_container.sh @@ -105,10 +105,10 @@ if [ -n "$LLAMA_MODELS_DIR" ]; then mounts="$mounts -v $(readlink -f $LLAMA_MODELS_DIR):$models_mount" fi set -x -podman build -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts +podman build --network host -t $image_name -f "$TEMP_DIR/Dockerfile" "$REPO_DIR" $mounts set +x printf "${GREEN}Succesfully setup Podman image. Configuring build...${NC}" echo "You can run it with: podman run -p 8000:8000 $image_name" -$CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $config_file +# $CONDA_PREFIX/bin/python3 -m llama_toolchain.cli.llama stack configure $config_file diff --git a/llama_toolchain/core/package.py b/llama_toolchain/core/package.py index 6e9eb048d..f32744acf 100644 --- a/llama_toolchain/core/package.py +++ b/llama_toolchain/core/package.py @@ -78,37 +78,37 @@ def build_package( stub_config[api.value] = {"provider_type": api_input.provider} - if package_file.exists(): - cprint( - f"Build `{package_name}` exists; will reconfigure", - color="yellow", - ) - c = PackageConfig(**yaml.safe_load(package_file.read_text())) - for api_str, new_config in stub_config.items(): - if api_str not in c.providers: - c.providers[api_str] = new_config - else: - existing_config = c.providers[api_str] - if existing_config["provider_type"] != new_config["provider_type"]: - cprint( - f"Provider `{api_str}` has changed from `{existing_config}` to `{new_config}`", - color="yellow", - ) - c.providers[api_str] = new_config - else: - c = PackageConfig( - built_at=datetime.now(), - package_name=package_name, - providers=stub_config, - ) + # if package_file.exists(): + # cprint( + # f"Build `{package_name}` exists; will reconfigure", + # color="yellow", + # ) + # c = PackageConfig(**yaml.safe_load(package_file.read_text())) + # for api_str, new_config in stub_config.items(): + # if api_str not in c.providers: + # c.providers[api_str] = new_config + # else: + # existing_config = c.providers[api_str] + # if existing_config["provider_type"] != new_config["provider_type"]: + # cprint( + # f"Provider `{api_str}` has changed from `{existing_config}` to `{new_config}`", + # color="yellow", + # ) + # c.providers[api_str] = new_config + # else: + # c = PackageConfig( + # built_at=datetime.now(), + # package_name=package_name, + # providers=stub_config, + # ) - c.distribution_type = distribution_type - c.docker_image = package_name if image_type == ImageType.docker else None - c.conda_env = package_name if image_type == ImageType.conda else None + # c.distribution_type = distribution_type + # c.docker_image = package_name if image_type == ImageType.docker else None + # c.conda_env = package_name if image_type == ImageType.conda else None - with open(package_file, "w") as f: - to_write = json.loads(json.dumps(c.dict(), cls=EnumEncoder)) - f.write(yaml.dump(to_write, sort_keys=False)) + # with open(package_file, "w") as f: + # to_write = json.loads(json.dumps(c.dict(), cls=EnumEncoder)) + # f.write(yaml.dump(to_write, sort_keys=False)) if image_type == ImageType.docker: script = pkg_resources.resource_filename(