Skip to content

Commit 59b9486

Browse files
feat(api): api update
1 parent 8d62f4b commit 59b9486

6 files changed

Lines changed: 187 additions & 61 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: 91
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-034d0b86510db8b712b55ac88c1c4a322db2ce84edc632f6d27be1eb4f34fd37.yml
3-
openapi_spec_hash: 0485ec0d01253b2c1bdab3015370808e
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-f1d928f705d6771a22fe701dfb8c0c66aabbd0dd6d17e3fa09b8eb3a48259a84.yml
3+
openapi_spec_hash: 12dc18a4da3f084fee3d2c5f428e1df3
44
config_hash: 35e129f39a0c1fd38209b0dafb7c7562

src/runloop_api_client/resources/blueprints.py

Lines changed: 72 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
from ..lib.polling_async import async_poll_until
3030
from ..types.blueprint_view import BlueprintView
3131
from ..types.blueprint_preview_view import BlueprintPreviewView
32-
from ..types.inspection_source_param import InspectionSourceParam
3332
from ..types.blueprint_build_logs_list_view import BlueprintBuildLogsListView
3433
from ..types.shared_params.launch_parameters import LaunchParameters
3534
from ..types.shared_params.code_mount_parameters import CodeMountParameters
@@ -72,11 +71,16 @@ def with_streaming_response(self) -> BlueprintsResourceWithStreamingResponse:
7271
def create(
7372
self,
7473
*,
75-
inspection_source: InspectionSourceParam,
7674
name: str,
75+
base_blueprint_id: Optional[str] | Omit = omit,
76+
base_blueprint_name: Optional[str] | Omit = omit,
77+
build_args: Optional[Dict[str, str]] | Omit = omit,
78+
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
79+
dockerfile: Optional[str] | Omit = omit,
7780
file_mounts: Optional[Dict[str, str]] | Omit = omit,
7881
launch_parameters: Optional[LaunchParameters] | Omit = omit,
7982
metadata: Optional[Dict[str, str]] | Omit = omit,
83+
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
8084
system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit,
8185
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
8286
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -86,23 +90,40 @@ def create(
8690
timeout: float | httpx.Timeout | None | NotGiven = not_given,
8791
idempotency_key: str | None = None,
8892
) -> BlueprintView:
89-
"""
90-
Starts build of custom defined container Blueprint using a RepositoryConnection
91-
Inspection as a source container specification.
93+
"""Starts build of custom defined container Blueprint.
9294
93-
Args:
94-
inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The
95-
Dockerfile will be automatically created based on the RepositoryInspection
96-
contents.
95+
The Blueprint will begin in
96+
the 'provisioning' step and transition to the 'building' step once it is
97+
selected off the build queue., Upon build complete it will transition to
98+
'building_complete' if the build is successful.
9799
100+
Args:
98101
name: Name of the Blueprint.
99102
103+
base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this
104+
build.
105+
106+
base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for
107+
this build. When set, this will load the latest successfully built Blueprint
108+
with the given name. Only one of (base_blueprint_id, base_blueprint_name) should
109+
be specified.
110+
111+
build_args: (Optional) Arbitrary Docker build args to pass during build.
112+
113+
code_mounts: A list of code mounts to be included in the Blueprint.
114+
115+
dockerfile: Dockerfile contents to be used to build the Blueprint.
116+
100117
file_mounts: (Optional) Map of paths and file contents to write before setup.
101118
102119
launch_parameters: Parameters to configure your Devbox at launch time.
103120
104121
metadata: (Optional) User defined metadata for the Blueprint.
105122
123+
services: (Optional) List of containerized services to include in the Blueprint. These
124+
services will be pre-pulled during the build phase for optimized startup
125+
performance.
126+
106127
system_setup_commands: A list of commands to run to set up your system.
107128
108129
extra_headers: Send extra headers
@@ -119,11 +140,16 @@ def create(
119140
"/v1/blueprints",
120141
body=maybe_transform(
121142
{
122-
"inspection_source": inspection_source,
123143
"name": name,
144+
"base_blueprint_id": base_blueprint_id,
145+
"base_blueprint_name": base_blueprint_name,
146+
"build_args": build_args,
147+
"code_mounts": code_mounts,
148+
"dockerfile": dockerfile,
124149
"file_mounts": file_mounts,
125150
"launch_parameters": launch_parameters,
126151
"metadata": metadata,
152+
"services": services,
127153
"system_setup_commands": system_setup_commands,
128154
},
129155
blueprint_create_params.BlueprintCreateParams,
@@ -570,11 +596,16 @@ def with_streaming_response(self) -> AsyncBlueprintsResourceWithStreamingRespons
570596
async def create(
571597
self,
572598
*,
573-
inspection_source: InspectionSourceParam,
574599
name: str,
600+
base_blueprint_id: Optional[str] | Omit = omit,
601+
base_blueprint_name: Optional[str] | Omit = omit,
602+
build_args: Optional[Dict[str, str]] | Omit = omit,
603+
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
604+
dockerfile: Optional[str] | Omit = omit,
575605
file_mounts: Optional[Dict[str, str]] | Omit = omit,
576606
launch_parameters: Optional[LaunchParameters] | Omit = omit,
577607
metadata: Optional[Dict[str, str]] | Omit = omit,
608+
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
578609
system_setup_commands: Optional[SequenceNotStr[str]] | Omit = omit,
579610
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
580611
# The extra values given here take precedence over values defined on the client or passed to this method.
@@ -584,23 +615,40 @@ async def create(
584615
timeout: float | httpx.Timeout | None | NotGiven = not_given,
585616
idempotency_key: str | None = None,
586617
) -> BlueprintView:
587-
"""
588-
Starts build of custom defined container Blueprint using a RepositoryConnection
589-
Inspection as a source container specification.
618+
"""Starts build of custom defined container Blueprint.
590619
591-
Args:
592-
inspection_source: (Optional) Use a RepositoryInspection a source of a Blueprint build. The
593-
Dockerfile will be automatically created based on the RepositoryInspection
594-
contents.
620+
The Blueprint will begin in
621+
the 'provisioning' step and transition to the 'building' step once it is
622+
selected off the build queue., Upon build complete it will transition to
623+
'building_complete' if the build is successful.
595624
625+
Args:
596626
name: Name of the Blueprint.
597627
628+
base_blueprint_id: (Optional) ID of previously built blueprint to use as a base blueprint for this
629+
build.
630+
631+
base_blueprint_name: (Optional) Name of previously built blueprint to use as a base blueprint for
632+
this build. When set, this will load the latest successfully built Blueprint
633+
with the given name. Only one of (base_blueprint_id, base_blueprint_name) should
634+
be specified.
635+
636+
build_args: (Optional) Arbitrary Docker build args to pass during build.
637+
638+
code_mounts: A list of code mounts to be included in the Blueprint.
639+
640+
dockerfile: Dockerfile contents to be used to build the Blueprint.
641+
598642
file_mounts: (Optional) Map of paths and file contents to write before setup.
599643
600644
launch_parameters: Parameters to configure your Devbox at launch time.
601645
602646
metadata: (Optional) User defined metadata for the Blueprint.
603647
648+
services: (Optional) List of containerized services to include in the Blueprint. These
649+
services will be pre-pulled during the build phase for optimized startup
650+
performance.
651+
604652
system_setup_commands: A list of commands to run to set up your system.
605653
606654
extra_headers: Send extra headers
@@ -617,11 +665,16 @@ async def create(
617665
"/v1/blueprints",
618666
body=await async_maybe_transform(
619667
{
620-
"inspection_source": inspection_source,
621668
"name": name,
669+
"base_blueprint_id": base_blueprint_id,
670+
"base_blueprint_name": base_blueprint_name,
671+
"build_args": build_args,
672+
"code_mounts": code_mounts,
673+
"dockerfile": dockerfile,
622674
"file_mounts": file_mounts,
623675
"launch_parameters": launch_parameters,
624676
"metadata": metadata,
677+
"services": services,
625678
"system_setup_commands": system_setup_commands,
626679
},
627680
blueprint_create_params.BlueprintCreateParams,

src/runloop_api_client/types/__init__.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,6 @@
5252
from .benchmark_run_list_view import BenchmarkRunListView as BenchmarkRunListView
5353
from .benchmark_update_params import BenchmarkUpdateParams as BenchmarkUpdateParams
5454
from .blueprint_create_params import BlueprintCreateParams as BlueprintCreateParams
55-
from .inspection_source_param import InspectionSourceParam as InspectionSourceParam
5655
from .blueprint_preview_params import BlueprintPreviewParams as BlueprintPreviewParams
5756
from .object_download_url_view import ObjectDownloadURLView as ObjectDownloadURLView
5857
from .repository_create_params import RepositoryCreateParams as RepositoryCreateParams

src/runloop_api_client/types/blueprint_create_params.py

Lines changed: 63 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,42 @@
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 Required, TypedDict
77

88
from .._types import SequenceNotStr
9-
from .inspection_source_param import InspectionSourceParam
109
from .shared_params.launch_parameters import LaunchParameters
10+
from .shared_params.code_mount_parameters import CodeMountParameters
1111

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

1414

1515
class BlueprintCreateParams(TypedDict, total=False):
16-
inspection_source: Required[InspectionSourceParam]
17-
"""(Optional) Use a RepositoryInspection a source of a Blueprint build.
16+
name: Required[str]
17+
"""Name of the Blueprint."""
1818

19-
The Dockerfile will be automatically created based on the RepositoryInspection
20-
contents.
19+
base_blueprint_id: Optional[str]
20+
"""
21+
(Optional) ID of previously built blueprint to use as a base blueprint for this
22+
build.
2123
"""
2224

23-
name: Required[str]
24-
"""Name of the Blueprint."""
25+
base_blueprint_name: Optional[str]
26+
"""
27+
(Optional) Name of previously built blueprint to use as a base blueprint for
28+
this build. When set, this will load the latest successfully built Blueprint
29+
with the given name. Only one of (base_blueprint_id, base_blueprint_name) should
30+
be specified.
31+
"""
32+
33+
build_args: Optional[Dict[str, str]]
34+
"""(Optional) Arbitrary Docker build args to pass during build."""
35+
36+
code_mounts: Optional[Iterable[CodeMountParameters]]
37+
"""A list of code mounts to be included in the Blueprint."""
38+
39+
dockerfile: Optional[str]
40+
"""Dockerfile contents to be used to build the Blueprint."""
2541

2642
file_mounts: Optional[Dict[str, str]]
2743
"""(Optional) Map of paths and file contents to write before setup."""
@@ -32,5 +48,43 @@ class BlueprintCreateParams(TypedDict, total=False):
3248
metadata: Optional[Dict[str, str]]
3349
"""(Optional) User defined metadata for the Blueprint."""
3450

51+
services: Optional[Iterable[Service]]
52+
"""(Optional) List of containerized services to include in the Blueprint.
53+
54+
These services will be pre-pulled during the build phase for optimized startup
55+
performance.
56+
"""
57+
3558
system_setup_commands: Optional[SequenceNotStr[str]]
3659
"""A list of commands to run to set up your system."""
60+
61+
62+
class ServiceCredentials(TypedDict, total=False):
63+
password: Required[str]
64+
"""The password of the container service."""
65+
66+
username: Required[str]
67+
"""The username of the container service."""
68+
69+
70+
class Service(TypedDict, total=False):
71+
image: Required[str]
72+
"""The image of the container service."""
73+
74+
name: Required[str]
75+
"""The name of the container service."""
76+
77+
credentials: Optional[ServiceCredentials]
78+
"""The credentials of the container service."""
79+
80+
env: Optional[Dict[str, str]]
81+
"""The environment variables of the container service."""
82+
83+
options: Optional[str]
84+
"""Additional Docker container create options."""
85+
86+
port_mappings: Optional[SequenceNotStr[str]]
87+
"""The port mappings of the container service.
88+
89+
Port mappings are in the format of <host_port>:<container_port>.
90+
"""

src/runloop_api_client/types/inspection_source_param.py

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)