Skip to content
Open
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
14 changes: 13 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
paths:
- '.github/workflows/publish.yml'
- 'maint_tools/build_default_image.py'
- 'maint_tools/build_plugin_image.py'

jobs:
flyte-pypi:
Expand Down Expand Up @@ -89,6 +90,17 @@ jobs:
uses: actions/setup-python@v1
with:
python-version: "3.13"
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io/flyteorg
username: "${{ secrets.FLYTE_BOT_USERNAME }}"
password: "${{ secrets.FLYTE_BOT_PAT }}"
- name: Install uv
uses: astral-sh/setup-uv@v6
id: setup-uv
Expand All @@ -97,7 +109,7 @@ jobs:
run: |
uv venv
uv pip install build twine setuptools wheel
- name: Build and publish
- name: Build
working-directory: ${{ matrix.workdir }}
run: |
uv run --prerelease allow python -m build --wheel --installer uv
Expand Down
43 changes: 24 additions & 19 deletions maint_tools/build_plugin_image.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
async def build_flyte_vllm_image(registry: str | None = None, name: str | None = None, builder: str | None = "local"):
"""
Build the SDK default Debian-based image, optionally overriding
the container registry and image name.
the container registry name.

Args:
registry: e.g. "ghcr.io/my-org" or "123456789012.dkr.ecr.us-west-2.amazonaws.com".
name: e.g. "my-flyte-image".
builder: e.g. "local" or "remote".
"""
import flyteplugins.vllm
Expand All @@ -24,39 +23,45 @@ async def build_flyte_vllm_image(registry: str | None = None, name: str | None =
async def build_flyte_sglang_image(registry: str | None = None, name: str | None = None, builder: str | None = "local"):
"""
Build the SDK default Debian-based image, optionally overriding
the container registry and image name.
the container registry name.
"""
import flyteplugins.sglang

default_image = flyteplugins.sglang.DEFAULT_SGLANG_IMAGE.clone(registry=registry, name=name)
await ImageBuildEngine.build(default_image, builder=builder)


async def build_all(registry: str | None = None, name: str | None = None, builder: str | None = "local"):
await asyncio.gather(
build_flyte_vllm_image(registry=registry, name=name, builder=builder),
build_flyte_sglang_image(registry=registry, name=name, builder=builder),
)


if __name__ == "__main__":
import os

parser = argparse.ArgumentParser(description="Build the default Flyte image.")
parser.add_argument("--registry", help="Docker registry to push to")
parser.add_argument("--name", help="Custom image name (without tag)")
parser.add_argument("--type", choices=["vllm", "sglang", "all"], help="Type of image to build")
parser.add_argument("--type", choices=["vllm", "sglang"], help="Type of image to build")
parser.add_argument("--builder", choices=["local", "remote"], default="local", help="Image builder to use")

args = parser.parse_args()
# can remove this and only specify one in the future
assert (args.registry and args.name) or (not args.registry and not args.name)

flyte.init_from_config()
if os.getenv("GITHUB_ACTIONS", "") == "true":
flyte.init(
endpoint=os.getenv("FLYTE_ENDPOINT", "dns:///playground.canary.unionai.cloud"),
auth_type="ClientSecret",
client_id="flyte-sdk-ci",
client_credentials_secret=os.getenv("FLYTE_SDK_CI_TOKEN"),
insecure=False,
image_builder="remote",
project=os.getenv("FLYTE_PROJECT", "flyte-sdk"),
domain=os.getenv("FLYTE_DOMAIN", "development"),
)
builder = "remote"
else:
flyte.init_from_config()
builder = args.builder

if args.type == "vllm":
print("Building vllm image...")
asyncio.run(build_flyte_vllm_image(registry=args.registry, name=args.name, builder=args.builder))
asyncio.run(build_flyte_vllm_image(registry=args.registry, builder=builder))
elif args.type == "sglang":
print("Building sglang image...")
asyncio.run(build_flyte_sglang_image(registry=args.registry, name=args.name, builder=args.builder))
asyncio.run(build_flyte_sglang_image(registry=args.registry, builder=builder))
else:
print("Building all images...")
asyncio.run(build_all(registry=args.registry, name=args.name, builder=args.builder))
raise ValueError(f"Invalid type: {args.type}. Valid types are: [vllm, sglang].")
2 changes: 1 addition & 1 deletion plugins/sglang/src/flyteplugins/sglang/_app_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from flyteplugins.sglang._constants import SGLANG_MIN_VERSION_STR

DEFAULT_SGLANG_IMAGE = (
flyte.Image.from_debian_base(name="sglang-app-image")
flyte.Image.from_debian_base(name="sglang-app-image", python_version=(3, 13))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

does this mean we'll only build one version of the sglang-app-image and it'll only be 3.13? that's fine but will users accidentally somehow use another one? what happens if they create an sglang app while on 3.11?

# install system dependencies, including CUDA toolkit, which is needed by sglang for compiling the model
# and rust and cargo for installing sglang
.with_apt_packages("libnuma-dev", "wget", "curl", "openssl", "pkg-config", "libssl-dev", "build-essential")
Expand Down
2 changes: 1 addition & 1 deletion plugins/vllm/src/flyteplugins/vllm/_app_environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from flyteplugins.vllm._constants import VLLM_MIN_VERSION_STR

DEFAULT_VLLM_IMAGE = (
flyte.Image.from_debian_base(name="vllm-app-image")
flyte.Image.from_debian_base(name="vllm-app-image", python_version=(3, 13))
# install flashinfer and vllm
.with_pip_packages("flashinfer-python", "flashinfer-cubin")
.with_pip_packages("flashinfer-jit-cache", index_url="https://flashinfer.ai/whl/cu129")
Expand Down
Loading