We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d8a7e03 commit f95eeceCopy full SHA for f95eece
16 files changed
__tests__/it/integration_test.ts
@@ -30,7 +30,7 @@ const inputs: IInputs = {
30
},
31
// 执行的方法
32
command: 'deploy',
33
- args: ['-t', 's.yaml'],
+ args: ['-t', 's.yaml', '--assume-yes'],
34
// yaml相关信息
35
yaml: {
36
path: path.join(__dirname, 's.yaml'),
@@ -86,8 +86,14 @@ describe('Integration Tests', () => {
86
role: '',
87
runtime: 'python3.9',
88
timeout: 60,
89
+ asyncInvokeConfig: undefined,
90
+ concurrencyConfig: undefined,
91
+ customDomain: undefined,
92
+ provisionConfig: undefined,
93
+ triggers: undefined,
94
+ vpcBinding: undefined,
95
});
- });
96
+ }, 60000);
97
98
test('deploy http function', async () => {
99
const inputs_http = _.cloneDeep(inputs);
@@ -132,6 +138,11 @@ describe('Integration Tests', () => {
132
138
triggerType: 'http',
133
139
134
140
],
141
142
143
144
145
135
146
136
147
137
148
__tests__/ut/subCommands_test.ts
@@ -245,7 +245,7 @@ describe('SYaml2To3', () => {
245
key1: 'value1',
246
key2: 'value2',
247
248
- gpuMemorySize: 'test',
+ gpuMemorySize: 16384,
249
asyncConfiguration: {
250
destination: {
251
onSuccess: 'acs:fc:::fc-test-on-success',
@@ -363,7 +363,7 @@ describe('SYaml2To3', () => {
363
ossBucket: 'test',
364
ossKey: 'test1',
365
environmentVariables: {},
366
367
368
destination: {},
369
@@ -494,7 +494,7 @@ describe('SYaml2To3', () => {
494
495
496
497
498
499
500
@@ -631,7 +631,7 @@ describe('SYaml2To3', () => {
631
632
633
634
635
636
637
package-lock.json
package.json
@@ -23,7 +23,7 @@
23
"license": "ISC",
24
"dependencies": {
25
"@alicloud/fc2": "^2.6.6",
26
- "@alicloud/fc20230330": "^4.1.6",
+ "@alicloud/fc20230330": "4.1.6-beta.2",
27
"@alicloud/pop-core": "^1.8.0",
28
"@serverless-cd/srm-aliyun-pop-core": "^0.0.7-beta.21",
29
"@serverless-cd/srm-aliyun-ram20150501": "^0.0.2-beta.9",
@@ -57,7 +57,7 @@
57
"@serverless-devs/component-interface": "^0.0.6",
58
"@serverless-devs/logger": "^0.0.5",
59
"@types/jest": "^29.5.14",
60
- "@types/lodash": "^4.17.14",
+ "@types/lodash": "^4.17.16",
61
"@types/node": "^20.12.11",
62
"@vercel/ncc": "^0.38.3",
63
"f2elint": "^2.2.1",
@@ -73,6 +73,9 @@
73
"resolutions": {
74
"@alicloud/sls20191023": {
75
"registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
76
+ },
77
+ "@alicloud/fc20230330": {
78
+ "registry": "https://packages.aliyun.com/670e108663cd360abfe4be65/npm/npm-registry/"
79
}
80
81
src/interface/base.ts
@@ -37,6 +37,7 @@ export enum Runtime {
37
'dotnetcore2.1' = 'dotnetcore2.1',
38
'custom.debian10' = 'custom.debian10',
39
'custom.debian11' = 'custom.debian11',
40
+ 'custom.debian12' = 'custom.debian12',
41
'custom' = 'custom',
42
'custom-container' = 'custom-container',
43
src/interface/concurrency_config.ts
@@ -0,0 +1,3 @@
1
+export interface IConcurrencyConfig {
2
+ reservedConcurrency: number;
3
+}
src/interface/function.ts
@@ -124,6 +124,7 @@ export interface IFunction {
124
cpu?: number;
125
memorySize?: number;
126
timeout?: number;
127
+ sessionAffinity?: string;
128
129
logConfig?: 'auto' | ILogConfig;
130
nasConfig?: 'auto' | INasConfig;
src/interface/index.ts
@@ -3,6 +3,8 @@ import { IFunction } from './function';
import { ITrigger } from './trigger';
4
import { IRegion } from './region';
5
import { IAsyncInvokeConfig } from './async_invoke_config';
6
+import { IConcurrencyConfig } from './concurrency_config';
7
+import { IProvisionConfig } from './provison_config';
8
9
export * from './region';
10
export * from './function';
@@ -14,6 +16,8 @@ export interface IProps extends IFunction {
14
16
region: IRegion;
15
17
triggers?: ITrigger[];
18
asyncInvokeConfig?: IAsyncInvokeConfig;
19
+ concurrencyConfig?: IConcurrencyConfig;
20
+ provisionConfig?: IProvisionConfig;
21
endpoint?: string;
22
src/interface/provison_config.ts
@@ -0,0 +1,27 @@
+export interface ScheduledAction {
+ name: string;
+ startTime: string;
+ endTime: string;
+ target: number;
+ scheduleExpression: string;
+ timeZone: string;
+
+export interface TargetTrackingPolicy {
11
12
13
+ metricType: string;
+ metricTarget: number;
+ minCapacity: number;
+ maxCapacity: number;
+export interface IProvisionConfig {
+ defaultTarget: number;
+ alwaysAllocateCPU: boolean;
+ alwaysAllocateGPU: boolean;
+ scheduledActions: ScheduledAction[];
+ targetTrackingPolicies: TargetTrackingPolicy[];
src/resources/fc/impl/utils.ts
@@ -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']
);
0 commit comments