-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathshared.ts
More file actions
382 lines (324 loc) · 8.16 KB
/
shared.ts
File metadata and controls
382 lines (324 loc) · 8.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
/**
* Configuration for automatic Devbox behavior after idle time.
*
* @category Shared Types
*/
export interface AfterIdle {
/**
* After idle_time_seconds, on_idle action will be taken.
*/
idle_time_seconds: number;
/**
* Action to take after Devbox becomes idle.
*/
on_idle: 'shutdown' | 'suspend';
}
export interface AgentMount {
/**
* The ID of the agent to mount. Either agent_id or name must be set.
*/
agent_id: string | null;
/**
* The name of the agent to mount. Returns the most recent agent with a matching
* name if no agent id string provided. Either agent id or name must be set
*/
agent_name: string | null;
type: 'agent_mount';
/**
* Path to mount the agent on the Devbox. Required for git and object agents. Use
* absolute path (e.g., /home/user/agent)
*/
agent_path?: string | null;
/**
* Optional auth token for private repositories. Only used for git agents.
*/
auth_token?: string | null;
}
/**
* Agent source configuration.
*
* @category Shared Types
*/
export interface AgentSource {
/**
* Source type: npm, pip, object, or git
*/
type: string;
/**
* Git source configuration
*/
git?: AgentSource.Git | null;
/**
* NPM source configuration
*/
npm?: AgentSource.Npm | null;
/**
* Object store source configuration
*/
object?: AgentSource.Object | null;
/**
* Pip source configuration
*/
pip?: AgentSource.Pip | null;
}
export namespace AgentSource {
/**
* Git source configuration
*/
export interface Git {
/**
* Git repository URL
*/
repository: string;
/**
* Setup commands to run after cloning
*/
agent_setup?: Array<string> | null;
/**
* Optional Git ref (branch/tag/commit), defaults to main/HEAD
*/
ref?: string | null;
}
/**
* NPM source configuration
*/
export interface Npm {
/**
* NPM package name
*/
package_name: string;
/**
* Setup commands to run after installation
*/
agent_setup?: Array<string> | null;
/**
* NPM registry URL
*/
registry_url?: string | null;
}
/**
* Object store source configuration
*/
export interface Object {
/**
* Object ID
*/
object_id: string;
/**
* Setup commands to run after unpacking
*/
agent_setup?: Array<string> | null;
}
/**
* Pip source configuration
*/
export interface Pip {
/**
* Pip package name
*/
package_name: string;
/**
* Setup commands to run after installation
*/
agent_setup?: Array<string> | null;
/**
* Pip registry URL
*/
registry_url?: string | null;
}
}
/**
* Parameters for mounting code from a Git repository.
*
* @category Shared Types
*/
export interface CodeMountParameters {
/**
* The name of the repo to mount. By default, code will be mounted at
* /home/user/{repo_name}s.
*/
repo_name: string;
/**
* The owner of the repo.
*/
repo_owner: string;
/**
* The authentication token necessary to pull repo.
*/
token?: string | null;
/**
* Installation command to install and setup repository.
*/
install_command?: string | null;
}
/**
* LaunchParameters enable you to customize the resources available to your Devbox
* as well as the environment set up that should be completed before the Devbox is
* marked as 'running'.
*
* @category Shared Types
*/
export interface LaunchParameters {
/**
* Configure Devbox lifecycle based on idle activity. If after_idle is set, Devbox
* will ignore keep_alive_time_seconds.
*/
after_idle?: AfterIdle | null;
/**
* The target architecture for the Devbox. If unset, defaults to x86_64.
*/
architecture?: 'x86_64' | 'arm64' | null;
/**
* A list of ports to make available on the Devbox. Only ports made available will
* be surfaced to create tunnels via the 'createTunnel' API.
*/
available_ports?: Array<number> | null;
/**
* Custom CPU cores. Must be 0.5, 1, or a multiple of 2. Max is 16.
*/
custom_cpu_cores?: number | null;
/**
* Custom disk size in GiB. Must be a multiple of 2. Min is 2GiB, max is 64GiB.
*/
custom_disk_size?: number | null;
/**
* Custom memory size in GiB. Must be 1 or a multiple of 2. Max is 64GiB.
*/
custom_gb_memory?: number | null;
/**
* Time in seconds after which Devbox will automatically shutdown. Default is 1
* hour. Maximum is 48 hours (172800 seconds).
*/
keep_alive_time_seconds?: number | null;
/**
* Set of commands to be run at launch time, before the entrypoint process is run.
*/
launch_commands?: Array<string> | null;
/**
* (Optional) ID of the network policy to apply to Devboxes launched with these
* parameters. When set on a Blueprint launch parameters, Devboxes created from it
* will inherit this policy unless explicitly overridden.
*/
network_policy_id?: string | null;
/**
* A list of ContainerizedService names to be started when a Devbox is created. A
* valid ContainerizedService must be specified in Blueprint to be started.
*/
required_services?: Array<string> | null;
/**
* Manual resource configuration for Devbox. If not set, defaults will be used.
*/
resource_size_request?:
| 'X_SMALL'
| 'SMALL'
| 'MEDIUM'
| 'LARGE'
| 'X_LARGE'
| 'XX_LARGE'
| 'CUSTOM_SIZE'
| null;
/**
* Specify the user for execution on Devbox. If not set, default `user` will be
* used.
*/
user_parameters?: LaunchParameters.UserParameters | null;
}
export namespace LaunchParameters {
/**
* Specify the user for execution on Devbox. If not set, default `user` will be
* used.
*/
export interface UserParameters {
/**
* User ID (UID) for the Linux user. Must be a non-negative integer.
*/
uid: number;
/**
* Username for the Linux user.
*/
username: string;
}
}
/**
* Mount configuration for attaching files, agents, or code to a Devbox.
*
* @category Shared Types
*/
export type Mount = ObjectMount | AgentMount | Mount.CodeMount | Mount.FileMount;
export namespace Mount {
export interface CodeMount {
/**
* The name of the repo to mount. By default, code will be mounted at
* /home/user/{repo_name}s.
*/
repo_name: string;
/**
* The owner of the repo.
*/
repo_owner: string;
type: 'code_mount';
/**
* The authentication token necessary to pull repo.
*/
token?: string | null;
/**
* Installation command to install and setup repository.
*/
install_command?: string | null;
}
export interface FileMount {
/**
* Content of the file to mount.
*/
content: string;
/**
* Target path where the file should be mounted.
*/
target: string;
type: 'file_mount';
}
}
export interface ObjectMount {
/**
* The ID of the object to write.
*/
object_id: string;
/**
* The path to write the object on the Devbox. Use absolute path of object (ie
* /home/user/object.txt, or directory if archive /home/user/archive_dir)
*/
object_path: string;
type: 'object_mount';
}
/**
* Configuration profile for scenario/benchmark runs.
*
* @category Shared Types
*/
export interface RunProfile {
/**
* Mapping of Environment Variable to Value. May be shown in devbox logging.
* Example: {"DB_PASS": "DATABASE_PASSWORD"} would set the environment variable
* 'DB_PASS' to the value 'DATABASE_PASSWORD_VALUE'.
*/
envVars?: { [key: string]: string } | null;
/**
* Additional runtime LaunchParameters to apply after the devbox starts.
*/
launchParameters?: LaunchParameters | null;
/**
* A list of mounts to be included in the scenario run.
*/
mounts?: Array<Mount> | null;
/**
* Purpose of the run.
*/
purpose?: string | null;
/**
* Mapping of Environment Variable to User Secret Name. Never shown in devbox
* logging. Example: {"DB_PASS": "DATABASE_PASSWORD"} would set the environment
* variable 'DB_PASS' to the value of the secret 'DATABASE_PASSWORD'.
*/
secrets?: { [key: string]: string } | null;
}