Skip to content

Add startup script option#28

Open
HalfdanJ wants to merge 1 commit intoloft-sh:mainfrom
HalfdanJ:jonas/startup-script
Open

Add startup script option#28
HalfdanJ wants to merge 1 commit intoloft-sh:mainfrom
HalfdanJ:jonas/startup-script

Conversation

@HalfdanJ
Copy link
Copy Markdown

@HalfdanJ HalfdanJ commented Dec 2, 2024

Adding option to provide a startup script.
The lack of multiline inputs in the devpod UI does make it a bit ackward to use, but being able to manipulate the VM at startup time is important in some situations, like installing GPU drivers.

Fixes loft-sh/devpod#1429

I'm not quite sure what the dev workflow is to test changes like this. Is the idea to run build.sh, and then manually manipulate the yaml to point to local files instead of the github.com hosted ones?

Copy link
Copy Markdown
Member

@pascalbreuninger pascalbreuninger left a comment

Choose a reason for hiding this comment

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

Thanks for the PR!
LGTM overall, need to change the initialization

edit:

I'm not quite sure what the dev workflow is to test changes like this. Is the idea to run build.sh, and then manually manipulate the yaml to point to local files instead of the github.com hosted ones

Yeah pretty much. We don't have that many contributions to the official providers so we haven't improved that process yet

Comment thread pkg/options/options.go
if err != nil {
return nil, err
}
retOptions.StartupScript, err = fromEnvOrError("STARTUP_SCRIPT")
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think you can make this optional by just reading os.Getenv("STARTUP_SCRIPT"). Right now it would fail if it's empty

@bluemalkin
Copy link
Copy Markdown

This PR is exactly what I need, can we possibly get this merged 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GCP Provider | Allow providing startup scripts

3 participants