Prebuilds
Prebuilds are designed to accelerate development by pre-building your Workspace. When you start a Workspace, the prebuilt environment is used, ensuring that the Workspace is initiated almost instantly.
Prebuilds achieve this by setting up a project configuration that monitors changes in the connected Git Provider’s repository.
Prebuilds work by registering a listener for webhook events from the Git Provider. A public API endpoint is provided, which the Git Provider uses to send these requests.
Add a Prebuild
- Run the following command to add a new Prebuild:
Upon running the command, Daytona will prompt you to select a project configuration you plan to work on. You can then decide on a commit interval (e.g. 5
, every 5 commits) after which a build should be triggered, any specific trigger files whose changes should immediately start the build process, and build retention (the maximum number of builds to store at a time).
Subsequent daytona create
calls will automatically detect the most recent existing build and use it to create the project.
Use a Prebuild
Once you added a Prebuild, it becomes active immediately based on the project configuration you provided. The Prebuild will automatically run whenever the specified conditions are met, such as when the defined number of commits is reached.
For instance, if you specified a commit interval of 5
, the Prebuild will run after every 5
commits to the repository. Populate the Trigger files field with files whose changes you want to immediately trigger a Prebuild, without having to wait for the commit interval. Use the Retention field to define how many successful builds you want Daytona to remember (defaults to 3
).
As soon as you add a Prebuild, a build process will automatically start in the background unless you have configured it otherwise. The initial build process may take some time to complete, but subsequent builds will be significantly faster. You can view the initial build’s progress by running daytona builds list
.
Once the build process is complete, run the following command to create a Workspace using the configured project configuration:
Upon running this command, Daytona will detect the most recent Prebuild associated with the selected project configuration. The Workspace will then use this Prebuild, significantly speeding up the setup process by utilizing the cached environment
During the Workspace creation process, if the initial Prebuild has finished, the setup will be almost instantaneous. Otherwise, a new build will be triggered, potentially slowing down the Workspace creation.
List Prebuilds
Daytona allows you to list all Prebuilds, providing you with an overview of the properties stored within each Prebuild configuration.
- Run the following command to list all Prebuilds:
Upon running this command, Daytona will display a list of your Prebuilds. You will be able to view the project configuration, the branch it is linked to, the commit interval, the trigger files, and the build retention.
Prebuilds Information
Daytona allows you to view detailed information of a Prebuild, providing you with an overview of the properties stored within it.
- Run the following command to view the details of a Prebuild:
- Select the Prebuild you want to view.
Upon selecting the Prebuild, Daytona will display the details of the selected Prebuild. You will be able to view the Prebuild ID, the project configuration, the branch it is linked to, the commit interval, the trigger files, and the build retention.
Update Prebuilds
Daytona allows you to update a Prebuild, helping you manage and modify the Prebuild configuration.
- Run the following command to update a Prebuild:
- Select the Prebuild you want to update.
Upon selecting the Prebuild, Daytona will prompt you to update the Prebuild commit interval, trigger files, and build retention.
Upon updating the Prebuild configuration, Daytona will display a success message.
Delete Prebuilds
Daytona allows you to delete Prebuilds, helping you manage and remove those that are no longer needed.
- Run the following command to delete a Prebuild:
- Select the Prebuild you want to delete.