- Standardization: Define tools, binaries, and configurations your AI agent needs at runtime.
- Consistency: Ensure reproducible AI behavior across environments.
- Efficiency: Reduce Devbox startup time by pre-installing necessary tools.
- Customization: Tailor environments to specific AI-assisted development needs.
When should I use a Blueprint vs. a Snapshot?Snapshots and Blueprints both allow you to run devboxes with customizations. Blueprints are fast to boot and cacheable using Docker layers, while Snapshots are a bit slower on boot (reproducing each step taken in the devbox) but can be created quickly from an existing devbox.Examples:
- Blueprint: You have a coding agent that is performing a task that requires installing a specific tool. Create a blueprint with set-up steps for the tool and future devboxes will cache the installation to speed up boot and execution time.
- Snapshot: You have a coding agent in a devbox considering 3 different ways to complete a task. Create a snapshot of the initial state of the devbox, create 3 parallel devboxes from that snapshot, collate the results, and then choose the best option to continue.
Creating a Blueprint
One use case for a blueprint is preinstalling tools your AI agent may want to use. For example, let’s create a simple Blueprint that installsjq
, a lightweight command-line JSON processor:
Use the Debian package manager (apt) for installing system packages on the Runloop base image.
Using Your Blueprint
Once your Blueprint’s status isbuild_complete
, create a Devbox using it:
Custom files and folders
Basic Configuration with file mounts
To add individual files to your Blueprint, you can use thefile_mounts
parameter. The key of the file_mounts
object is the path to the file in the devbox and the value is the content of the file.
By default, blueprints are constructed by user
and /home/user/
is where files are allowed to be mounted.
launch_parameters
Basic Configuration with CodeMounts
To add a CodeMount to your Blueprint:Private Repository Authentication
For private repositories, include a GitHub Personal Access Token (PAT):The Blueprint Build Process
When you create a Blueprint, Runloop builds a custom image containing all specified tools and configurations.Checking Build Status
After creating a Blueprint, check its status:{blueprint_id}
with the ID returned when you created the Blueprint.
Example response:
status
field indicates the current state of your Blueprint:
build_complete
: Blueprint is ready to usebuild_failed
: Refer to the Blueprint troubleshooting guide
Keeping Blueprints Updated
Periodically update Blueprints by building a new blueprint with the same name. This ensures that your AI agents always work with the latest code and dependencies.name
, allowing for faster updates and efficient resource use.
Advanced Usage: Creating a Blueprint from a Public Image Registry
Runloop supports creating Blueprints from public image registries. This is useful when you want to use a specific version of a tool or framework.Example: Docker Hub Image (wordpress)
This process works with any image that is available on Docker Hub. The following example creates a Blueprint from thewordpress
image at https://hub.docker.com/_/wordpress
Example: Public ECR Image (runloop-dnd-image)
For more information about Docker-in-Docker support and available images, see Running Docker on a Devbox.Advanced Usage: Custom Dockerfiles
For more complex environments, you can use a full Dockerfile as the basis for your Blueprint. This is useful when you need to install multiple tools or perform complex setup operations.-
Base your Dockerfile on the Runloop base image. Note that you must use the
runloop:
prefix: -
Runloop will:
- Use your Dockerfile as the base
- Apply any
launch_parameters.launch_commands
specified - Set up any defined
CodeMount
s
The Runloop base image is public and can be downloaded for local testing.
Advanced Usage: Composable Blueprints
You can create a Blueprint using another Blueprint as the base. This is useful when you want to create a Blueprint that builds upon other Blueprints.FROM
instruction via the Dockerfile
parameter to specify the composable Blueprint for building
Advanced Usage: Customizing the Base user
You can customize the base user of a Blueprint. SSH and execs to devboxes created from this blueprint will be via the custom user.Advanced Usage: Customization via Launch Parameters
Because Blueprints map to images that launch devboxes, we share some of the same launch parameters as devboxes. See these pages for more customizable parameters:Deleting Blueprints
By default, Blueprints persist indefinitely and continue to incur storage costs. To optimize resource usage and costs, you can delete Blueprints that are no longer needed.Deleting a Single Blueprint
To delete a specific Blueprint, use its ID:Cleaning Up Old Blueprint Versions
When you create multiple versions of a Blueprint with the same name, you may want to delete older versions to reduce storage costs. Here’s how to keep only the latest version:Be careful when deleting Blueprints, as this action cannot be undone. Ensure you’re not deleting Blueprints that you may need later.
Best Practices
- Start Simple: Begin with basic Blueprints and gradually add complexity.
- Test Manually Using SSH: You can create a devbox and SSH into it and manually install tools to make sure the commands are correct before layering them into Blueprints.
- Always use
blueprint_name
instead ofblueprint_id
to ensure you’re using the latest version. Use specific Blueprint IDs only when you need version control for particular setups. - Implement
setup_commands
in your Devbox creation to keep code and dependencies up-to-date. - Regularly update your Blueprints with the latest repository changes.
- Delete unused / deprecated Blueprints.
Upcoming Features
Future releases plan to include:- Multiple repository support in a single Blueprint
- Specific branch specifications
- Git submodules support
- Advanced multi-step build processes
If any of these features are critical for your use case, please let us know.