You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# 使用 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()))
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()
Versions / Dependencies
ray Version: 2.42.1
python = 3.10.12
Reproduction script
//
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered:
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
What happened + What you expected to happen
this is Dockerfile
this is requirements.txt
emoji
### this is ray.remoto
this is ray serve
Versions / Dependencies
ray Version: 2.42.1
python = 3.10.12
Reproduction script
//
Issue Severity
High: It blocks me from completing my task.
The text was updated successfully, but these errors were encountered: