Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
7c65baa
added context loader helper
james-rl Nov 20, 2025
5dcdbfd
Merge branch 'main' of github.com:runloopai/api-client-python
james-rl Nov 20, 2025
c8916eb
added context loader helper to make it easier to add build context wh…
james-rl Nov 20, 2025
4f47bf3
added oop build context functional method wrapper
james-rl Nov 20, 2025
5fb7945
added context helpers to SDKs
james-rl Nov 21, 2025
471334f
Merge branch 'main' of github.com:runloopai/api-client-python
james-rl Nov 21, 2025
0bc941b
Merge branch 'main' into james/ctxt-loader
james-rl Nov 21, 2025
dcbaad0
made ctxt example a bit better
james-rl Nov 21, 2025
e19c775
made this example better
james-rl Nov 21, 2025
fe9abbd
Merge branch 'main' of github.com:runloopai/api-client-python
james-rl Nov 24, 2025
f2a3b03
merged main
james-rl Nov 24, 2025
2f62fee
refactored ignore logic to follow moby (docker project) pattern match…
james-rl Nov 25, 2025
81dba83
fixed some tests and broken imports
james-rl Nov 25, 2025
e0a1725
improved typing and made the ignore matching less docker-specific
james-rl Nov 25, 2025
9ef3450
added tar filter for upload_from_dir
james-rl Nov 26, 2025
d5621ab
fixed bad type
james-rl Nov 26, 2025
bbc1f78
removed some dead code and standardized the ignore interface & made i…
james-rl Dec 1, 2025
7070b95
rolled back change that made tar its own filter type -- big misunders…
james-rl Dec 1, 2025
14c45c0
Merge branch 'main' of github.com:runloopai/api-client-python
james-rl Dec 3, 2025
deeea33
Merge branch 'main' into james/ctxt-loader
james-rl Dec 3, 2025
be047f6
Merge branch 'main' of github.com:runloopai/api-client-python
james-rl Dec 5, 2025
b50f80e
Merge branch 'main' into james/ctxt-loader
james-rl Dec 5, 2025
136ad7e
added handling for extremely weird edge case behavior for dockerignore
james-rl Dec 5, 2025
2a7fc17
added some type hints and override flags
james-rl Dec 5, 2025
597825d
docstring fixes and consolidation of duplicated ignore code
james-rl Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
68 changes: 63 additions & 5 deletions README-SDK.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,23 @@ The `RunloopSDK` builds on top of the underlying REST client and provides a Pyth
- [Quickstart (synchronous)](#quickstart-synchronous)
- [Quickstart (asynchronous)](#quickstart-asynchronous)
- [Core Concepts](#core-concepts)
- [Devbox](#devbox)
- [Blueprint](#blueprint)
- [Snapshot](#snapshot)
- [StorageObject](#storageobject)
- [Mounting Storage Objects to Devboxes](#mounting-storage-objects-to-devboxes)
- [RunloopSDK](#runloopsdk)
- [Available Resources](#available-resources)
- [Devbox](#devbox)
- [Command Execution](#command-execution)
- [Execution Management](#execution-management)
- [Execution Results](#execution-results)
- [Streaming Command Output](#streaming-command-output)
- [File Operations](#file-operations)
- [Network Operations](#network-operations)
- [Snapshot Operations](#snapshot-operations)
- [Devbox Lifecycle Management](#devbox-lifecycle-management)
- [Context Manager Support](#context-manager-support)
- [Blueprint](#blueprint)
- [Snapshot](#snapshot)
- [StorageObject](#storageobject)
- [Storage Object Upload Helpers](#storage-object-upload-helpers)
- [Mounting Storage Objects to Devboxes](#mounting-storage-objects-to-devboxes)
- [Accessing the Underlying REST Client](#accessing-the-underlying-rest-client)
- [Error Handling](#error-handling)
- [Advanced Configuration](#advanced-configuration)
Expand Down Expand Up @@ -409,6 +421,52 @@ blueprint = runloop.blueprint.create(
system_setup_commands=["pip install numpy pandas"],
)

# Or create a blueprint with a Docker build context from a local directory
from pathlib import Path
from runloop_api_client.lib.context_loader import build_docker_context_tar

context_root = Path("./my-app")
tar_bytes = build_docker_context_tar(context_root)

build_ctx_obj = runloop.storage_object.upload_from_bytes(
data=tar_bytes,
name="my-app-context.tar.gz",
content_type="tgz",
)

shared_root = Path("./shared-lib")
shared_tar = build_docker_context_tar(shared_root)

shared_ctx_obj = runloop.storage_object.upload_from_bytes(
data=shared_tar,
name="shared-lib-context.tar.gz",
content_type="tgz",
)

blueprint_with_context = runloop.blueprint.create(
name="my-blueprint-with-context",
dockerfile="""\
FROM node:22
WORKDIR /usr/src/app

# copy using the build context from the object
COPY package.json package.json
COPY src src

# copy from named context
COPY --from=shared / ./libs

RUN npm install --only=production
CMD ["node", "src/app.js"]
""",
# Primary build context
build_context=build_ctx_obj.as_build_context(),
# Additional named build contexts (for Docker buildx-style usage)
named_build_contexts={
"shared": shared_ctx_obj.as_build_context(),
},
)

# Or get an existing one
blueprint = runloop.blueprint.from_id(blueprint_id="bpt_123")

Expand Down
3 changes: 3 additions & 0 deletions src/runloop_api_client/lib/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
"""
Helpers for `runloop_api_client`.
"""
Comment on lines +1 to +3
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

stop pytest from complaining when using resources from here

Loading