Skip to content

Commit f95eece

Browse files
committed
support debian12
1 parent d8a7e03 commit f95eece

16 files changed

Lines changed: 9229 additions & 6435 deletions

File tree

__tests__/it/integration_test.ts

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ const inputs: IInputs = {
3030
},
3131
// 执行的方法
3232
command: 'deploy',
33-
args: ['-t', 's.yaml'],
33+
args: ['-t', 's.yaml', '--assume-yes'],
3434
// yaml相关信息
3535
yaml: {
3636
path: path.join(__dirname, 's.yaml'),
@@ -86,8 +86,14 @@ describe('Integration Tests', () => {
8686
role: '',
8787
runtime: 'python3.9',
8888
timeout: 60,
89+
asyncInvokeConfig: undefined,
90+
concurrencyConfig: undefined,
91+
customDomain: undefined,
92+
provisionConfig: undefined,
93+
triggers: undefined,
94+
vpcBinding: undefined,
8995
});
90-
});
96+
}, 60000);
9197

9298
test('deploy http function', async () => {
9399
const inputs_http = _.cloneDeep(inputs);
@@ -132,6 +138,11 @@ describe('Integration Tests', () => {
132138
triggerType: 'http',
133139
},
134140
],
141+
vpcBinding: undefined,
142+
asyncInvokeConfig: undefined,
143+
concurrencyConfig: undefined,
144+
provisionConfig: undefined,
145+
customDomain: undefined,
135146
});
136-
});
147+
}, 60000);
137148
});

__tests__/ut/subCommands_test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ describe('SYaml2To3', () => {
245245
key1: 'value1',
246246
key2: 'value2',
247247
},
248-
gpuMemorySize: 'test',
248+
gpuMemorySize: 16384,
249249
asyncConfiguration: {
250250
destination: {
251251
onSuccess: 'acs:fc:::fc-test-on-success',
@@ -363,7 +363,7 @@ describe('SYaml2To3', () => {
363363
ossBucket: 'test',
364364
ossKey: 'test1',
365365
environmentVariables: {},
366-
gpuMemorySize: 'test',
366+
gpuMemorySize: 16384,
367367
asyncConfiguration: {
368368
destination: {},
369369
},
@@ -494,7 +494,7 @@ describe('SYaml2To3', () => {
494494
key1: 'value1',
495495
key2: 'value2',
496496
},
497-
gpuMemorySize: 'test',
497+
gpuMemorySize: 16384,
498498
asyncConfiguration: {
499499
destination: {
500500
onSuccess: 'acs:fc:::fc-test-on-success',
@@ -631,7 +631,7 @@ describe('SYaml2To3', () => {
631631
},
632632
ossBucket: 'test',
633633
ossKey: 'test1',
634-
gpuMemorySize: 'test',
634+
gpuMemorySize: 16384,
635635
asyncConfiguration: {
636636
destination: {},
637637
},

package-lock.json

Lines changed: 8977 additions & 6412 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
"license": "ISC",
2424
"dependencies": {
2525
"@alicloud/fc2": "^2.6.6",
26-
"@alicloud/fc20230330": "^4.1.6",
26+
"@alicloud/fc20230330": "4.1.6-beta.2",
2727
"@alicloud/pop-core": "^1.8.0",
2828
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.21",
2929
"@serverless-cd/srm-aliyun-ram20150501": "^0.0.2-beta.9",
@@ -57,7 +57,7 @@
5757
"@serverless-devs/component-interface": "^0.0.6",
5858
"@serverless-devs/logger": "^0.0.5",
5959
"@types/jest": "^29.5.14",
60-
"@types/lodash": "^4.17.14",
60+
"@types/lodash": "^4.17.16",
6161
"@types/node": "^20.12.11",
6262
"@vercel/ncc": "^0.38.3",
6363
"f2elint": "^2.2.1",
@@ -73,6 +73,9 @@
7373
"resolutions": {
7474
"@alicloud/sls20191023": {
7575
"registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
76+
},
77+
"@alicloud/fc20230330": {
78+
"registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
7679
}
7780
}
7881
}

src/interface/base.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ export enum Runtime {
3737
'dotnetcore2.1' = 'dotnetcore2.1',
3838
'custom.debian10' = 'custom.debian10',
3939
'custom.debian11' = 'custom.debian11',
40+
'custom.debian12' = 'custom.debian12',
4041
'custom' = 'custom',
4142
'custom-container' = 'custom-container',
4243
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
export interface IConcurrencyConfig {
2+
reservedConcurrency: number;
3+
}

src/interface/function.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export interface IFunction {
124124
cpu?: number;
125125
memorySize?: number;
126126
timeout?: number;
127+
sessionAffinity?: string;
127128

128129
logConfig?: 'auto' | ILogConfig;
129130
nasConfig?: 'auto' | INasConfig;

src/interface/index.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { IFunction } from './function';
33
import { ITrigger } from './trigger';
44
import { IRegion } from './region';
55
import { IAsyncInvokeConfig } from './async_invoke_config';
6+
import { IConcurrencyConfig } from './concurrency_config';
7+
import { IProvisionConfig } from './provison_config';
68

79
export * from './region';
810
export * from './function';
@@ -14,6 +16,8 @@ export interface IProps extends IFunction {
1416
region: IRegion;
1517
triggers?: ITrigger[];
1618
asyncInvokeConfig?: IAsyncInvokeConfig;
19+
concurrencyConfig?: IConcurrencyConfig;
20+
provisionConfig?: IProvisionConfig;
1721
endpoint?: string;
1822
}
1923

src/interface/provison_config.ts

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
export interface ScheduledAction {
2+
name: string;
3+
startTime: string;
4+
endTime: string;
5+
target: number;
6+
scheduleExpression: string;
7+
timeZone: string;
8+
}
9+
10+
export interface TargetTrackingPolicy {
11+
name: string;
12+
startTime: string;
13+
endTime: string;
14+
metricType: string;
15+
metricTarget: number;
16+
minCapacity: number;
17+
maxCapacity: number;
18+
timeZone: string;
19+
}
20+
21+
export interface IProvisionConfig {
22+
defaultTarget: number;
23+
alwaysAllocateCPU: boolean;
24+
alwaysAllocateGPU: boolean;
25+
scheduledActions: ScheduledAction[];
26+
targetTrackingPolicies: TargetTrackingPolicy[];
27+
}

src/resources/fc/impl/utils.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export function isCustomRuntime(runtime: string): boolean {
1212
return (
1313
runtime === Runtime.custom ||
1414
runtime === Runtime['custom.debian10'] ||
15-
runtime === Runtime['custom.debian11']
15+
runtime === Runtime['custom.debian11'] ||
16+
runtime === Runtime['custom.debian12']
1617
);
1718
}
1819

0 commit comments

Comments
 (0)