Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions instill/helpers/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,18 +55,27 @@ def cli():
required=False,
)
build_parser.add_argument(
"-n",
"--no-cache",
help="build the image without cache",
action="store_true",
required=False,
)
build_parser.add_argument(
"-a",
"--target-arch",
help="target platform architecture for the model image, default to host",
default=default_platform,
choices=["arm64", "amd64"],
required=False,
)
build_parser.add_argument(
"-w",
"--sdk-wheel",
help="instill sdk wheel absolute path for debug purpose",
default=None,
required=False,
)

# push
push_parser = subcommands.add_parser("push", help="Push model image")
Expand Down Expand Up @@ -179,6 +188,12 @@ def build(args):
)
shutil.copytree(os.getcwd(), tmpdir, dirs_exist_ok=True)

if args.sdk_wheel is not None:
shutil.copyfile(
args.sdk_wheel,
f"{tmpdir}/instill_sdk-{instill_version}dev-py3-none-any.whl",
)

target_arch_suffix = "-aarch64" if args.target_arch == "arm64" else ""

Logger.i("[Instill Builder] Building model image...")
Expand Down
6 changes: 5 additions & 1 deletion instill/helpers/init-templates/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,11 @@ RUN for package in ${PACKAGES}; do \
COPY --chown=ray:users --exclude=model.py . .

ARG SDK_VERSION
RUN pip install --default-timeout=1000 --no-cache-dir instill-sdk==${SDK_VERSION}
RUN if [ ! -f instill_sdk-${SDK_VERSION}dev-py3-none-any.whl ]; then \
pip install --default-timeout=1000 --no-cache-dir instill-sdk==${SDK_VERSION}; \
else \
pip install instill_sdk-${SDK_VERSION}dev-py3-none-any.whl; \
fi;

WORKDIR /home/ray
COPY --chown=ray:users model.py _model.py