Skip to main content

Intro

We can configure a bash startup script that automatically runs on a instance immediately after the instance becomes active.

Example

We can configure a bash startup script using Shadeform’s Create Instance API. In this example, we will run the script below once the instance becomes ready.
Script
First, we must Base64 encode the script to preserve all special characters, whitespacing, and formatting of the script. We recommend using this tool to base64 encode our script. After base64 encoding the script, you should get the following:
Base64 Encoded Script
After we have base64 encoded our script, we can create a new GPU instance with the startup script included in the base64_script property.
Once the instance is created, we can get the status and IP address of the instance by calling the Instances API. Once the instance is active, we can verify that the script ran correctly by SSHing into the instance and running:
CLI

Security

The script provided is encrypted at rest.