Skip to content

Commit a85135d

Browse files
feat(blueprints): Add build context to the OpenAPI spec (#6494)
1 parent c79686e commit a85135d

6 files changed

Lines changed: 69 additions & 5 deletions

File tree

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 97
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-d2463b4c27719ea7275c8f587fa2c90e333471fdede11e5f944faa92dfb417d1.yml
3-
openapi_spec_hash: 132c1d9f04583e997df5d7698e155fff
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-b1e4697ee11a301905abe34736d6a2e74a2200c2f9bade48b6f50ee2d65a814f.yml
3+
openapi_spec_hash: 3ebe459b324ae2757ba3bee9d1484e90
44
config_hash: 2363f563f42501d2b1587a4f64bdccaf

src/resources/blueprints.ts

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -318,6 +318,11 @@ export interface BlueprintBuildParameters {
318318
*/
319319
build_args?: { [key: string]: string } | null;
320320

321+
/**
322+
* A build context backed by an Object.
323+
*/
324+
build_context?: BlueprintBuildParameters.BuildContext | null;
325+
321326
/**
322327
* A list of code mounts to be included in the Blueprint.
323328
*/
@@ -365,6 +370,18 @@ export interface BlueprintBuildParameters {
365370
}
366371

367372
export namespace BlueprintBuildParameters {
373+
/**
374+
* A build context backed by an Object.
375+
*/
376+
export interface BuildContext {
377+
/**
378+
* The ID of an object, whose contents are to be used as a build context.
379+
*/
380+
object_id: string;
381+
382+
type: 'object';
383+
}
384+
368385
export interface Service {
369386
/**
370387
* The image of the container service.
@@ -603,6 +620,11 @@ export interface BlueprintCreateParams {
603620
*/
604621
build_args?: { [key: string]: string } | null;
605622

623+
/**
624+
* A build context backed by an Object.
625+
*/
626+
build_context?: BlueprintCreateParams.BuildContext | null;
627+
606628
/**
607629
* A list of code mounts to be included in the Blueprint.
608630
*/
@@ -650,6 +672,18 @@ export interface BlueprintCreateParams {
650672
}
651673

652674
export namespace BlueprintCreateParams {
675+
/**
676+
* A build context backed by an Object.
677+
*/
678+
export interface BuildContext {
679+
/**
680+
* The ID of an object, whose contents are to be used as a build context.
681+
*/
682+
object_id: string;
683+
684+
type: 'object';
685+
}
686+
653687
export interface Service {
654688
/**
655689
* The image of the container service.
@@ -781,6 +815,11 @@ export interface BlueprintPreviewParams {
781815
*/
782816
build_args?: { [key: string]: string } | null;
783817

818+
/**
819+
* A build context backed by an Object.
820+
*/
821+
build_context?: BlueprintPreviewParams.BuildContext | null;
822+
784823
/**
785824
* A list of code mounts to be included in the Blueprint.
786825
*/
@@ -828,6 +867,18 @@ export interface BlueprintPreviewParams {
828867
}
829868

830869
export namespace BlueprintPreviewParams {
870+
/**
871+
* A build context backed by an Object.
872+
*/
873+
export interface BuildContext {
874+
/**
875+
* The ID of an object, whose contents are to be used as a build context.
876+
*/
877+
object_id: string;
878+
879+
type: 'object';
880+
}
881+
831882
export interface Service {
832883
/**
833884
* The image of the container service.

src/resources/shared.ts

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -285,10 +285,14 @@ export type Mount =
285285
export namespace Mount {
286286
export interface FileMountParameters {
287287
/**
288-
* Map of file paths to file contents to be written before setup. Keys are absolute
289-
* paths where files should be created, values are the file contents.
288+
* Content of the file to mount.
290289
*/
291-
files: { [key: string]: string };
290+
content: string;
291+
292+
/**
293+
* Target path where the file should be mounted.
294+
*/
295+
target: string;
292296

293297
type: 'file_mount';
294298
}
@@ -322,6 +326,11 @@ export interface RunProfile {
322326
*/
323327
launchParameters?: LaunchParameters | null;
324328

329+
/**
330+
* A list of mounts to be included in the scenario run.
331+
*/
332+
mounts?: Array<Mount> | null;
333+
325334
/**
326335
* Purpose of the run.
327336
*/

tests/api-resources/benchmarks/benchmarks.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ describe('resource benchmarks', () => {
189189
resource_size_request: 'X_SMALL',
190190
user_parameters: { uid: 0, username: 'username' },
191191
},
192+
mounts: [{ object_id: 'object_id', object_path: 'object_path', type: 'object_mount' }],
192193
purpose: 'purpose',
193194
secrets: { foo: 'string' },
194195
},

tests/api-resources/blueprints.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ describe('resource blueprints', () => {
2626
base_blueprint_id: 'base_blueprint_id',
2727
base_blueprint_name: 'base_blueprint_name',
2828
build_args: { foo: 'string' },
29+
build_context: { object_id: 'object_id', type: 'object' },
2930
code_mounts: [
3031
{
3132
repo_name: 'repo_name',
@@ -255,6 +256,7 @@ describe('resource blueprints', () => {
255256
name: 'name',
256257
base_blueprint_name: 'base_blueprint_name',
257258
build_args: { foo: 'string' },
259+
build_context: { object_id: 'object_id', type: 'object' },
258260
code_mounts: [
259261
{
260262
repo_name: 'repo_name',

tests/api-resources/scenarios/scenarios.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,7 @@ describe('resource scenarios', () => {
251251
resource_size_request: 'X_SMALL',
252252
user_parameters: { uid: 0, username: 'username' },
253253
},
254+
mounts: [{ object_id: 'object_id', object_path: 'object_path', type: 'object_mount' }],
254255
purpose: 'purpose',
255256
secrets: { foo: 'string' },
256257
},

0 commit comments

Comments
 (0)