Skip to content

Commit 37cb64d

Browse files
feat(object): Added ability to give objects a Time To Live, after which they are automatically deleted.\nfeat(blueprints): Added the ability to attach objects as build contexts that can be referenced in your Dockerfile.
1 parent eeeefa8 commit 37cb64d

10 files changed

Lines changed: 329 additions & 18 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-9f8a6310d4d9c36d386f5afe17cfc891d05d5911204574645f9f90d9b6864a00.yml
3-
openapi_spec_hash: 3fc0a807bb8d728abe3b7eaff0b9f7ec
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/runloop-ai%2Frunloop-779f7a8b0be0c3d2d095c6256d35c5dbb4c28d049f3541384c51a8c215e8a87a.yml
3+
openapi_spec_hash: b4ebc80eeaf4e5b3bcd53c30433cf35e
44
config_hash: 2363f563f42501d2b1587a4f64bdccaf

src/runloop_api_client/resources/blueprints.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,10 +131,12 @@ def create(
131131
base_blueprint_id: Optional[str] | Omit = omit,
132132
base_blueprint_name: Optional[str] | Omit = omit,
133133
build_args: Optional[Dict[str, str]] | Omit = omit,
134+
build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit,
134135
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
135136
dockerfile: Optional[str] | Omit = omit,
136137
file_mounts: Optional[Dict[str, str]] | Omit = omit,
137138
launch_parameters: Optional[LaunchParameters] | Omit = omit,
139+
local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit,
138140
metadata: Optional[Dict[str, str]] | Omit = omit,
139141
secrets: Optional[Dict[str, str]] | Omit = omit,
140142
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
@@ -167,6 +169,11 @@ def create(
167169
168170
build_args: (Optional) Arbitrary Docker build args to pass during build.
169171
172+
build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values
173+
are typed context definitions (object or http). See Docker buildx additional
174+
contexts for details:
175+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
176+
170177
code_mounts: A list of code mounts to be included in the Blueprint.
171178
172179
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -175,6 +182,8 @@ def create(
175182
176183
launch_parameters: Parameters to configure your Devbox at launch time.
177184
185+
local_build_context: (Optional) Local build context stored in object-storage.
186+
178187
metadata: (Optional) User defined metadata for the Blueprint.
179188
180189
secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets
@@ -210,10 +219,12 @@ def create(
210219
"base_blueprint_id": base_blueprint_id,
211220
"base_blueprint_name": base_blueprint_name,
212221
"build_args": build_args,
222+
"build_contexts": build_contexts,
213223
"code_mounts": code_mounts,
214224
"dockerfile": dockerfile,
215225
"file_mounts": file_mounts,
216226
"launch_parameters": launch_parameters,
227+
"local_build_context": local_build_context,
217228
"metadata": metadata,
218229
"secrets": secrets,
219230
"services": services,
@@ -638,10 +649,12 @@ def preview(
638649
base_blueprint_id: Optional[str] | Omit = omit,
639650
base_blueprint_name: Optional[str] | Omit = omit,
640651
build_args: Optional[Dict[str, str]] | Omit = omit,
652+
build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit,
641653
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
642654
dockerfile: Optional[str] | Omit = omit,
643655
file_mounts: Optional[Dict[str, str]] | Omit = omit,
644656
launch_parameters: Optional[LaunchParameters] | Omit = omit,
657+
local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit,
645658
metadata: Optional[Dict[str, str]] | Omit = omit,
646659
secrets: Optional[Dict[str, str]] | Omit = omit,
647660
services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit,
@@ -672,6 +685,11 @@ def preview(
672685
673686
build_args: (Optional) Arbitrary Docker build args to pass during build.
674687
688+
build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values
689+
are typed context definitions (object or http). See Docker buildx additional
690+
contexts for details:
691+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
692+
675693
code_mounts: A list of code mounts to be included in the Blueprint.
676694
677695
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -680,6 +698,8 @@ def preview(
680698
681699
launch_parameters: Parameters to configure your Devbox at launch time.
682700
701+
local_build_context: (Optional) Local build context stored in object-storage.
702+
683703
metadata: (Optional) User defined metadata for the Blueprint.
684704
685705
secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets
@@ -711,10 +731,12 @@ def preview(
711731
"base_blueprint_id": base_blueprint_id,
712732
"base_blueprint_name": base_blueprint_name,
713733
"build_args": build_args,
734+
"build_contexts": build_contexts,
714735
"code_mounts": code_mounts,
715736
"dockerfile": dockerfile,
716737
"file_mounts": file_mounts,
717738
"launch_parameters": launch_parameters,
739+
"local_build_context": local_build_context,
718740
"metadata": metadata,
719741
"secrets": secrets,
720742
"services": services,
@@ -760,10 +782,12 @@ async def create(
760782
base_blueprint_id: Optional[str] | Omit = omit,
761783
base_blueprint_name: Optional[str] | Omit = omit,
762784
build_args: Optional[Dict[str, str]] | Omit = omit,
785+
build_contexts: Optional[Dict[str, blueprint_create_params.BuildContexts]] | Omit = omit,
763786
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
764787
dockerfile: Optional[str] | Omit = omit,
765788
file_mounts: Optional[Dict[str, str]] | Omit = omit,
766789
launch_parameters: Optional[LaunchParameters] | Omit = omit,
790+
local_build_context: Optional[blueprint_create_params.LocalBuildContext] | Omit = omit,
767791
metadata: Optional[Dict[str, str]] | Omit = omit,
768792
secrets: Optional[Dict[str, str]] | Omit = omit,
769793
services: Optional[Iterable[blueprint_create_params.Service]] | Omit = omit,
@@ -796,6 +820,11 @@ async def create(
796820
797821
build_args: (Optional) Arbitrary Docker build args to pass during build.
798822
823+
build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values
824+
are typed context definitions (object or http). See Docker buildx additional
825+
contexts for details:
826+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
827+
799828
code_mounts: A list of code mounts to be included in the Blueprint.
800829
801830
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -804,6 +833,8 @@ async def create(
804833
805834
launch_parameters: Parameters to configure your Devbox at launch time.
806835
836+
local_build_context: (Optional) Local build context stored in object-storage.
837+
807838
metadata: (Optional) User defined metadata for the Blueprint.
808839
809840
secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets
@@ -839,10 +870,12 @@ async def create(
839870
"base_blueprint_id": base_blueprint_id,
840871
"base_blueprint_name": base_blueprint_name,
841872
"build_args": build_args,
873+
"build_contexts": build_contexts,
842874
"code_mounts": code_mounts,
843875
"dockerfile": dockerfile,
844876
"file_mounts": file_mounts,
845877
"launch_parameters": launch_parameters,
878+
"local_build_context": local_build_context,
846879
"metadata": metadata,
847880
"secrets": secrets,
848881
"services": services,
@@ -1267,10 +1300,12 @@ async def preview(
12671300
base_blueprint_id: Optional[str] | Omit = omit,
12681301
base_blueprint_name: Optional[str] | Omit = omit,
12691302
build_args: Optional[Dict[str, str]] | Omit = omit,
1303+
build_contexts: Optional[Dict[str, blueprint_preview_params.BuildContexts]] | Omit = omit,
12701304
code_mounts: Optional[Iterable[CodeMountParameters]] | Omit = omit,
12711305
dockerfile: Optional[str] | Omit = omit,
12721306
file_mounts: Optional[Dict[str, str]] | Omit = omit,
12731307
launch_parameters: Optional[LaunchParameters] | Omit = omit,
1308+
local_build_context: Optional[blueprint_preview_params.LocalBuildContext] | Omit = omit,
12741309
metadata: Optional[Dict[str, str]] | Omit = omit,
12751310
secrets: Optional[Dict[str, str]] | Omit = omit,
12761311
services: Optional[Iterable[blueprint_preview_params.Service]] | Omit = omit,
@@ -1301,6 +1336,11 @@ async def preview(
13011336
13021337
build_args: (Optional) Arbitrary Docker build args to pass during build.
13031338
1339+
build_contexts: (Optional) Map of named Docker build contexts. Keys are context names, values
1340+
are typed context definitions (object or http). See Docker buildx additional
1341+
contexts for details:
1342+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
1343+
13041344
code_mounts: A list of code mounts to be included in the Blueprint.
13051345
13061346
dockerfile: Dockerfile contents to be used to build the Blueprint.
@@ -1309,6 +1349,8 @@ async def preview(
13091349
13101350
launch_parameters: Parameters to configure your Devbox at launch time.
13111351
1352+
local_build_context: (Optional) Local build context stored in object-storage.
1353+
13121354
metadata: (Optional) User defined metadata for the Blueprint.
13131355
13141356
secrets: (Optional) Map of mount IDs/environment variable names to secret names. Secrets
@@ -1340,10 +1382,12 @@ async def preview(
13401382
"base_blueprint_id": base_blueprint_id,
13411383
"base_blueprint_name": base_blueprint_name,
13421384
"build_args": build_args,
1385+
"build_contexts": build_contexts,
13431386
"code_mounts": code_mounts,
13441387
"dockerfile": dockerfile,
13451388
"file_mounts": file_mounts,
13461389
"launch_parameters": launch_parameters,
1390+
"local_build_context": local_build_context,
13471391
"metadata": metadata,
13481392
"secrets": secrets,
13491393
"services": services,

src/runloop_api_client/types/blueprint_build_parameters.py

Lines changed: 65 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,65 @@
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__ = [
11+
"BlueprintBuildParameters",
12+
"BuildContexts",
13+
"BuildContextsHTTP",
14+
"BuildContextsObject",
15+
"LocalBuildContext",
16+
"LocalBuildContextHTTP",
17+
"LocalBuildContextObject",
18+
"Service",
19+
"ServiceCredentials",
20+
]
21+
22+
23+
class BuildContextsHTTP(BaseModel):
24+
url: str
25+
"""HTTP(S) URL to a tarball or directory to use as context."""
26+
27+
28+
class BuildContextsObject(BaseModel):
29+
object_id: str
30+
"""Handle for a Runloop stored object to use as context."""
31+
32+
33+
class BuildContexts(BaseModel):
34+
type: Literal["OBJECT", "HTTP"]
35+
"""Type of the context. Supported values: object, http"""
36+
37+
http: Optional[BuildContextsHTTP] = None
38+
"""HTTP(S) context parameters."""
39+
40+
object: Optional[BuildContextsObject] = None
41+
"""Object context parameters (named build context)."""
42+
43+
44+
class LocalBuildContextHTTP(BaseModel):
45+
url: str
46+
"""HTTP(S) URL to a tarball or directory to use as context."""
47+
48+
49+
class LocalBuildContextObject(BaseModel):
50+
object_id: str
51+
"""Handle for a Runloop stored object to use as context."""
52+
53+
54+
class LocalBuildContext(BaseModel):
55+
type: Literal["OBJECT", "HTTP"]
56+
"""Type of the context. Supported values: object, http"""
57+
58+
http: Optional[LocalBuildContextHTTP] = None
59+
"""HTTP(S) context parameters."""
60+
61+
object: Optional[LocalBuildContextObject] = None
62+
"""Object context parameters (named build context)."""
1063

1164

1265
class ServiceCredentials(BaseModel):
@@ -61,6 +114,14 @@ class BlueprintBuildParameters(BaseModel):
61114
build_args: Optional[Dict[str, str]] = None
62115
"""(Optional) Arbitrary Docker build args to pass during build."""
63116

117+
build_contexts: Optional[Dict[str, BuildContexts]] = None
118+
"""(Optional) Map of named Docker build contexts.
119+
120+
Keys are context names, values are typed context definitions (object or http).
121+
See Docker buildx additional contexts for details:
122+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
123+
"""
124+
64125
code_mounts: Optional[List[CodeMountParameters]] = None
65126
"""A list of code mounts to be included in the Blueprint."""
66127

@@ -73,6 +134,9 @@ class BlueprintBuildParameters(BaseModel):
73134
launch_parameters: Optional[LaunchParameters] = None
74135
"""Parameters to configure your Devbox at launch time."""
75136

137+
local_build_context: Optional[LocalBuildContext] = None
138+
"""(Optional) Local build context stored in object-storage."""
139+
76140
metadata: Optional[Dict[str, str]] = None
77141
"""(Optional) User defined metadata for the Blueprint."""
78142

src/runloop_api_client/types/blueprint_create_params.py

Lines changed: 65 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,23 @@
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__ = [
13+
"BlueprintCreateParams",
14+
"BuildContexts",
15+
"BuildContextsHTTP",
16+
"BuildContextsObject",
17+
"LocalBuildContext",
18+
"LocalBuildContextHTTP",
19+
"LocalBuildContextObject",
20+
"Service",
21+
"ServiceCredentials",
22+
]
1323

1424

1525
class BlueprintCreateParams(TypedDict, total=False):
@@ -33,6 +43,14 @@ class BlueprintCreateParams(TypedDict, total=False):
3343
build_args: Optional[Dict[str, str]]
3444
"""(Optional) Arbitrary Docker build args to pass during build."""
3545

46+
build_contexts: Optional[Dict[str, BuildContexts]]
47+
"""(Optional) Map of named Docker build contexts.
48+
49+
Keys are context names, values are typed context definitions (object or http).
50+
See Docker buildx additional contexts for details:
51+
https://docs.docker.com/reference/cli/docker/buildx/build/#build-context
52+
"""
53+
3654
code_mounts: Optional[Iterable[CodeMountParameters]]
3755
"""A list of code mounts to be included in the Blueprint."""
3856

@@ -45,6 +63,9 @@ class BlueprintCreateParams(TypedDict, total=False):
4563
launch_parameters: Optional[LaunchParameters]
4664
"""Parameters to configure your Devbox at launch time."""
4765

66+
local_build_context: Optional[LocalBuildContext]
67+
"""(Optional) Local build context stored in object-storage."""
68+
4869
metadata: Optional[Dict[str, str]]
4970
"""(Optional) User defined metadata for the Blueprint."""
5071

@@ -67,6 +88,48 @@ class BlueprintCreateParams(TypedDict, total=False):
6788
"""A list of commands to run to set up your system."""
6889

6990

91+
class BuildContextsHTTP(TypedDict, total=False):
92+
url: Required[str]
93+
"""HTTP(S) URL to a tarball or directory to use as context."""
94+
95+
96+
class BuildContextsObject(TypedDict, total=False):
97+
object_id: Required[str]
98+
"""Handle for a Runloop stored object to use as context."""
99+
100+
101+
class BuildContexts(TypedDict, total=False):
102+
type: Required[Literal["OBJECT", "HTTP"]]
103+
"""Type of the context. Supported values: object, http"""
104+
105+
http: Optional[BuildContextsHTTP]
106+
"""HTTP(S) context parameters."""
107+
108+
object: Optional[BuildContextsObject]
109+
"""Object context parameters (named build context)."""
110+
111+
112+
class LocalBuildContextHTTP(TypedDict, total=False):
113+
url: Required[str]
114+
"""HTTP(S) URL to a tarball or directory to use as context."""
115+
116+
117+
class LocalBuildContextObject(TypedDict, total=False):
118+
object_id: Required[str]
119+
"""Handle for a Runloop stored object to use as context."""
120+
121+
122+
class LocalBuildContext(TypedDict, total=False):
123+
type: Required[Literal["OBJECT", "HTTP"]]
124+
"""Type of the context. Supported values: object, http"""
125+
126+
http: Optional[LocalBuildContextHTTP]
127+
"""HTTP(S) context parameters."""
128+
129+
object: Optional[LocalBuildContextObject]
130+
"""Object context parameters (named build context)."""
131+
132+
70133
class ServiceCredentials(TypedDict, total=False):
71134
password: Required[str]
72135
"""The password of the container service."""

0 commit comments

Comments
 (0)