Links

Update a sandbox preset

This guide explains how to make changes to a sandbox preset using Web UI or Instruqt CLI.

Before you begin

You should already created a sandbox preset by following the instructions on the Create a sandbox preset page.

Updating a sandbox preset

Pick the Web UI or the Instruqt CLI route depending on your preference:
🌐 Web UI
💻 Instruqt CLI
  1. 1.
    Go to play.instruqt.com. ↳ Instruqt shows your content.
  2. 2.
    Click Team settings > Sandbox presets. ↳ The Sandbox presets page opens.
  3. 3.
    Under Published tab click Edit on the preset you would like to make changes too. ↳ The Edit sandbox preset page opens for the chosen preset
  4. 4.
    Make the desired changes to the sandbox preset.
  5. 5.
    Either click Save to drafts if the preset is not ready for use and needs later modifications. ↳ Instruqt shows the Sandbox presets page with the drafts tab in focus.
  6. 6.
    Or click Save and publish if the is ready for use use. ↳ Instruqt shows a modal prompting for a Commit message
  7. 7.
    Enter a Commit message (optional):
    Commit messages are used to track and describe changes over time. Commit messages should be brief and describe what changes where made.
  8. 8.
    Click Yes, publish. ↳ Instruqt shows the Sandbox presets page with the published tab in focus.
Updating from Instruqt CLI requires having a local copy of the sandbox preset. This can be done by either creating or pulling a sandbox preset.
  1. 1.
    Move into your track directory:
    cd DIRECTORY_NAME
    ⇨ Replace DIRECTORY_NAME with your sandbox preset directory.
  2. 2.
    Make the desired changes to the config.yml and script files.
  3. 3.
    Ensure the changes between the local copy and remote preset are as expected by using the diff command:
    instruqt sandbox diff
    ↳ Instruqt shows this output:
    ==> Running diff
    ==> Fetching remote version...
    ==> Diff produced the following changes:
    --- remote/config.yml
    +++ local/config.yml
    @@ -1,6 +1,6 @@
    name: My first preset
    slug: my-first-preset
    -description: A long description.
    +description: This is a new description.
    containers:
    - name: ubuntu
    image: ubuntu:20.04
    --- remote/scripts/setup-ubuntu
    +++ local/scripts/setup-ubuntu
    @@ -1 +1 @@
    -echo "hello from ubuntu container"
    +echo "this has been changed"
    OK
  4. 4.
    Enter the following command to push your changes to the Instruqt platform:
    instruqt sandbox push
    ↳ Instruqt shows this output:
    ==> Pushing config (SANDBOX_PRESET_SLUG)
    OK
  5. 5.
    If the changes are ready for use run the publish command:
  6. 6.
    instruqt sandbox publish --message="YOUR_COMMIT_MESSAGE"
    ⇨ Replace YOUR_COMMIT_MESSAGE with a commit message for the new changes. ↳ Instruqt shows this output:
    ==> Publishing config (SANDBOX_PRESET_SLUG)
    Change log message: YOUR_COMMIT_MESSAGE
    OK
Once a draft is published all tracks using the preset will be updated to use the latest published version and all shared hot-start pools will be drained and provisioned with the new published version.