diff --git a/example/s-pipeline.yaml b/example/s-pipeline.yaml index c49ef2d9..25037440 100644 --- a/example/s-pipeline.yaml +++ b/example/s-pipeline.yaml @@ -51,7 +51,7 @@ resources: alwaysAllocateGPU: false mode: sync - supplement: + annotations: modelConfig: source: modelscope id: ${env('MODEL_ID', 'iic/SenseVoiceSmall')} diff --git a/example/s.yaml b/example/s.yaml index 6b2c2f13..735ba400 100644 --- a/example/s.yaml +++ b/example/s.yaml @@ -58,7 +58,7 @@ resources: alwaysAllocateGPU: false mode: sync - supplement: + annotations: modelConfig: source: modelscope id: ${env('MODEL_ID', 'Qwen/Qwen3-32B-AWQ')} diff --git a/src/interface/index.ts b/src/interface/index.ts index 8fd7d021..4e024bcb 100644 --- a/src/interface/index.ts +++ b/src/interface/index.ts @@ -20,6 +20,7 @@ export interface IProps extends IFunction { provisionConfig?: IProvisionConfig; endpoint?: string; supplement?: any; + annotations?: any; } export interface IInputs extends _IInputs { diff --git a/src/subCommands/deploy/impl/function.ts b/src/subCommands/deploy/impl/function.ts index 9c3a3025..58038486 100644 --- a/src/subCommands/deploy/impl/function.ts +++ b/src/subCommands/deploy/impl/function.ts @@ -319,7 +319,7 @@ export default class Service extends Base { * 生成 auto 资源,非 FC 资源,主要指 vpc、nas、log、role(oss mount 挂载点才有) */ private async _deployAuto() { - const { region, supplement } = this.inputs.props; + const { region, supplement, annotations } = this.inputs.props; const { credential } = this.inputs; const { functionName } = this.local; @@ -390,10 +390,7 @@ vpcConfig: _.set(this.local, 'vpcConfig', vpcConfig); } if (nasAuto) { - let modelConfig; - if (!isEmpty(supplement)) { - modelConfig = supplement.modelConfig; - } + let modelConfig = supplement?.modelConfig || annotations?.modelConfig; logger.write( yellow(`Created nas resource succeeded, please replace nasConfig: auto in yaml with: diff --git a/src/subCommands/model/index.ts b/src/subCommands/model/index.ts index 1a7a863c..2c8ff024 100644 --- a/src/subCommands/model/index.ts +++ b/src/subCommands/model/index.ts @@ -57,9 +57,9 @@ export class Model { // 2. 调用 download 接口,若返回一个错误是下载服务已经存在,继续等待 get 轮询。 // 3. 轮询 get 接口 const { credential } = this.inputs; - const { region, supplement } = this.inputs.props; + const { region, supplement, annotations } = this.inputs.props; const { functionName } = this.local; - const { modelConfig } = supplement; + const modelConfig = supplement?.modelConfig || annotations?.modelConfig; if (isEmpty(modelConfig)) { logger.error(`[Download-model] modelConfig is empty.`); @@ -110,7 +110,7 @@ nasConfig: groupId: 0 userId: 0 mountPoints: - - serverAddr: ${mountTargetDomain}:/${functionName}/${supplement.modelConfig.id} + - serverAddr: ${mountTargetDomain}:/${functionName}/${modelConfig.id} mountDir: /mnt/${functionName} enableTLS: false\n`), ); @@ -120,7 +120,7 @@ mountPoints: userId: 0, mountPoints: [ { - serverAddr: `${mountTargetDomain}:/${functionName}/${supplement.modelConfig.id}`, + serverAddr: `${mountTargetDomain}:/${functionName}/${modelConfig.id}`, mountDir: `/mnt/${functionName}`, enableTLS: false, },