Skip to content

Commit

Permalink
nas
Browse files Browse the repository at this point in the history
  • Loading branch information
suluyana committed Dec 12, 2024
1 parent e95544f commit 17f6294
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 2 deletions.
25 changes: 25 additions & 0 deletions publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -136,3 +136,28 @@ Parameters:
type: string
default: '{}'
description: 部署推理时额外的环境变量,配置为可被json.loads的string。如backend为ollama时,配置deployEnv='{"OLLAMA_NUM_PARALLEL":4}'可实现并行度为4的部署。
servedModelName:
title: 部署后用于调用的模型名
type: string
default: ''
description: 部署后用于调用的模型名
nasMountAddr:
title: nas挂载地址
type: string
default: ''
description: nas挂载地址,用于模型下载的缓存和转换;不配置时会自动初始化或挂载已有的nas及其所需的网络等配置。nas所在区域应与region完全一致。例如:0625xxxxxx-xxxxx.cn-hangzhou.nas.aliyuncs.com:/deploy
vpcId:
title: vpc专用网络id
type: string
default: ''
description: nas所在的专用网络id,nasMountAddr为空时不会被取用。
securityGroupId:
title:
type: string
default: ''
description: nas所在专用网络的安全组id,nasMountAddr为空时不会被取用。
vSwitchIds:
title:
type: string
default: ''
description: nas所在专用网络的交换机id,nasMountAddr为空时不会被取用。
21 changes: 19 additions & 2 deletions src/s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,11 @@ vars: # 全局变量
templateFile: {{ templateFile }}
modelBackend: {{ modelBackend }}
deployEnv: '{{ deployEnv }}'
servedModelName: {{ if servedModelName == '' }}{{modelId}}{{else}}{{servedModelName}}{{/if}}
nasMountAddr: {{ nasMountAddr }}
vpcId: {{ vpcId }}
securityGroupId: {{ securityGroupId }}
vSwitchIds: {{ vSwitchIds }}
resources:
model_cache:
component: 'fc3'
Expand All @@ -34,8 +39,19 @@ resources:
instanceType: e1
runtime: python3.9
code: ./model_cache
vpcConfig: auto
nasConfig: auto
{{ if nasMountAddr != '' }}vpcConfig:
vpcId: ${vars.vpcId}
securityGroupId: ${vars.securityGroupId}
vSwitchIds:
- ${vars.vSwitchIds}
nasConfig:
groupId: 0
userId: 0
mountPoints:
- serverAddr: ${vars.nasMountAddr}
mountDir: /mnt/cache
enableTLS: false{{ else }}vpcConfig: auto
nasConfig: auto{{ /if }}

model_download_func:
component: 'fc3'
Expand Down Expand Up @@ -73,6 +89,7 @@ resources:
SUB_MODEL_FILE: ${vars.subModelFile}
TEMPLATE_FILE_URL: https://modelscope.oss-cn-beijing.aliyuncs.com/${vars.templateFile}
MODEL_BACKEND: ${vars.modelBackend}
SERVED_MODEL_NAME: ${vars.servedModelName}

model_meta_func:
component: 'fc3'
Expand Down

0 comments on commit 17f6294

Please sign in to comment.