peak-sdk 1.12.0__py3-none-any.whl → 1.14.0__py3-none-any.whl
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.
- peak/_metadata.py +3 -0
- peak/_version.py +1 -1
- peak/cli/press/apps/deployments.py +12 -6
- peak/cli/press/apps/specs.py +20 -0
- peak/cli/press/blocks/deployments.py +5 -6
- peak/cli/press/deployments.py +49 -3
- peak/cli/resources/alerts/emails.py +8 -4
- peak/cli/resources/artifacts.py +6 -0
- peak/handler.py +56 -16
- peak/metrics/metrics.py +1 -1
- peak/press/apps.py +100 -5
- peak/press/deployments.py +35 -0
- peak/resources/alerts.py +10 -2
- peak/resources/artifacts.py +39 -3
- peak/sample_yaml/press/apps/deployments/create_app_deployment.yaml +12 -0
- peak/sample_yaml/press/apps/deployments/create_app_deployment_revision.yaml +12 -0
- peak/sample_yaml/press/apps/specs/create_app_spec.yaml +63 -0
- peak/sample_yaml/press/apps/specs/create_app_spec_release.yaml +63 -0
- peak/sample_yaml/press/blocks/specs/service/api/create_block_spec.yaml +28 -28
- peak/sample_yaml/press/blocks/specs/service/api/create_block_spec_release.yaml +28 -28
- peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec.yaml +28 -28
- peak/sample_yaml/press/blocks/specs/service/webapp/create_block_spec_release.yaml +28 -28
- peak/sample_yaml/press/blocks/specs/workflow/create_block_spec.yaml +32 -32
- peak/sample_yaml/press/blocks/specs/workflow/create_block_spec_release.yaml +32 -32
- peak/sample_yaml/press/patch_parameters.yaml +9 -0
- peak/sample_yaml/resources/artifacts/create_artifact.yaml +3 -0
- peak/sample_yaml/resources/artifacts/create_artifact_version.yaml +2 -0
- peak/sample_yaml/resources/emails/send_email.yaml +3 -0
- peak/session.py +4 -1
- peak/telemetry.py +4 -1
- {peak_sdk-1.12.0.dist-info → peak_sdk-1.14.0.dist-info}/METADATA +3 -3
- {peak_sdk-1.12.0.dist-info → peak_sdk-1.14.0.dist-info}/RECORD +35 -34
- {peak_sdk-1.12.0.dist-info → peak_sdk-1.14.0.dist-info}/LICENSE +0 -0
- {peak_sdk-1.12.0.dist-info → peak_sdk-1.14.0.dist-info}/WHEEL +0 -0
- {peak_sdk-1.12.0.dist-info → peak_sdk-1.14.0.dist-info}/entry_points.txt +0 -0
@@ -26,16 +26,18 @@ body:
|
|
26
26
|
minInstances: 1
|
27
27
|
parameters:
|
28
28
|
build:
|
29
|
-
-
|
30
|
-
|
31
|
-
name: health_check_url
|
29
|
+
- name: health_check_url
|
30
|
+
type: string
|
32
31
|
required: true
|
33
32
|
title: Health Check URL
|
34
|
-
|
33
|
+
description: Enter the health check URL
|
34
|
+
defaultValue: /health
|
35
35
|
hideValue: false
|
36
|
-
-
|
36
|
+
- name: instance_type_id
|
37
|
+
type: number
|
38
|
+
required: true
|
39
|
+
title: Instance Type ID
|
37
40
|
description: Select an instance type
|
38
|
-
name: instance_type_id
|
39
41
|
options:
|
40
42
|
- title: Pico (0.125CPU, 0.125GB RAM)
|
41
43
|
value: 20
|
@@ -43,26 +45,26 @@ parameters:
|
|
43
45
|
value: 21
|
44
46
|
- title: Micro (0.5CPU, 1GB RAM)
|
45
47
|
value: 22
|
46
|
-
|
47
|
-
title: Instance Type ID
|
48
|
-
type: number
|
48
|
+
defaultValue: 20
|
49
49
|
run:
|
50
|
-
-
|
51
|
-
|
52
|
-
name: agg_type
|
50
|
+
- name: agg_type
|
51
|
+
type: string
|
53
52
|
required: false
|
54
53
|
title: Agg Type
|
55
|
-
|
54
|
+
description: Select an aggregation function (e.g., AVG, SUM, COUNT)
|
55
|
+
defaultValue: AVG
|
56
56
|
hideValue: true
|
57
|
-
-
|
58
|
-
|
59
|
-
name: email_notifications
|
57
|
+
- name: email_notifications
|
58
|
+
type: boolean
|
60
59
|
required: false
|
61
60
|
title: Email Notifications
|
62
|
-
|
63
|
-
|
61
|
+
description: Enable email notifications
|
62
|
+
defaultValue: false
|
63
|
+
- name: num_iterations
|
64
|
+
type: number
|
65
|
+
required: false
|
66
|
+
title: Number of Iterations
|
64
67
|
description: Select the number of iterations
|
65
|
-
name: num_iterations
|
66
68
|
options:
|
67
69
|
- title: Low
|
68
70
|
value: 10
|
@@ -70,17 +72,15 @@ parameters:
|
|
70
72
|
value: 50
|
71
73
|
- title: High
|
72
74
|
value: 100
|
73
|
-
|
74
|
-
|
75
|
-
type:
|
76
|
-
- defaultValue:
|
77
|
-
- input.csv
|
78
|
-
- output.csv
|
79
|
-
description: Specify input and output file names
|
80
|
-
name: file_names
|
75
|
+
defaultValue: 10
|
76
|
+
- name: file_names
|
77
|
+
type: string_array
|
81
78
|
required: true
|
82
79
|
title: File Names
|
83
|
-
|
80
|
+
description: Specify input and output file names
|
81
|
+
defaultValue:
|
82
|
+
- input.csv
|
83
|
+
- output.csv
|
84
84
|
artifact:
|
85
85
|
path: "."
|
86
86
|
ignore_files:
|
@@ -37,16 +37,18 @@ body:
|
|
37
37
|
minInstances: 1
|
38
38
|
parameters:
|
39
39
|
build:
|
40
|
-
-
|
41
|
-
|
42
|
-
name: health_check_url
|
40
|
+
- name: health_check_url
|
41
|
+
type: string
|
43
42
|
required: true
|
44
43
|
title: Health Check URL
|
45
|
-
|
44
|
+
description: Enter the health check URL
|
45
|
+
defaultValue: /health
|
46
46
|
hideValue: false
|
47
|
-
-
|
47
|
+
- name: instance_type_id
|
48
|
+
type: number
|
49
|
+
required: true
|
50
|
+
title: Instance Type ID
|
48
51
|
description: Select an instance type
|
49
|
-
name: instance_type_id
|
50
52
|
options:
|
51
53
|
- title: Pico (0.25CPU, 0.5GB RAM)
|
52
54
|
value: 43
|
@@ -54,26 +56,26 @@ parameters:
|
|
54
56
|
value: 44
|
55
57
|
- title: Micro (0.5CPU, 1GB RAM)
|
56
58
|
value: 45
|
57
|
-
|
58
|
-
title: Instance Type ID
|
59
|
-
type: number
|
59
|
+
defaultValue: 43
|
60
60
|
run:
|
61
|
-
-
|
62
|
-
|
63
|
-
name: agg_type
|
61
|
+
- name: agg_type
|
62
|
+
type: string
|
64
63
|
required: false
|
65
64
|
title: Agg Type
|
66
|
-
|
65
|
+
description: Select an aggregation function (e.g., AVG, SUM, COUNT)
|
66
|
+
defaultValue: AVG
|
67
67
|
hideValue: true
|
68
|
-
-
|
69
|
-
|
70
|
-
name: email_notifications
|
68
|
+
- name: email_notifications
|
69
|
+
type: boolean
|
71
70
|
required: false
|
72
71
|
title: Email Notifications
|
73
|
-
|
74
|
-
|
72
|
+
description: Enable email notifications
|
73
|
+
defaultValue: false
|
74
|
+
- name: num_iterations
|
75
|
+
type: number
|
76
|
+
required: false
|
77
|
+
title: Number of Iterations
|
75
78
|
description: Select the number of iterations
|
76
|
-
name: num_iterations
|
77
79
|
options:
|
78
80
|
- title: Low
|
79
81
|
value: 10
|
@@ -81,17 +83,15 @@ parameters:
|
|
81
83
|
value: 50
|
82
84
|
- title: High
|
83
85
|
value: 100
|
84
|
-
|
85
|
-
|
86
|
-
type:
|
87
|
-
- defaultValue:
|
88
|
-
- input.csv
|
89
|
-
- output.csv
|
90
|
-
description: Specify input and output file names
|
91
|
-
name: file_names
|
86
|
+
defaultValue: 10
|
87
|
+
- name: file_names
|
88
|
+
type: string_array
|
92
89
|
required: true
|
93
90
|
title: File Names
|
94
|
-
|
91
|
+
description: Specify input and output file names
|
92
|
+
defaultValue:
|
93
|
+
- input.csv
|
94
|
+
- output.csv
|
95
95
|
artifact:
|
96
96
|
path: "."
|
97
97
|
ignore_files:
|
@@ -28,16 +28,18 @@ body:
|
|
28
28
|
minInstances: 1
|
29
29
|
parameters:
|
30
30
|
build:
|
31
|
-
-
|
32
|
-
|
33
|
-
name: health_check_url
|
31
|
+
- name: health_check_url
|
32
|
+
type: string
|
34
33
|
required: true
|
35
34
|
title: Health Check URL
|
36
|
-
|
35
|
+
description: Enter the health check URL
|
36
|
+
defaultValue: /health
|
37
37
|
hideValue: false
|
38
|
-
-
|
38
|
+
- name: instance_type_id
|
39
|
+
type: number
|
40
|
+
required: true
|
41
|
+
title: Instance Type ID
|
39
42
|
description: Select an instance type
|
40
|
-
name: instance_type_id
|
41
43
|
options:
|
42
44
|
- title: Pico (0.25CPU, 0.5GB RAM)
|
43
45
|
value: 43
|
@@ -45,26 +47,26 @@ parameters:
|
|
45
47
|
value: 44
|
46
48
|
- title: Micro (0.5CPU, 1GB RAM)
|
47
49
|
value: 45
|
48
|
-
|
49
|
-
title: Instance Type ID
|
50
|
-
type: number
|
50
|
+
defaultValue: 43
|
51
51
|
run:
|
52
|
-
-
|
53
|
-
|
54
|
-
name: agg_type
|
52
|
+
- name: agg_type
|
53
|
+
type: string
|
55
54
|
required: false
|
56
55
|
title: Agg Type
|
57
|
-
|
56
|
+
description: Select an aggregation function (e.g., AVG, SUM, COUNT)
|
57
|
+
defaultValue: AVG
|
58
58
|
hideValue: true
|
59
|
-
-
|
60
|
-
|
61
|
-
name: email_notifications
|
59
|
+
- name: email_notifications
|
60
|
+
type: boolean
|
62
61
|
required: false
|
63
62
|
title: Email Notifications
|
64
|
-
|
65
|
-
|
63
|
+
description: Enable email notifications
|
64
|
+
defaultValue: false
|
65
|
+
- name: num_iterations
|
66
|
+
type: number
|
67
|
+
required: false
|
68
|
+
title: Number of Iterations
|
66
69
|
description: Select the number of iterations
|
67
|
-
name: num_iterations
|
68
70
|
options:
|
69
71
|
- title: Low
|
70
72
|
value: 10
|
@@ -72,17 +74,15 @@ parameters:
|
|
72
74
|
value: 50
|
73
75
|
- title: High
|
74
76
|
value: 100
|
75
|
-
|
76
|
-
|
77
|
-
type:
|
78
|
-
- defaultValue:
|
79
|
-
- input.csv
|
80
|
-
- output.csv
|
81
|
-
description: Specify input and output file names
|
82
|
-
name: file_names
|
77
|
+
defaultValue: 10
|
78
|
+
- name: file_names
|
79
|
+
type: string_array
|
83
80
|
required: true
|
84
81
|
title: File Names
|
85
|
-
|
82
|
+
description: Specify input and output file names
|
83
|
+
defaultValue:
|
84
|
+
- input.csv
|
85
|
+
- output.csv
|
86
86
|
artifact:
|
87
87
|
path: "."
|
88
88
|
ignore_files:
|
@@ -111,22 +111,24 @@ body:
|
|
111
111
|
runtimeExceeded: "@param:runtime_exceeded"
|
112
112
|
parameters:
|
113
113
|
build:
|
114
|
-
-
|
115
|
-
|
116
|
-
name: watcher_user
|
114
|
+
- name: watcher_user
|
115
|
+
type: string
|
117
116
|
required: true
|
118
117
|
title: Watcher User Email
|
119
|
-
|
118
|
+
description: Set the watcher user email
|
119
|
+
defaultValue: user@peak.ai
|
120
120
|
hideValue: false
|
121
|
-
-
|
122
|
-
|
123
|
-
name: use_cache
|
121
|
+
- name: use_cache
|
122
|
+
type: boolean
|
124
123
|
required: false
|
125
124
|
title: Image Caching
|
126
|
-
|
127
|
-
|
125
|
+
description: Enable image caching for the workflow
|
126
|
+
defaultValue: false
|
127
|
+
- name: runtime_exceeded
|
128
|
+
type: number
|
129
|
+
required: false
|
130
|
+
title: Runtime Exceeded
|
128
131
|
description: Select the runtime exceeded value to trigger a failed notification for the workflow (in minutes)
|
129
|
-
name: runtime_exceeded
|
130
132
|
options:
|
131
133
|
- title: Low
|
132
134
|
value: 10
|
@@ -134,26 +136,26 @@ parameters:
|
|
134
136
|
value: 50
|
135
137
|
- title: High
|
136
138
|
value: 100
|
137
|
-
|
138
|
-
title: Runtime Exceeded
|
139
|
-
type: number
|
139
|
+
defaultValue: 10
|
140
140
|
run:
|
141
|
-
-
|
142
|
-
|
143
|
-
name: agg_type
|
141
|
+
- name: agg_type
|
142
|
+
type: string
|
144
143
|
required: false
|
145
144
|
title: Agg Type
|
146
|
-
|
145
|
+
description: Select an aggregation function (e.g., AVG, SUM, COUNT)
|
146
|
+
defaultValue: AVG
|
147
147
|
hideValue: true
|
148
|
-
-
|
149
|
-
|
150
|
-
name: email_notifications
|
148
|
+
- name: email_notifications
|
149
|
+
type: boolean
|
151
150
|
required: false
|
152
151
|
title: Email Notifications
|
153
|
-
|
154
|
-
|
152
|
+
description: Enable email notifications
|
153
|
+
defaultValue: false
|
154
|
+
- name: num_iterations
|
155
|
+
type: number
|
156
|
+
required: false
|
157
|
+
title: Number of Iterations
|
155
158
|
description: Select the number of iterations
|
156
|
-
name: num_iterations
|
157
159
|
options:
|
158
160
|
- title: Low
|
159
161
|
value: 10
|
@@ -161,17 +163,15 @@ parameters:
|
|
161
163
|
value: 50
|
162
164
|
- title: High
|
163
165
|
value: 100
|
164
|
-
|
165
|
-
|
166
|
-
type:
|
167
|
-
- defaultValue:
|
168
|
-
- input.csv
|
169
|
-
- output.csv
|
170
|
-
description: Specify input and output file names
|
171
|
-
name: file_names
|
166
|
+
defaultValue: 10
|
167
|
+
- name: file_names
|
168
|
+
type: string_array
|
172
169
|
required: true
|
173
170
|
title: File Names
|
174
|
-
|
171
|
+
description: Specify input and output file names
|
172
|
+
defaultValue:
|
173
|
+
- input.csv
|
174
|
+
- output.csv
|
175
175
|
artifact:
|
176
176
|
path: "."
|
177
177
|
ignore_files:
|
@@ -100,22 +100,24 @@ body:
|
|
100
100
|
runtimeExceeded: "@param:runtime_exceeded"
|
101
101
|
parameters:
|
102
102
|
build:
|
103
|
-
-
|
104
|
-
|
105
|
-
name: watcher_user
|
103
|
+
- name: watcher_user
|
104
|
+
type: string
|
106
105
|
required: true
|
107
106
|
title: Watcher User Email
|
108
|
-
|
107
|
+
description: Set the watcher user email
|
108
|
+
defaultValue: user@peak.ai
|
109
109
|
hideValue: false
|
110
|
-
-
|
111
|
-
|
112
|
-
name: use_cache
|
110
|
+
- name: use_cache
|
111
|
+
type: boolean
|
113
112
|
required: false
|
114
113
|
title: Image Caching
|
115
|
-
|
116
|
-
|
114
|
+
description: Enable image caching for the workflow
|
115
|
+
defaultValue: false
|
116
|
+
- name: runtime_exceeded
|
117
|
+
type: number
|
118
|
+
required: false
|
119
|
+
title: Runtime Exceeded
|
117
120
|
description: Select the runtime exceeded value to trigger a failed notification for the workflow (in minutes)
|
118
|
-
name: runtime_exceeded
|
119
121
|
options:
|
120
122
|
- title: Low
|
121
123
|
value: 10
|
@@ -123,26 +125,26 @@ parameters:
|
|
123
125
|
value: 50
|
124
126
|
- title: High
|
125
127
|
value: 100
|
126
|
-
|
127
|
-
title: Runtime Exceeded
|
128
|
-
type: number
|
128
|
+
defaultValue: 10
|
129
129
|
run:
|
130
|
-
-
|
131
|
-
|
132
|
-
name: agg_type
|
130
|
+
- name: agg_type
|
131
|
+
type: string
|
133
132
|
required: false
|
134
133
|
title: Agg Type
|
135
|
-
|
134
|
+
description: Select an aggregation function (e.g., AVG, SUM, COUNT)
|
135
|
+
defaultValue: AVG
|
136
136
|
hideValue: true
|
137
|
-
-
|
138
|
-
|
139
|
-
name: email_notifications
|
137
|
+
- name: email_notifications
|
138
|
+
type: boolean
|
140
139
|
required: false
|
141
140
|
title: Email Notifications
|
142
|
-
|
143
|
-
|
141
|
+
description: Enable email notifications
|
142
|
+
defaultValue: false
|
143
|
+
- name: num_iterations
|
144
|
+
type: number
|
145
|
+
required: false
|
146
|
+
title: Number of Iterations
|
144
147
|
description: Select the number of iterations
|
145
|
-
name: num_iterations
|
146
148
|
options:
|
147
149
|
- title: Low
|
148
150
|
value: 10
|
@@ -150,17 +152,15 @@ parameters:
|
|
150
152
|
value: 50
|
151
153
|
- title: High
|
152
154
|
value: 100
|
153
|
-
|
154
|
-
|
155
|
-
type:
|
156
|
-
- defaultValue:
|
157
|
-
- input.csv
|
158
|
-
- output.csv
|
159
|
-
description: Specify input and output file names
|
160
|
-
name: file_names
|
155
|
+
defaultValue: 10
|
156
|
+
- name: file_names
|
157
|
+
type: string_array
|
161
158
|
required: true
|
162
159
|
title: File Names
|
163
|
-
|
160
|
+
description: Specify input and output file names
|
161
|
+
defaultValue:
|
162
|
+
- input.csv
|
163
|
+
- output.csv
|
164
164
|
artifact:
|
165
165
|
path: "."
|
166
166
|
ignore_files:
|
peak/session.py
CHANGED
@@ -87,9 +87,10 @@ class Session:
|
|
87
87
|
*,
|
88
88
|
params: Optional[Dict[str, Any]] = None,
|
89
89
|
body: Optional[Dict[str, Any]] = None,
|
90
|
-
path: Optional[str] = None,
|
90
|
+
path: Optional[str | list[str]] = None,
|
91
91
|
ignore_files: Optional[list[str]] = None,
|
92
92
|
subdomain: Optional[str] = "service",
|
93
|
+
file_key: Optional[str] = "artifact",
|
93
94
|
) -> Any:
|
94
95
|
"""Prepares a request to be sent over the network.
|
95
96
|
|
@@ -105,6 +106,7 @@ class Session:
|
|
105
106
|
path (Optional[str] optional): path to the file or folder that will be compressed and used as artifact, required for multipart requests.
|
106
107
|
ignore_files(Optional[list[str]]): Ignore files to be used when creating artifact, used only for multipart requests.
|
107
108
|
subdomain (Optional[str]): Subdomain for the endpoint. Defaults to `service`.
|
109
|
+
file_key (Optional[str]): the field in which the files must be uploaded
|
108
110
|
|
109
111
|
Returns:
|
110
112
|
Any: response dict object.
|
@@ -124,6 +126,7 @@ class Session:
|
|
124
126
|
session_meta={
|
125
127
|
"stage": self.stage,
|
126
128
|
},
|
129
|
+
file_key=file_key,
|
127
130
|
).json()
|
128
131
|
|
129
132
|
def create_generator_request(
|
peak/telemetry.py
CHANGED
@@ -103,10 +103,11 @@ def telemetry(make_request: F) -> F:
|
|
103
103
|
headers: Optional[Dict[str, str]] = None,
|
104
104
|
params: Optional[Dict[str, Any]] = None,
|
105
105
|
body: Optional[Dict[str, Any]] = None,
|
106
|
-
path: Optional[str] = None,
|
106
|
+
path: Optional[str | list[str]] = None,
|
107
107
|
request_kwargs: Optional[Dict[str, int | bool | str | float]] = None,
|
108
108
|
ignore_files: Optional[list[str]] = None,
|
109
109
|
session_meta: Optional[Dict[str, Any]] = None,
|
110
|
+
file_key: Optional[str] = "artifact",
|
110
111
|
) -> requests.Response:
|
111
112
|
"""A decorator that wraps over the make_request function to send telemetry requests as required.
|
112
113
|
|
@@ -122,6 +123,7 @@ def telemetry(make_request: F) -> F:
|
|
122
123
|
request_kwargs(Dict[str, int | bool | str | float] | None): extra arguments to be passed when making the request.
|
123
124
|
ignore_files(Optional[list[str]]): Ignore files to be used when creating artifact
|
124
125
|
session_meta(Dict[str, Any]): Metadata about the session object, like - stage
|
126
|
+
file_key (Optional[str]): the field in which the files must be uploaded
|
125
127
|
|
126
128
|
Returns:
|
127
129
|
requests.Response: response json
|
@@ -192,6 +194,7 @@ def telemetry(make_request: F) -> F:
|
|
192
194
|
path=path,
|
193
195
|
ignore_files=ignore_files,
|
194
196
|
request_kwargs=request_kwargs,
|
197
|
+
file_key=file_key,
|
195
198
|
)
|
196
199
|
|
197
200
|
trigger_usage_collection(res=res)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.1
|
2
2
|
Name: peak-sdk
|
3
|
-
Version: 1.
|
3
|
+
Version: 1.14.0
|
4
4
|
Summary: Python SDK for interacting with the Peak platform
|
5
5
|
Home-page: https://docs.peak.ai/sdk/latest/
|
6
6
|
License: Apache-2.0
|
@@ -106,7 +106,7 @@ Follow these steps to create a virtual environment using Python's built-in `venv
|
|
106
106
|
This should return a response of the following format
|
107
107
|
|
108
108
|
```bash
|
109
|
-
peak-cli==1.
|
109
|
+
peak-cli==1.14.0
|
110
110
|
Python==3.12.3
|
111
111
|
System==Darwin(23.6.0)
|
112
112
|
```
|
@@ -122,7 +122,7 @@ Follow these steps to create a virtual environment using Python's built-in `venv
|
|
122
122
|
This should print the version of the SDK
|
123
123
|
|
124
124
|
```
|
125
|
-
1.
|
125
|
+
1.14.0
|
126
126
|
```
|
127
127
|
|
128
128
|
### Using the SDK and CLI
|