Skip to content

Commit 5c25d3d

Browse files
feat(blueprints): Add build context to the OpenAPI spec (#6494)
1 parent 827ee50 commit 5c25d3d

12 files changed

Lines changed: 118 additions & 21 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/runloop_api_client/resources/blueprints.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ def create(
130130
base_blueprint_id: Optional[str] | Omit = omit,
131131
base_blueprint_name: Optional[str] | Omit = omit,
132132
build_args: Optional[Dict[str, str]] | Omit = omit,
133+
build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit,
133134
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
134135
dockerfile: Optional[str] | Omit = omit,
135136
file_mounts: Optional[Dict[str, str]] | Omit = omit,
@@ -166,6 +167,8 @@ def create(
166167
167168
build_args: (Optional) Arbitrary Docker build args to pass during build.
168169
170+
build_context: A build context backed by an Object.
171+
169172
code_mounts: A list of code mounts to be included in the Blueprint.
170173
171174
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -209,6 +212,7 @@ def create(
209212
"base_blueprint_id": base_blueprint_id,
210213
"base_blueprint_name": base_blueprint_name,
211214
"build_args": build_args,
215+
"build_context": build_context,
212216
"code_mounts": code_mounts,
213217
"dockerfile": dockerfile,
214218
"file_mounts": file_mounts,
@@ -641,6 +645,7 @@ def preview(
641645
base_blueprint_id: Optional[str] | Omit = omit,
642646
base_blueprint_name: Optional[str] | Omit = omit,
643647
build_args: Optional[Dict[str, str]] | Omit = omit,
648+
build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit,
644649
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
645650
dockerfile: Optional[str] | Omit = omit,
646651
file_mounts: Optional[Dict[str, str]] | Omit = omit,
@@ -675,6 +680,8 @@ def preview(
675680
676681
build_args: (Optional) Arbitrary Docker build args to pass during build.
677682
683+
build_context: A build context backed by an Object.
684+
678685
code_mounts: A list of code mounts to be included in the Blueprint.
679686
680687
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -714,6 +721,7 @@ def preview(
714721
"base_blueprint_id": base_blueprint_id,
715722
"base_blueprint_name": base_blueprint_name,
716723
"build_args": build_args,
724+
"build_context": build_context,
717725
"code_mounts": code_mounts,
718726
"dockerfile": dockerfile,
719727
"file_mounts": file_mounts,
@@ -763,6 +771,7 @@ async def create(
763771
base_blueprint_id: Optional[str] | Omit = omit,
764772
base_blueprint_name: Optional[str] | Omit = omit,
765773
build_args: Optional[Dict[str, str]] | Omit = omit,
774+
build_context: Optional[blueprint_create_params.BuildContext] | Omit = omit,
766775
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
767776
dockerfile: Optional[str] | Omit = omit,
768777
file_mounts: Optional[Dict[str, str]] | Omit = omit,
@@ -799,6 +808,8 @@ async def create(
799808
800809
build_args: (Optional) Arbitrary Docker build args to pass during build.
801810
811+
build_context: A build context backed by an Object.
812+
802813
code_mounts: A list of code mounts to be included in the Blueprint.
803814
804815
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -842,6 +853,7 @@ async def create(
842853
"base_blueprint_id": base_blueprint_id,
843854
"base_blueprint_name": base_blueprint_name,
844855
"build_args": build_args,
856+
"build_context": build_context,
845857
"code_mounts": code_mounts,
846858
"dockerfile": dockerfile,
847859
"file_mounts": file_mounts,
@@ -1274,6 +1286,7 @@ async def preview(
12741286
base_blueprint_id: Optional[str] | Omit = omit,
12751287
base_blueprint_name: Optional[str] | Omit = omit,
12761288
build_args: Optional[Dict[str, str]] | Omit = omit,
1289+
build_context: Optional[blueprint_preview_params.BuildContext] | Omit = omit,
12771290
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
12781291
dockerfile: Optional[str] | Omit = omit,
12791292
file_mounts: Optional[Dict[str, str]] | Omit = omit,
@@ -1308,6 +1321,8 @@ async def preview(
13081321
13091322
build_args: (Optional) Arbitrary Docker build args to pass during build.
13101323
1324+
build_context: A build context backed by an Object.
1325+
13111326
code_mounts: A list of code mounts to be included in the Blueprint.
13121327
13131328
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -1347,6 +1362,7 @@ async def preview(
13471362
"base_blueprint_id": base_blueprint_id,
13481363
"base_blueprint_name": base_blueprint_name,
13491364
"build_args": build_args,
1365+
"build_context": build_context,
13501366
"code_mounts": code_mounts,
13511367
"dockerfile": dockerfile,
13521368
"file_mounts": file_mounts,

src/runloop_api_client/types/blueprint_build_parameters.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
from typing import Dict, List, Optional
4+
from typing_extensions import Literal
45

56
from .._models import BaseModel
67
from .shared.launch_parameters import LaunchParameters
78
from .shared.code_mount_parameters import CodeMountParameters
89

9-
__all__ = ["BlueprintBuildParameters", "Service", "ServiceCredentials"]
10+
__all__ = ["BlueprintBuildParameters", "BuildContext", "Service", "ServiceCredentials"]
11+
12+
13+
class BuildContext(BaseModel):
14+
object_id: str
15+
"""The ID of an object, whose contents are to be used as a build context."""
16+
17+
type: Literal["object"]
1018

1119

1220
class ServiceCredentials(BaseModel):
@@ -61,6 +69,9 @@ class BlueprintBuildParameters(BaseModel):
6169
build_args: Optional[Dict[str, str]] = None
6270
"""(Optional) Arbitrary Docker build args to pass during build."""
6371

72+
build_context: Optional[BuildContext] = None
73+
"""A build context backed by an Object."""
74+
6475
code_mounts: Optional[List[CodeMountParameters]] = None
6576
"""A list of code mounts to be included in the Blueprint."""
6677

src/runloop_api_client/types/blueprint_create_params.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from __future__ import annotations
44

55
from typing import Dict, Iterable, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
from .._types import SequenceNotStr
99
from .shared_params.launch_parameters import LaunchParameters
1010
from .shared_params.code_mount_parameters import CodeMountParameters
1111

12-
__all__ = ["BlueprintCreateParams", "Service", "ServiceCredentials"]
12+
__all__ = ["BlueprintCreateParams", "BuildContext", "Service", "ServiceCredentials"]
1313

1414

1515
class BlueprintCreateParams(TypedDict, total=False):
@@ -33,6 +33,9 @@ class BlueprintCreateParams(TypedDict, total=False):
3333
build_args: Optional[Dict[str, str]]
3434
"""(Optional) Arbitrary Docker build args to pass during build."""
3535

36+
build_context: Optional[BuildContext]
37+
"""A build context backed by an Object."""
38+
3639
code_mounts: Optional[Iterable[CodeMountParameters]]
3740
"""A list of code mounts to be included in the Blueprint."""
3841

@@ -67,6 +70,13 @@ class BlueprintCreateParams(TypedDict, total=False):
6770
"""A list of commands to run to set up your system."""
6871

6972

73+
class BuildContext(TypedDict, total=False):
74+
object_id: Required[str]
75+
"""The ID of an object, whose contents are to be used as a build context."""
76+
77+
type: Required[Literal["object"]]
78+
79+
7080
class ServiceCredentials(TypedDict, total=False):
7181
password: Required[str]
7282
"""The password of the container service."""

src/runloop_api_client/types/blueprint_preview_params.py

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
from __future__ import annotations
44

55
from typing import Dict, Iterable, Optional
6-
from typing_extensions import Required, TypedDict
6+
from typing_extensions import Literal, Required, TypedDict
77

88
from .._types import SequenceNotStr
99
from .shared_params.launch_parameters import LaunchParameters
1010
from .shared_params.code_mount_parameters import CodeMountParameters
1111

12-
__all__ = ["BlueprintPreviewParams", "Service", "ServiceCredentials"]
12+
__all__ = ["BlueprintPreviewParams", "BuildContext", "Service", "ServiceCredentials"]
1313

1414

1515
class BlueprintPreviewParams(TypedDict, total=False):
@@ -33,6 +33,9 @@ class BlueprintPreviewParams(TypedDict, total=False):
3333
build_args: Optional[Dict[str, str]]
3434
"""(Optional) Arbitrary Docker build args to pass during build."""
3535

36+
build_context: Optional[BuildContext]
37+
"""A build context backed by an Object."""
38+
3639
code_mounts: Optional[Iterable[CodeMountParameters]]
3740
"""A list of code mounts to be included in the Blueprint."""
3841

@@ -67,6 +70,13 @@ class BlueprintPreviewParams(TypedDict, total=False):
6770
"""A list of commands to run to set up your system."""
6871

6972

73+
class BuildContext(TypedDict, total=False):
74+
object_id: Required[str]
75+
"""The ID of an object, whose contents are to be used as a build context."""
76+
77+
type: Required[Literal["object"]]
78+
79+
7080
class ServiceCredentials(TypedDict, total=False):
7181
password: Required[str]
7282
"""The password of the container service."""

src/runloop_api_client/types/shared/mount.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, Union
3+
from typing import Union
44
from typing_extensions import Literal, Annotated, TypeAlias
55

66
from ..._utils import PropertyInfo
@@ -13,12 +13,11 @@
1313

1414

1515
class FileMountParameters(BaseModel):
16-
files: Dict[str, str]
17-
"""Map of file paths to file contents to be written before setup.
16+
content: str
17+
"""Content of the file to mount."""
1818

19-
Keys are absolute paths where files should be created, values are the file
20-
contents.
21-
"""
19+
target: str
20+
"""Target path where the file should be mounted."""
2221

2322
type: Literal["file_mount"]
2423

src/runloop_api_client/types/shared/run_profile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
from typing import Dict, Optional
3+
from typing import Dict, List, Optional
44

55
from pydantic import Field as FieldInfo
66

7+
from .mount import Mount
78
from ..._models import BaseModel
89
from .launch_parameters import LaunchParameters
910

@@ -21,6 +22,9 @@ class RunProfile(BaseModel):
2122
launch_parameters: Optional[LaunchParameters] = FieldInfo(alias="launchParameters", default=None)
2223
"""Additional runtime LaunchParameters to apply after the devbox starts."""
2324

25+
mounts: Optional[List[Mount]] = None
26+
"""A list of mounts to be included in the scenario run."""
27+
2428
purpose: Optional[str] = None
2529
"""Purpose of the run."""
2630

src/runloop_api_client/types/shared_params/mount.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Union
5+
from typing import Union
66
from typing_extensions import Literal, Required, TypeAlias, TypedDict
77

88
from .code_mount_parameters import CodeMountParameters
@@ -13,12 +13,11 @@
1313

1414

1515
class FileMountParameters(TypedDict, total=False):
16-
files: Required[Dict[str, str]]
17-
"""Map of file paths to file contents to be written before setup.
16+
content: Required[str]
17+
"""Content of the file to mount."""
1818

19-
Keys are absolute paths where files should be created, values are the file
20-
contents.
21-
"""
19+
target: Required[str]
20+
"""Target path where the file should be mounted."""
2221

2322
type: Required[Literal["file_mount"]]
2423

src/runloop_api_client/types/shared_params/run_profile.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,10 @@
22

33
from __future__ import annotations
44

5-
from typing import Dict, Optional
5+
from typing import Dict, Iterable, Optional
66
from typing_extensions import Annotated, TypedDict
77

8+
from .mount import Mount
89
from ..._utils import PropertyInfo
910
from .launch_parameters import LaunchParameters
1011

@@ -22,6 +23,9 @@ class RunProfile(TypedDict, total=False):
2223
launch_parameters: Annotated[Optional[LaunchParameters], PropertyInfo(alias="launchParameters")]
2324
"""Additional runtime LaunchParameters to apply after the devbox starts."""
2425

26+
mounts: Optional[Iterable[Mount]]
27+
"""A list of mounts to be included in the scenario run."""
28+
2529
purpose: Optional[str]
2630
"""Purpose of the run."""
2731

tests/api_resources/test_benchmarks.py

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -307,6 +307,13 @@ def test_method_start_run_with_all_params(self, client: Runloop) -> None:
307307
"username": "username",
308308
},
309309
},
310+
"mounts": [
311+
{
312+
"object_id": "object_id",
313+
"object_path": "object_path",
314+
"type": "object_mount",
315+
}
316+
],
310317
"purpose": "purpose",
311318
"secrets": {"foo": "string"},
312319
},
@@ -628,6 +635,13 @@ async def test_method_start_run_with_all_params(self, async_client: AsyncRunloop
628635
"username": "username",
629636
},
630637
},
638+
"mounts": [
639+
{
640+
"object_id": "object_id",
641+
"object_path": "object_path",
642+
"type": "object_mount",
643+
}
644+
],
631645
"purpose": "purpose",
632646
"secrets": {"foo": "string"},
633647
},

0 commit comments

Comments
 (0)