For flyte2 SDK: What is the difference between `I...
# flyte-v1-support
a
For flyte2 SDK: What is the difference between
Image.from_base
and
Image.from_debian_base
. It appears to have the same functionality. There are a few extra parameters for debian base as below:
Copy code
python_version: Tuple[int, int] | None = None,
flyte_version: str | None = None,
install_flyte: bool = True,
registry: str | None = None,
registry_secret: str | Secret | None = None,
name: str | None = None,
platform: Tuple[Architecture, ...] | None = None
Why weren’t those added to the
Image.from_base
function. I presume
Image.from_base
can also be an debian image. Can someone look at the example file :
flyte-sdk/examples/image/base_image.py
, the image defined is never used.
Copy code
image = (
    Image.from_debian_base(install_flyte=False)
    .with_apt_packages("vim", "wget")
    .with_pip_packages("mypy", pre=True)
    .with_env_vars({"hello": "world1"})
    .with_dockerignore(Path(__file__).parent / ".dockerignore")
    .with_local_v2()
)
env = flyte.TaskEnvironment(name="t1", image=Image.from_base(image_uri="docker.io/library/debian:latest"))
If you support for ``Image.from_debian_base`` would there be function to provide support for other distributions like RPM etc.
e
from_base let you bring your own image to run in flyte And you can use from_debian_base if you do not have your own image, but just want to use flyte with extra apt or pip package installed. We will use debian image as base and install the things you provided on it
For using other distribution I think you can use from_base and provide the image there
a
So what would make it simpler is just to have
Image.from_base
and then people can define the image URL etc. Also
Image.from_base
will require those extra parameters as in
Image.from_debian_base
. I might be wrong but i see
Image.from_debian_base
as unnecessary.
e
I think the way they design this is to make this more explicit, if the base image is not provided, use
from_debian_base
and it's clear that we are using the debian as base image. For using
from_base
, the extra parameter can be set through
.clone
(example) cc @glamorous-carpet-83516 @freezing-airport-6809 @thankful-minister-83577 to check the design choice here
👍 1