Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 14 additions & 3 deletions __tests__/it/integration_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ const inputs: IInputs = {
},
// 执行的方法
command: 'deploy',
args: ['-t', 's.yaml'],
args: ['-t', 's.yaml', '--assume-yes'],
// yaml相关信息
yaml: {
path: path.join(__dirname, 's.yaml'),
Expand Down Expand Up @@ -86,8 +86,14 @@ describe('Integration Tests', () => {
role: '',
runtime: 'python3.9',
timeout: 60,
asyncInvokeConfig: undefined,
concurrencyConfig: undefined,
customDomain: undefined,
provisionConfig: undefined,
triggers: undefined,
vpcBinding: undefined,
});
});
}, 60000);

test('deploy http function', async () => {
const inputs_http = _.cloneDeep(inputs);
Expand Down Expand Up @@ -132,6 +138,11 @@ describe('Integration Tests', () => {
triggerType: 'http',
},
],
vpcBinding: undefined,
asyncInvokeConfig: undefined,
concurrencyConfig: undefined,
provisionConfig: undefined,
customDomain: undefined,
});
});
}, 60000);
});
8 changes: 4 additions & 4 deletions __tests__/ut/subCommands_test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ describe('SYaml2To3', () => {
key1: 'value1',
key2: 'value2',
},
gpuMemorySize: 'test',
gpuMemorySize: 16384,
asyncConfiguration: {
destination: {
onSuccess: 'acs:fc:::fc-test-on-success',
Expand Down Expand Up @@ -363,7 +363,7 @@ describe('SYaml2To3', () => {
ossBucket: 'test',
ossKey: 'test1',
environmentVariables: {},
gpuMemorySize: 'test',
gpuMemorySize: 16384,
asyncConfiguration: {
destination: {},
},
Expand Down Expand Up @@ -494,7 +494,7 @@ describe('SYaml2To3', () => {
key1: 'value1',
key2: 'value2',
},
gpuMemorySize: 'test',
gpuMemorySize: 16384,
asyncConfiguration: {
destination: {
onSuccess: 'acs:fc:::fc-test-on-success',
Expand Down Expand Up @@ -631,7 +631,7 @@ describe('SYaml2To3', () => {
},
ossBucket: 'test',
ossKey: 'test1',
gpuMemorySize: 'test',
gpuMemorySize: 16384,
asyncConfiguration: {
destination: {},
},
Expand Down
15,389 changes: 8,977 additions & 6,412 deletions package-lock.json

Large diffs are not rendered by default.

7 changes: 5 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"license": "ISC",
"dependencies": {
"@alicloud/fc2": "^2.6.6",
"@alicloud/fc20230330": "^4.1.6",
"@alicloud/fc20230330": "4.1.6-beta.2",
"@alicloud/pop-core": "^1.8.0",
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.21",
"@serverless-cd/srm-aliyun-ram20150501": "^0.0.2-beta.9",
Expand Down Expand Up @@ -57,7 +57,7 @@
"@serverless-devs/component-interface": "^0.0.6",
"@serverless-devs/logger": "^0.0.5",
"@types/jest": "^29.5.14",
"@types/lodash": "^4.17.14",
"@types/lodash": "^4.17.16",
"@types/node": "^20.12.11",
"@vercel/ncc": "^0.38.3",
"f2elint": "^2.2.1",
Expand All @@ -73,6 +73,9 @@
"resolutions": {
"@alicloud/sls20191023": {
"registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
},
"@alicloud/fc20230330": {
"registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
}
}
}
1 change: 1 addition & 0 deletions src/interface/base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ export enum Runtime {
'dotnetcore2.1' = 'dotnetcore2.1',
'custom.debian10' = 'custom.debian10',
'custom.debian11' = 'custom.debian11',
'custom.debian12' = 'custom.debian12',
'custom' = 'custom',
'custom-container' = 'custom-container',
}
Expand Down
3 changes: 3 additions & 0 deletions src/interface/concurrency_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export interface IConcurrencyConfig {
reservedConcurrency: number;
}
1 change: 1 addition & 0 deletions src/interface/function.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ export interface IFunction {
cpu?: number;
memorySize?: number;
timeout?: number;
sessionAffinity?: string;

logConfig?: 'auto' | ILogConfig;
nasConfig?: 'auto' | INasConfig;
Expand Down
4 changes: 4 additions & 0 deletions src/interface/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { IFunction } from './function';
import { ITrigger } from './trigger';
import { IRegion } from './region';
import { IAsyncInvokeConfig } from './async_invoke_config';
import { IConcurrencyConfig } from './concurrency_config';
import { IProvisionConfig } from './provison_config';

export * from './region';
export * from './function';
Expand All @@ -14,6 +16,8 @@ export interface IProps extends IFunction {
region: IRegion;
triggers?: ITrigger[];
asyncInvokeConfig?: IAsyncInvokeConfig;
concurrencyConfig?: IConcurrencyConfig;
provisionConfig?: IProvisionConfig;
endpoint?: string;
}

Expand Down
27 changes: 27 additions & 0 deletions src/interface/provison_config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
export interface ScheduledAction {
name: string;
startTime: string;
endTime: string;
target: number;
scheduleExpression: string;
timeZone: string;
}

export interface TargetTrackingPolicy {
name: string;
startTime: string;
endTime: string;
metricType: string;
metricTarget: number;
minCapacity: number;
maxCapacity: number;
timeZone: string;
}

export interface IProvisionConfig {
defaultTarget: number;
alwaysAllocateCPU: boolean;
alwaysAllocateGPU: boolean;
scheduledActions: ScheduledAction[];
targetTrackingPolicies: TargetTrackingPolicy[];
}
3 changes: 2 additions & 1 deletion src/resources/fc/impl/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ export function isCustomRuntime(runtime: string): boolean {
return (
runtime === Runtime.custom ||
runtime === Runtime['custom.debian10'] ||
runtime === Runtime['custom.debian11']
runtime === Runtime['custom.debian11'] ||
runtime === Runtime['custom.debian12']
);
}

Expand Down
Loading