@geek-fun/serverlessinsight 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/package.json +35 -28
- package/dist/src/commands/deploy.js +3 -3
- package/dist/src/commands/destroy.js +6 -3
- package/dist/src/commands/index.js +35 -7
- package/dist/src/commands/template.js +2 -2
- package/dist/src/commands/validate.js +3 -2
- package/dist/src/common/base64.js +3 -1
- package/dist/src/common/constants.js +2 -1
- package/dist/src/common/context.js +51 -0
- package/dist/src/common/domainHelper.js +10 -0
- package/dist/src/common/iacHelper.js +55 -28
- package/dist/src/common/index.d.ts +3 -1
- package/dist/src/common/index.js +3 -1
- package/dist/src/common/rosAssets.js +177 -0
- package/dist/src/common/rosClient.js +6 -56
- package/dist/src/parser/bucketParser.js +35 -0
- package/dist/src/parser/eventParser.js +1 -0
- package/dist/src/parser/functionParser.js +11 -3
- package/dist/src/parser/index.js +2 -0
- package/dist/src/stack/deploy.js +30 -13
- package/dist/src/stack/rfsStack/function.js +3 -3
- package/dist/src/stack/rfsStack/index.d.ts +2 -2
- package/dist/src/stack/rfsStack/index.js +2 -1
- package/dist/src/stack/rosStack/bootstrap.js +5 -4
- package/dist/src/stack/rosStack/bucket.js +126 -0
- package/dist/src/stack/rosStack/database.js +10 -10
- package/dist/src/stack/rosStack/event.js +62 -55
- package/dist/src/stack/rosStack/function.js +175 -30
- package/dist/src/stack/rosStack/index.d.ts +2 -2
- package/dist/src/stack/rosStack/index.js +6 -3
- package/dist/src/stack/rosStack/stage.js +1 -1
- package/dist/src/stack/rosStack/tag.js +1 -1
- package/dist/src/stack/rosStack/vars.js +3 -3
- package/dist/src/types/domains/bucket.js +9 -0
- package/dist/src/types/domains/function.js +19 -0
- package/dist/src/types/index.d.ts +6 -0
- package/dist/src/types/index.js +1 -0
- package/dist/src/validator/bucketSchema.js +76 -0
- package/dist/src/validator/eventSchema.js +3 -7
- package/dist/src/validator/functionSchema.js +93 -19
- package/dist/src/validator/iacSchema.js +2 -0
- package/dist/src/validator/rootSchema.js +3 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +35 -28
- package/samples/{aliyun-poc-fc.yml → aliyun-poc-api.yml} +9 -20
- package/samples/aliyun-poc-bucket.yml +20 -0
- package/samples/aliyun-poc-domain.yml +23 -0
- package/samples/aliyun-poc-fc-gpu.yml +55 -0
- package/samples/huawei-poc-fc.yml +4 -3
- package/dist/src/common/actionContext.js +0 -31
|
@@ -19,20 +19,16 @@ exports.eventSchema = {
|
|
|
19
19
|
required: ['method', 'path', 'backend'],
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
|
-
|
|
22
|
+
domain: {
|
|
23
23
|
type: 'object',
|
|
24
|
+
additionalProperties: false,
|
|
25
|
+
required: ['domain_name'],
|
|
24
26
|
properties: {
|
|
25
27
|
domain_name: { type: 'string' },
|
|
26
28
|
certificate_name: { type: 'string' },
|
|
27
29
|
certificate_body: { type: 'string' },
|
|
28
30
|
certificate_private_key: { type: 'string' },
|
|
29
31
|
},
|
|
30
|
-
required: [
|
|
31
|
-
'domain_name',
|
|
32
|
-
'certificate_name',
|
|
33
|
-
'certificate_body',
|
|
34
|
-
'certificate_private_key',
|
|
35
|
-
],
|
|
36
32
|
},
|
|
37
33
|
},
|
|
38
34
|
required: ['name', 'type', 'triggers'],
|
|
@@ -7,31 +7,61 @@ exports.functionSchema = {
|
|
|
7
7
|
patternProperties: {
|
|
8
8
|
'.*': {
|
|
9
9
|
type: 'object',
|
|
10
|
-
required: ['name'
|
|
10
|
+
required: ['name'],
|
|
11
11
|
properties: {
|
|
12
12
|
name: { type: 'string' },
|
|
13
|
-
|
|
13
|
+
code: {
|
|
14
|
+
type: 'object',
|
|
15
|
+
required: ['runtime', 'handler', 'path'],
|
|
16
|
+
additionalProperties: false,
|
|
17
|
+
properties: {
|
|
18
|
+
runtime: {
|
|
19
|
+
type: 'string',
|
|
20
|
+
enum: [
|
|
21
|
+
'nodejs20',
|
|
22
|
+
'nodejs18',
|
|
23
|
+
'nodejs16',
|
|
24
|
+
'nodejs14',
|
|
25
|
+
'nodejs12',
|
|
26
|
+
'nodejs10',
|
|
27
|
+
'nodejs8',
|
|
28
|
+
'python3.10',
|
|
29
|
+
'python3.9',
|
|
30
|
+
'python3',
|
|
31
|
+
'PHP 7.2',
|
|
32
|
+
'Java 11',
|
|
33
|
+
'.NET Core 3.1',
|
|
34
|
+
'Go 1.x',
|
|
35
|
+
],
|
|
36
|
+
},
|
|
37
|
+
handler: { type: 'string' },
|
|
38
|
+
path: { type: 'string' },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
container: {
|
|
42
|
+
type: 'object',
|
|
43
|
+
required: ['image', 'port'],
|
|
44
|
+
additionalProperties: false,
|
|
45
|
+
properties: {
|
|
46
|
+
image: { type: 'string' },
|
|
47
|
+
cmd: { type: 'string' },
|
|
48
|
+
port: { type: 'number' },
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
memory: { type: 'number' },
|
|
52
|
+
gpu: {
|
|
14
53
|
type: 'string',
|
|
15
54
|
enum: [
|
|
16
|
-
'
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
20
|
-
'
|
|
21
|
-
'
|
|
22
|
-
'
|
|
23
|
-
'
|
|
24
|
-
'python3.9',
|
|
25
|
-
'python3',
|
|
26
|
-
'PHP 7.2',
|
|
27
|
-
'Java 11',
|
|
28
|
-
'.NET Core 3.1',
|
|
29
|
-
'Go 1.x',
|
|
55
|
+
'TESLA_8',
|
|
56
|
+
'TESLA_12',
|
|
57
|
+
'TESLA_16',
|
|
58
|
+
'AMPERE_8',
|
|
59
|
+
'AMPERE_12',
|
|
60
|
+
'AMPERE_16',
|
|
61
|
+
'AMPERE_24',
|
|
62
|
+
'ADA_48',
|
|
30
63
|
],
|
|
31
64
|
},
|
|
32
|
-
handler: { type: 'string' },
|
|
33
|
-
code: { type: 'string' },
|
|
34
|
-
memory: { type: 'number' },
|
|
35
65
|
timeout: { type: 'number' },
|
|
36
66
|
log: { type: 'boolean' },
|
|
37
67
|
environment: {
|
|
@@ -40,6 +70,50 @@ exports.functionSchema = {
|
|
|
40
70
|
type: ['string', 'number', 'boolean'],
|
|
41
71
|
},
|
|
42
72
|
},
|
|
73
|
+
network: {
|
|
74
|
+
type: 'object',
|
|
75
|
+
properties: {
|
|
76
|
+
vpc_id: { type: 'string' },
|
|
77
|
+
subnet_ids: { type: 'array', items: { type: 'string' } },
|
|
78
|
+
security_group: {
|
|
79
|
+
type: 'object',
|
|
80
|
+
properties: {
|
|
81
|
+
name: { type: 'string' },
|
|
82
|
+
ingress: { type: 'array', items: { type: 'string' } },
|
|
83
|
+
egress: { type: 'array', items: { type: 'string' } },
|
|
84
|
+
},
|
|
85
|
+
required: ['name', 'ingress'],
|
|
86
|
+
additionalProperties: false,
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
required: ['vpc_id', 'subnet_ids', 'security_group'],
|
|
90
|
+
},
|
|
91
|
+
storage: {
|
|
92
|
+
type: 'object',
|
|
93
|
+
properties: {
|
|
94
|
+
disk: { type: 'number' },
|
|
95
|
+
nas: {
|
|
96
|
+
type: 'array',
|
|
97
|
+
items: {
|
|
98
|
+
type: 'object',
|
|
99
|
+
properties: {
|
|
100
|
+
mount_path: { type: 'string' },
|
|
101
|
+
storage_class: {
|
|
102
|
+
type: 'string',
|
|
103
|
+
enum: [
|
|
104
|
+
'STANDARD_CAPACITY',
|
|
105
|
+
'STANDARD_PERFORMANCE',
|
|
106
|
+
'EXTREME_STANDARD',
|
|
107
|
+
'EXTREME_ADVANCE',
|
|
108
|
+
],
|
|
109
|
+
},
|
|
110
|
+
additionalProperties: false,
|
|
111
|
+
},
|
|
112
|
+
required: ['mount_path', 'storage_class'],
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
},
|
|
116
|
+
},
|
|
43
117
|
},
|
|
44
118
|
additionalProperties: false,
|
|
45
119
|
},
|
|
@@ -10,6 +10,7 @@ const rootSchema_1 = require("./rootSchema");
|
|
|
10
10
|
const databaseSchema_1 = require("./databaseSchema");
|
|
11
11
|
const eventSchema_1 = require("./eventSchema");
|
|
12
12
|
const functionSchema_1 = require("./functionSchema");
|
|
13
|
+
const bucketSchema_1 = require("./bucketSchema");
|
|
13
14
|
class IacSchemaErrors extends Error {
|
|
14
15
|
constructor(errors) {
|
|
15
16
|
super(`Invalid yaml`);
|
|
@@ -30,6 +31,7 @@ const validate = ajv
|
|
|
30
31
|
.addSchema(functionSchema_1.functionSchema)
|
|
31
32
|
.addSchema(eventSchema_1.eventSchema)
|
|
32
33
|
.addSchema(databaseSchema_1.databaseSchema)
|
|
34
|
+
.addSchema(bucketSchema_1.bucketSchema)
|
|
33
35
|
.compile(rootSchema_1.rootSchema);
|
|
34
36
|
const validateYaml = (iacJson) => {
|
|
35
37
|
const valid = validate(iacJson);
|
|
@@ -46,6 +46,9 @@ exports.rootSchema = {
|
|
|
46
46
|
databases: {
|
|
47
47
|
$ref: 'https://serverlessinsight.geekfun.club/schemas/databaseschema.json',
|
|
48
48
|
},
|
|
49
|
+
buckets: {
|
|
50
|
+
$ref: 'https://serverlessinsight.geekfun.club/schemas/bucketschema.json',
|
|
51
|
+
},
|
|
49
52
|
},
|
|
50
53
|
required: ['version', 'provider', 'service'],
|
|
51
54
|
additionalProperties: false,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/index.ts","../src/commands/template.ts","../src/commands/validate.ts","../src/common/
|
|
1
|
+
{"root":["../src/index.ts","../src/commands/deploy.ts","../src/commands/destroy.ts","../src/commands/index.ts","../src/commands/template.ts","../src/commands/validate.ts","../src/common/base64.ts","../src/common/constants.ts","../src/common/context.ts","../src/common/domainHelper.ts","../src/common/getVersion.ts","../src/common/iacHelper.ts","../src/common/imsClient.ts","../src/common/index.ts","../src/common/logger.ts","../src/common/providerEnum.ts","../src/common/rosAssets.ts","../src/common/rosClient.ts","../src/lang/index.ts","../src/parser/bucketParser.ts","../src/parser/databaseParser.ts","../src/parser/eventParser.ts","../src/parser/functionParser.ts","../src/parser/index.ts","../src/parser/tagParser.ts","../src/stack/deploy.ts","../src/stack/index.ts","../src/stack/rfsStack/function.ts","../src/stack/rfsStack/index.ts","../src/stack/rosStack/bootstrap.ts","../src/stack/rosStack/bucket.ts","../src/stack/rosStack/database.ts","../src/stack/rosStack/event.ts","../src/stack/rosStack/function.ts","../src/stack/rosStack/index.ts","../src/stack/rosStack/stage.ts","../src/stack/rosStack/tag.ts","../src/stack/rosStack/vars.ts","../src/types/assets.ts","../src/types/index.ts","../src/types/domains/bucket.ts","../src/types/domains/context.ts","../src/types/domains/database.ts","../src/types/domains/event.ts","../src/types/domains/function.ts","../src/types/domains/provider.ts","../src/types/domains/tag.ts","../src/types/domains/vars.ts","../src/validator/bucketSchema.ts","../src/validator/databaseSchema.ts","../src/validator/eventSchema.ts","../src/validator/functionSchema.ts","../src/validator/iacSchema.ts","../src/validator/index.ts","../src/validator/rootSchema.ts"],"version":"5.8.3"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geek-fun/serverlessinsight",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.1",
|
|
4
4
|
"description": "Full life cycle cross providers serverless application management for your fast-growing business.",
|
|
5
5
|
"homepage": "https://serverlessinsight.geekfun.club",
|
|
6
6
|
"main": "dist/src/index.js",
|
|
@@ -49,45 +49,52 @@
|
|
|
49
49
|
"function"
|
|
50
50
|
],
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@alicloud/ims20190815": "^2.
|
|
53
|
-
"@alicloud/openapi-client": "^0.4.
|
|
54
|
-
"@alicloud/ros-cdk-apigateway": "^1.
|
|
55
|
-
"@alicloud/ros-cdk-core": "^1.
|
|
56
|
-
"@alicloud/ros-cdk-
|
|
57
|
-
"@alicloud/ros-cdk-
|
|
58
|
-
"@alicloud/ros-cdk-
|
|
59
|
-
"@alicloud/ros-cdk-
|
|
60
|
-
"@alicloud/ros-cdk-
|
|
61
|
-
"@alicloud/ros-cdk-
|
|
62
|
-
"@alicloud/ros-cdk-
|
|
63
|
-
"@alicloud/
|
|
52
|
+
"@alicloud/ims20190815": "^2.2.0",
|
|
53
|
+
"@alicloud/openapi-client": "^0.4.14",
|
|
54
|
+
"@alicloud/ros-cdk-apigateway": "^1.8.0",
|
|
55
|
+
"@alicloud/ros-cdk-core": "^1.8.0",
|
|
56
|
+
"@alicloud/ros-cdk-dns": "^1.8.0",
|
|
57
|
+
"@alicloud/ros-cdk-ecs": "^1.8.0",
|
|
58
|
+
"@alicloud/ros-cdk-elasticsearchserverless": "^1.8.0",
|
|
59
|
+
"@alicloud/ros-cdk-fc3": "^1.8.0",
|
|
60
|
+
"@alicloud/ros-cdk-nas": "^1.8.0",
|
|
61
|
+
"@alicloud/ros-cdk-oss": "^1.8.0",
|
|
62
|
+
"@alicloud/ros-cdk-ossdeployment": "^1.8.0",
|
|
63
|
+
"@alicloud/ros-cdk-ram": "^1.8.0",
|
|
64
|
+
"@alicloud/ros-cdk-rds": "^1.8.0",
|
|
65
|
+
"@alicloud/ros-cdk-sls": "^1.8.0",
|
|
66
|
+
"@alicloud/ros-cdk-vpc": "^1.8.0",
|
|
67
|
+
"@alicloud/ros20190910": "^3.5.6",
|
|
64
68
|
"ajv": "^8.17.1",
|
|
65
69
|
"ali-oss": "^6.22.0",
|
|
66
|
-
"chalk": "^5.
|
|
67
|
-
"commander": "^
|
|
70
|
+
"chalk": "^5.4.1",
|
|
71
|
+
"commander": "^13.1.0",
|
|
72
|
+
"i": "^0.3.7",
|
|
68
73
|
"i18n": "^0.15.1",
|
|
74
|
+
"jszip": "^3.10.1",
|
|
69
75
|
"lodash": "^4.17.21",
|
|
70
|
-
"
|
|
76
|
+
"npm": "^11.2.0",
|
|
77
|
+
"pino": "^9.6.0",
|
|
71
78
|
"pino-pretty": "^13.0.0",
|
|
72
|
-
"yaml": "^2.
|
|
79
|
+
"yaml": "^2.7.1"
|
|
73
80
|
},
|
|
74
81
|
"devDependencies": {
|
|
75
82
|
"@types/ali-oss": "^6.16.11",
|
|
76
83
|
"@types/i18n": "^0.13.12",
|
|
77
84
|
"@types/jest": "^29.5.14",
|
|
78
|
-
"@types/lodash": "^4.17.
|
|
79
|
-
"@types/node": "^22.
|
|
80
|
-
"@typescript-eslint/eslint-plugin": "^8.
|
|
81
|
-
"@typescript-eslint/parser": "^8.
|
|
82
|
-
"eslint": "^9.
|
|
83
|
-
"eslint-config-prettier": "^
|
|
84
|
-
"eslint-plugin-prettier": "^5.2.
|
|
85
|
-
"globals": "^
|
|
85
|
+
"@types/lodash": "^4.17.16",
|
|
86
|
+
"@types/node": "^22.14.0",
|
|
87
|
+
"@typescript-eslint/eslint-plugin": "^8.29.0",
|
|
88
|
+
"@typescript-eslint/parser": "^8.29.0",
|
|
89
|
+
"eslint": "^9.24.0",
|
|
90
|
+
"eslint-config-prettier": "^10.1.1",
|
|
91
|
+
"eslint-plugin-prettier": "^5.2.6",
|
|
92
|
+
"globals": "^16.0.0",
|
|
86
93
|
"husky": "^9.1.7",
|
|
87
94
|
"jest": "^29.7.0",
|
|
88
|
-
"prettier": "^3.
|
|
89
|
-
"ts-jest": "^29.
|
|
95
|
+
"prettier": "^3.5.3",
|
|
96
|
+
"ts-jest": "^29.3.1",
|
|
90
97
|
"ts-node": "^10.9.2",
|
|
91
|
-
"typescript": "^5.
|
|
98
|
+
"typescript": "^5.8.3"
|
|
92
99
|
}
|
|
93
100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
version: 0.0.1
|
|
2
2
|
provider:
|
|
3
3
|
name: aliyun
|
|
4
|
-
region: cn-
|
|
4
|
+
region: cn-hongkong
|
|
5
5
|
|
|
6
6
|
vars:
|
|
7
7
|
region: cn-hangzhou
|
|
@@ -18,17 +18,18 @@ stages:
|
|
|
18
18
|
prod:
|
|
19
19
|
region: cn-shanghai
|
|
20
20
|
|
|
21
|
-
service: insight-poc
|
|
21
|
+
service: insight-poc-api
|
|
22
22
|
|
|
23
23
|
tags:
|
|
24
24
|
owner: geek-fun
|
|
25
25
|
|
|
26
26
|
functions:
|
|
27
27
|
insight_poc_fn:
|
|
28
|
-
name: insight-poc-fn
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
name: insight-poc-api-fn
|
|
29
|
+
code:
|
|
30
|
+
runtime: nodejs18
|
|
31
|
+
handler: ${vars.handler}
|
|
32
|
+
path: tests/fixtures/artifacts/artifact.zip
|
|
32
33
|
memory: 512
|
|
33
34
|
timeout: 10
|
|
34
35
|
environment:
|
|
@@ -36,15 +37,6 @@ functions:
|
|
|
36
37
|
TEST_VAR: ${vars.testv}
|
|
37
38
|
TEST_VAR_EXTRA: abcds-${vars.testv}-andyou
|
|
38
39
|
|
|
39
|
-
databases:
|
|
40
|
-
insight_poc_db:
|
|
41
|
-
name: insight-poc-db
|
|
42
|
-
type: RDS_POSTGRESQL_SERVERLESS
|
|
43
|
-
version: '17.0'
|
|
44
|
-
security:
|
|
45
|
-
basic_auth:
|
|
46
|
-
password: 'U34I6InQ8elseTgqTWT2t2oFXpoqFg'
|
|
47
|
-
|
|
48
40
|
events:
|
|
49
41
|
gateway_event:
|
|
50
42
|
type: API_GATEWAY
|
|
@@ -53,8 +45,5 @@ events:
|
|
|
53
45
|
- method: GET
|
|
54
46
|
path: /api/hello
|
|
55
47
|
backend: ${functions.insight_poc_fn}
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
# certificate_name: test
|
|
59
|
-
# certificate_private_key: test
|
|
60
|
-
# certificate_body: test
|
|
48
|
+
domain:
|
|
49
|
+
domain_name: insight-api.serverlessinsight.com
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
version: 0.0.1
|
|
2
|
+
|
|
3
|
+
provider:
|
|
4
|
+
name: aliyun
|
|
5
|
+
region: cn-chengdu
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service: insight-bucket-poc
|
|
9
|
+
|
|
10
|
+
tags:
|
|
11
|
+
owner: geek-fun
|
|
12
|
+
|
|
13
|
+
buckets:
|
|
14
|
+
insight_poc_bucket:
|
|
15
|
+
name: insight-poc-bucket
|
|
16
|
+
website:
|
|
17
|
+
code: dist
|
|
18
|
+
index: index.html
|
|
19
|
+
error_page: 404.html
|
|
20
|
+
error_code: 404
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
version: 0.0.1
|
|
2
|
+
|
|
3
|
+
provider:
|
|
4
|
+
name: aliyun
|
|
5
|
+
region: cn-hongkong
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
service: insight-poc-domain
|
|
9
|
+
|
|
10
|
+
tags:
|
|
11
|
+
owner: geek-fun
|
|
12
|
+
|
|
13
|
+
buckets:
|
|
14
|
+
insight_poc_bucket:
|
|
15
|
+
name: insight-poc-domain
|
|
16
|
+
security:
|
|
17
|
+
acl: PUBLIC_READ
|
|
18
|
+
website:
|
|
19
|
+
code: dist
|
|
20
|
+
domain: meke-ui.serverlessinsight.com
|
|
21
|
+
index: index.html
|
|
22
|
+
error_page: 404.html
|
|
23
|
+
error_code: 404
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
version: 0.0.1
|
|
2
|
+
provider:
|
|
3
|
+
name: aliyun
|
|
4
|
+
region: cn-hangzhou
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
service: insight-poc-gpu
|
|
8
|
+
|
|
9
|
+
tags:
|
|
10
|
+
owner: geek-fun
|
|
11
|
+
|
|
12
|
+
functions:
|
|
13
|
+
insight_poc_fn:
|
|
14
|
+
name: insight-poc-gpu-fn
|
|
15
|
+
container:
|
|
16
|
+
image: registry.cn-hangzhou.aliyuncs.com/serverless_devs/modelscope:ubuntu20.04-cuda11.3.0-py37-torch1.11.0-tf1.15.5-1.5.0
|
|
17
|
+
cmd: "ollama run modelscope.cn/DeepSeek-R1-Distill-Qwen-1.5B-GGUF"
|
|
18
|
+
port: 9000
|
|
19
|
+
memory: 4096
|
|
20
|
+
gpu: TESLA_16
|
|
21
|
+
timeout: 900
|
|
22
|
+
log: true
|
|
23
|
+
network:
|
|
24
|
+
vpc_id: vpc-bp1jpzq0807mrww7i8uko
|
|
25
|
+
subnet_ids:
|
|
26
|
+
- vsw-bp1tp32pxn8c3mm07e9s2
|
|
27
|
+
- vsw-bp1gs2ggjq85apbf5yd9d
|
|
28
|
+
security_group:
|
|
29
|
+
name: insight-poc-gpu-fn-sg
|
|
30
|
+
ingress:
|
|
31
|
+
- TCP:0.0.0.0/0:80
|
|
32
|
+
- TCP:0.0.0.0/0:443
|
|
33
|
+
- TCP:0.0.0.0/0:22/22
|
|
34
|
+
- ICMP:0.0.0.0/0:ALL
|
|
35
|
+
egress:
|
|
36
|
+
- ALL:0.0.0.0/0:ALL
|
|
37
|
+
storage:
|
|
38
|
+
nas:
|
|
39
|
+
- mount_path: /mnt/nas
|
|
40
|
+
storage_class: STANDARD_CAPACITY
|
|
41
|
+
environment:
|
|
42
|
+
OLLAMA_MODELS: /mnt/nas/models
|
|
43
|
+
LLAMA_GPU_OVERHEAD: 0
|
|
44
|
+
OLLAMA_HOST: http://0.0.0.0:11434
|
|
45
|
+
OLLAMA_INTEL_GPU: false
|
|
46
|
+
OLLAMA_KEEP_ALIVE: 2562047h47m16.854775807s
|
|
47
|
+
OLLAMA_LOAD_TIMEOUT: 5m0s
|
|
48
|
+
OLLAMA_MAX_LOADED_MODELS: 1
|
|
49
|
+
OLLAMA_MAX_QUEUE: 1
|
|
50
|
+
OLLAMA_MULTIUSER_CACHE: false
|
|
51
|
+
OLLAMA_NOHISTORY: false
|
|
52
|
+
OLLAMA_NOPRUNE: false
|
|
53
|
+
OLLAMA_NUM_PARALLEL: 1
|
|
54
|
+
OLLAMA_ORIGINS: [ * http://localhost https://localhost http://localhost:* https://localhost:* http://127.0.0.1 https://127.0.0.1 http://127.0.0.1:* https://127.0.0.1:* http://0.0.0.0 https://0.0.0.0 http://0.0.0.0:* https://0.0.0.0:* app://* file://* tauri://* vscode-webview://* ]
|
|
55
|
+
OLLAMA_SCHED_SPREAD: fals
|
|
@@ -23,9 +23,10 @@ tags:
|
|
|
23
23
|
functions:
|
|
24
24
|
insight_poc_fn:
|
|
25
25
|
name: insight-poc-fn
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
26
|
+
code:
|
|
27
|
+
runtime: nodejs18
|
|
28
|
+
handler: ${vars.handler}
|
|
29
|
+
path: tests/fixtures/artifacts/artifact.zip
|
|
29
30
|
memory: 512
|
|
30
31
|
timeout: 10
|
|
31
32
|
environment:
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.constructActionContext = exports.getIacLocation = void 0;
|
|
7
|
-
const node_path_1 = __importDefault(require("node:path"));
|
|
8
|
-
const getIacLocation = (location) => {
|
|
9
|
-
const projectRoot = node_path_1.default.resolve(process.cwd());
|
|
10
|
-
return location
|
|
11
|
-
? node_path_1.default.resolve(projectRoot, location)
|
|
12
|
-
: node_path_1.default.resolve(projectRoot, 'serverlessinsight.yml') ||
|
|
13
|
-
node_path_1.default.resolve(projectRoot, 'serverlessInsight.yml') ||
|
|
14
|
-
node_path_1.default.resolve(projectRoot, 'ServerlessInsight.yml') ||
|
|
15
|
-
node_path_1.default.resolve(projectRoot, 'serverless-insight.yml');
|
|
16
|
-
};
|
|
17
|
-
exports.getIacLocation = getIacLocation;
|
|
18
|
-
const constructActionContext = (config) => {
|
|
19
|
-
return {
|
|
20
|
-
stage: config?.stage ?? 'default',
|
|
21
|
-
stackName: config?.stackName ?? '',
|
|
22
|
-
region: config?.region ?? process.env.ROS_REGION_ID ?? process.env.ALIYUN_REGION ?? 'cn-hangzhou',
|
|
23
|
-
accessKeyId: config?.accessKeyId ?? process.env.ALIYUN_ACCESS_KEY_ID,
|
|
24
|
-
accessKeySecret: config?.accessKeySecret ?? process.env.ALIYUN_ACCESS_KEY_SECRET,
|
|
25
|
-
securityToken: config?.securityToken ?? process.env.ALIYUN_SECURITY_TOKEN,
|
|
26
|
-
iacLocation: (0, exports.getIacLocation)(config?.location),
|
|
27
|
-
parameters: Object.entries(config?.parameters ?? {}).map(([key, value]) => ({ key, value })),
|
|
28
|
-
provider: config?.provider,
|
|
29
|
-
};
|
|
30
|
-
};
|
|
31
|
-
exports.constructActionContext = constructActionContext;
|