Skip to content

Commit 546282f

Browse files
committed
changed default build context to 1w from 1h
1 parent ea15b34 commit 546282f

3 files changed

Lines changed: 10 additions & 6 deletions

File tree

README-SDK.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,7 @@ blueprint = runloop.blueprint.create(
428428

429429
# Or create a blueprint with a Docker build context from a local directory
430430
from pathlib import Path
431+
from datetime import timedelta
431432
from runloop_api_client.lib.context_loader import build_docker_context_tar
432433

433434
context_root = Path("./my-app")
@@ -437,6 +438,7 @@ build_ctx_obj = runloop.storage_object.upload_from_bytes(
437438
data=tar_bytes,
438439
name="my-app-context.tar.gz",
439440
content_type="tgz",
441+
ttl=timedelta(weeks=1), # Default is 1 week
440442
)
441443

442444
blueprint_with_context = runloop.blueprint.create(

src/runloop_api_client/sdk/async_.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ class AsyncBlueprintOps:
240240
>>> runloop = AsyncRunloopSDK()
241241
>>> obj = await runloop.object_storage.upload_from_dir(
242242
... "./",
243-
... ttl=timedelta(hours=1),
243+
... ttl=timedelta(weeks=1),
244244
... )
245245
>>> blueprint = await runloop.blueprint.create(
246246
... name="my-blueprint",
@@ -406,7 +406,7 @@ async def upload_from_dir(
406406
*,
407407
name: Optional[str] = None,
408408
metadata: Optional[Dict[str, str]] = None,
409-
ttl: Optional[timedelta] = None,
409+
ttl: Optional[timedelta] = timedelta(weeks=1),
410410
ignore: TarFilter | None = None,
411411
**options: Unpack[LongRequestOptions],
412412
) -> AsyncStorageObject:
@@ -420,7 +420,8 @@ async def upload_from_dir(
420420
:type name: Optional[str]
421421
:param metadata: Optional key-value metadata
422422
:type metadata: Optional[Dict[str, str]]
423-
:param ttl: Optional Time-To-Live, after which the object is automatically deleted
423+
:param ttl: Optional Time-To-Live, after which the object is automatically deleted.
424+
Defaults to 1 week. Pass ``None`` explicitly for no expiration.
424425
:type ttl: Optional[timedelta]
425426
:param ignore: Optional tar filter function compatible with
426427
:meth:`tarfile.TarFile.add`. If provided, it will be called for each

src/runloop_api_client/sdk/sync.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,7 +238,7 @@ class BlueprintOps:
238238
>>> runloop = RunloopSDK()
239239
>>> obj = runloop.object_storage.upload_from_dir(
240240
... "./",
241-
... ttl=timedelta(hours=1),
241+
... ttl=timedelta(weeks=1),
242242
... )
243243
>>> blueprint = runloop.blueprint.create(
244244
... name="my-blueprint",
@@ -404,7 +404,7 @@ def upload_from_dir(
404404
*,
405405
name: Optional[str] = None,
406406
metadata: Optional[Dict[str, str]] = None,
407-
ttl: Optional[timedelta] = None,
407+
ttl: Optional[timedelta] = timedelta(weeks=1),
408408
ignore: TarFilter | None = None,
409409
**options: Unpack[LongRequestOptions],
410410
) -> StorageObject:
@@ -418,7 +418,8 @@ def upload_from_dir(
418418
:type name: Optional[str]
419419
:param metadata: Optional key-value metadata
420420
:type metadata: Optional[Dict[str, str]]
421-
:param ttl: Optional Time-To-Live, after which the object is automatically deleted
421+
:param ttl: Optional Time-To-Live, after which the object is automatically deleted.
422+
Defaults to 1 week. Pass ``None`` explicitly for no expiration.
422423
:type ttl: Optional[timedelta]
423424
:param ignore: Optional tar filter function compatible with
424425
:meth:`tarfile.TarFile.add`. If provided, it will be called for each

0 commit comments

Comments
 (0)