Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add startup script option #28

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HalfdanJ
Copy link

@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
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

@@ -59,6 +60,10 @@ func FromEnv(withMachine bool) (*Options, error) {
if err != nil {
return nil, err
}
retOptions.StartupScript, err = fromEnvOrError("STARTUP_SCRIPT")
Copy link
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

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
2 participants