Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When I run ray.remote with image_uri as the parameter, it is successful, but when I change it to ray_derve, it cannot run successfully #50839

Open
zhouhangzone opened this issue Feb 23, 2025 · 0 comments
Labels
bug Something that is supposed to be working; but isn't serve Ray Serve Related Issue triage Needs triage (eg: priority, bug/not-bug, and owning component)

Comments

@zhouhangzone
Copy link

zhouhangzone commented Feb 23, 2025

What happened + What you expected to happen

this is Dockerfile

# 使用 Miniconda 作为基础镜像

FROM continuumio/miniconda3

# 设置工作目录

WORKDIR /app

# 创建 Conda 环境

RUN conda create --name kolors python=3.10.12

RUN echo "conda activate kolors" >> ~/.bashrc

ENV PATH /opt/conda/envs/kolors/bin:$PATH

# 设置 pip 镜像源为国内源(比如阿里云镜像)

RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

# 安装 Ray 和其他依赖

RUN pip install --upgrade pip

# 将本地的 requirements.txt 复制到容器中的 /app 目录

COPY requirements.txt /app/requirements.txt

# 安装项目的 Python 依赖

RUN pip install -r /app/requirements.txt

# 只需保持环境配置,不需要启动 app.py

# 最终,容器本身不启动任何程序,只需提供环境

CMD ["/bin/bash"]

this is requirements.txt

emoji

### this is ray.remoto

import ray

runtime_env = {"image_uri": "localhost/kolor_podman_ray"}

ray.init(runtime_env=runtime_env)

@ray.remote
def f():
  import emoji
  return emoji.emojize('Python is :thumbs_up:')

print(ray.get(f.remote()))

Image

this is ray serve

import ray
from ray import serve
from fastapi import FastAPI
import ray

# 创建 FastAPI 应用
app = FastAPI()

# 定义 Ray Serve 部署类
@serve.deployment(num_replicas=2)
@serve.ingress(app)
class EmojiService:

    
    def __init__(self):
        pass

    @app.get("/emoji")
    def get_emoji(self):
        import emoji
        # 处理请求,返回表情字符串
        return emoji.emojize('Python is :thumbs_up:')

# 绑定服务
app= EmojiService.options(ray_actor_options={"runtime_env": {"image_uri": "localhost/kolor_podman_ray"}}).bind()

Image

Versions / Dependencies

ray Version: 2.42.1
python = 3.10.12

Reproduction script

//

Issue Severity

High: It blocks me from completing my task.

@zhouhangzone zhouhangzone added bug Something that is supposed to be working; but isn't triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Feb 23, 2025
@jcotant1 jcotant1 added the serve Ray Serve Related Issue label Feb 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is supposed to be working; but isn't serve Ray Serve Related Issue triage Needs triage (eg: priority, bug/not-bug, and owning component)
Projects
None yet
Development

No branches or pull requests

2 participants