feat: add pyproject.toml and CI for ray-serve-apps package
Some checks failed
Build and Push Images / build-nvidia (push) Failing after 7m25s
Build and Push Images / build-rdna2 (push) Failing after 7m29s
Build and Push Images / build-strixhalo (push) Failing after 6m45s
Build and Push Images / build-intel (push) Failing after 6m22s
Build and Push Images / Release (push) Has been skipped
Build and Push Images / Notify (push) Successful in 1s
Build and Publish ray-serve-apps / lint (push) Failing after 3m9s
Build and Publish ray-serve-apps / publish (push) Has been skipped
Some checks failed
Build and Push Images / build-nvidia (push) Failing after 7m25s
Build and Push Images / build-rdna2 (push) Failing after 7m29s
Build and Push Images / build-strixhalo (push) Failing after 6m45s
Build and Push Images / build-intel (push) Failing after 6m22s
Build and Push Images / Release (push) Has been skipped
Build and Push Images / Notify (push) Successful in 1s
Build and Publish ray-serve-apps / lint (push) Failing after 3m9s
Build and Publish ray-serve-apps / publish (push) Has been skipped
- Restructure ray-serve as proper Python package (ray_serve/) - Add pyproject.toml with hatch build system - Add CI workflow to publish to Gitea PyPI - Add py.typed for PEP 561 compliance - Aligns with ADR-0019 handler deployment strategy
This commit is contained in:
87
.gitea/workflows/publish-ray-serve.yaml
Normal file
87
.gitea/workflows/publish-ray-serve.yaml
Normal file
@@ -0,0 +1,87 @@
|
||||
name: Build and Publish ray-serve-apps
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'ray-serve/**'
|
||||
- '.gitea/workflows/publish-ray-serve.yaml'
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
paths:
|
||||
- 'ray-serve/**'
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
|
||||
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install ruff
|
||||
run: pip install ruff
|
||||
|
||||
- name: Lint with ruff
|
||||
run: |
|
||||
cd ray-serve
|
||||
ruff check .
|
||||
ruff format --check .
|
||||
|
||||
publish:
|
||||
needs: lint
|
||||
runs-on: ubuntu-latest
|
||||
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
|
||||
- name: Set up Python
|
||||
uses: actions/setup-python@v5
|
||||
with:
|
||||
python-version: '3.11'
|
||||
|
||||
- name: Install build tools
|
||||
run: pip install build twine
|
||||
|
||||
- name: Build package
|
||||
run: |
|
||||
cd ray-serve
|
||||
python -m build
|
||||
|
||||
- name: Publish to Gitea PyPI
|
||||
env:
|
||||
TWINE_USERNAME: ${{ secrets.REGISTRY_USER }}
|
||||
TWINE_PASSWORD: ${{ secrets.REGISTRY_TOKEN }}
|
||||
run: |
|
||||
cd ray-serve
|
||||
twine upload --repository-url https://git.daviestechlabs.io/api/packages/daviestechlabs/pypi \
|
||||
dist/*
|
||||
|
||||
- name: Notify on success
|
||||
if: success()
|
||||
run: |
|
||||
curl -s -X POST "${{ env.NTFY_URL }}/builds" \
|
||||
-H "Title: ray-serve-apps published" \
|
||||
-H "Priority: default" \
|
||||
-H "Tags: package,white_check_mark" \
|
||||
-d "Published ray-serve-apps to Gitea PyPI"
|
||||
|
||||
- name: Notify on failure
|
||||
if: failure()
|
||||
run: |
|
||||
curl -s -X POST "${{ env.NTFY_URL }}/builds" \
|
||||
-H "Title: ray-serve-apps publish failed" \
|
||||
-H "Priority: high" \
|
||||
-H "Tags: package,x" \
|
||||
-d "Failed to publish ray-serve-apps to Gitea PyPI"
|
||||
@@ -1 +0,0 @@
|
||||
# Ray Serve deployments for GPU-shared AI inference
|
||||
71
ray-serve/pyproject.toml
Normal file
71
ray-serve/pyproject.toml
Normal file
@@ -0,0 +1,71 @@
|
||||
[project]
|
||||
name = "ray-serve-apps"
|
||||
version = "1.0.0"
|
||||
description = "Ray Serve deployments for GPU-shared AI inference"
|
||||
requires-python = ">=3.11"
|
||||
license = { text = "MIT" }
|
||||
authors = [{ name = "Davies Tech Labs" }]
|
||||
|
||||
dependencies = [
|
||||
# Ray Serve
|
||||
"ray[serve]>=2.53.0",
|
||||
|
||||
# HTTP client
|
||||
"httpx>=0.27.0",
|
||||
|
||||
# Numerical computing
|
||||
"numpy>=1.26.0",
|
||||
]
|
||||
|
||||
[project.optional-dependencies]
|
||||
# LLM inference (for vLLM deployments)
|
||||
llm = [
|
||||
"vllm>=0.6.0",
|
||||
]
|
||||
|
||||
# Embeddings and reranking
|
||||
embeddings = [
|
||||
"sentence-transformers>=2.2.0",
|
||||
]
|
||||
|
||||
# Speech-to-text
|
||||
stt = [
|
||||
"faster-whisper>=1.0.0",
|
||||
]
|
||||
|
||||
# Text-to-speech
|
||||
tts = [
|
||||
"TTS>=0.22.0",
|
||||
]
|
||||
|
||||
# Development
|
||||
dev = [
|
||||
"pytest>=8.0.0",
|
||||
"pytest-asyncio>=0.23.0",
|
||||
"ruff>=0.4.0",
|
||||
]
|
||||
|
||||
[build-system]
|
||||
requires = ["hatchling"]
|
||||
build-backend = "hatchling.build"
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
# Map the ray-serve directory to ray_serve package name
|
||||
packages = ["ray_serve"]
|
||||
|
||||
[tool.hatch.build.targets.sdist]
|
||||
include = [
|
||||
"ray_serve/**/*.py",
|
||||
"ray_serve/py.typed",
|
||||
]
|
||||
|
||||
[tool.ruff]
|
||||
line-length = 100
|
||||
target-version = "py311"
|
||||
|
||||
[tool.ruff.lint]
|
||||
select = ["E", "F", "I", "W", "UP", "B", "C4", "SIM"]
|
||||
ignore = ["E501"]
|
||||
|
||||
[tool.ruff.lint.isort]
|
||||
known-first-party = ["ray_serve"]
|
||||
14
ray-serve/ray_serve/__init__.py
Normal file
14
ray-serve/ray_serve/__init__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
# Ray Serve deployments for GPU-shared AI inference
|
||||
from ray_serve.serve_embeddings import app as embeddings_app
|
||||
from ray_serve.serve_llm import app as llm_app
|
||||
from ray_serve.serve_reranker import app as reranker_app
|
||||
from ray_serve.serve_tts import app as tts_app
|
||||
from ray_serve.serve_whisper import app as whisper_app
|
||||
|
||||
__all__ = [
|
||||
"embeddings_app",
|
||||
"llm_app",
|
||||
"reranker_app",
|
||||
"tts_app",
|
||||
"whisper_app",
|
||||
]
|
||||
0
ray-serve/ray_serve/py.typed
Normal file
0
ray-serve/ray_serve/py.typed
Normal file
Reference in New Issue
Block a user