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

Deprecate prebuild task #4205

Closed
svenefftinge opened this issue May 12, 2021 · 10 comments · Fixed by #4543
Closed

Deprecate prebuild task #4205

svenefftinge opened this issue May 12, 2021 · 10 comments · Fixed by #4543
Assignees

Comments

@svenefftinge
Copy link
Member

svenefftinge commented May 12, 2021

We should deprecate the prebuild lifecycle for tasks as it complicates tasks without adding enough value.
I often see users missusing it. E.g. https://github.com/ray-project/ray/blob/56c309416e04a70d874709b9a612ffb482f3f80a/.gitpod.yml

Adding a deprecation warning to the gitpod yml schema as well as removing the documentation would do as a first step.

@svenefftinge svenefftinge added this to the [backlog] June 2021 milestone May 12, 2021
@shaal
Copy link
Contributor

shaal commented May 26, 2021

If prebuild gets deprecated, how would you prepare the workspace (compile, download docker images, etc), before a user starts a workspace?

I used prebuild here -
https://github.com/shaal/ddev-gitpod/blob/main/.gitpod.yml#L8-L11
https://github.com/shaal/mygitpod/blob/projects/.gitpod.yml#L8-L9
https://github.com/drud/ddev/blob/master/.gitpod.yml#L6-L9

I thought the documentation around prebuild was confusing.
Also confusing is that prebuild is a name of a lifecycle and a name of a command.

@corneliusludmann corneliusludmann self-assigned this Jun 1, 2021
@svenefftinge
Copy link
Member Author

You would use init which is the task that is executed on prebuilds and not again when starting a prebuilt workspace.

@shaal
Copy link
Contributor

shaal commented Jun 1, 2021

According to the Gitpod documentation, init runs during prebuild, and then run again every time a new workspace is started.

So when we have a command that compiles everything and take a few minutes, the advantage of prebuild is that it runs before the user opens a new workspace, but with init, it will run during prebuild but then users will have to wait for the compile again, once they open a new workspace.

@corneliusludmann
Copy link
Contributor

The init command is executed once only. When you start a workspace that does not have a prebuild, it's executed at workspace start. When you start a workspace that has a prebuild, it does NOT executes init but before and command.

The prebuild command runs during prebuilds only and never when a workspace without prebuild is started. The application is pretty limited.

I hope I have been able to shed some light on this.

@shaal
Copy link
Contributor

shaal commented Jun 2, 2021

Thank you @corneliusludmann for clarifying.
It sounds like init IS the way to go, anywhere I used prebuild before.

Do you know when will this change take effect? and what will happen to workspaces that would still use prebuild?

@corneliusludmann
Copy link
Contributor

For now, we will make the prebuild task deprecated soon and remove it from the docs but still fully support it. However, using init instead of prebuild now in your projects would be a good idea.

@shaal
Copy link
Contributor

shaal commented Jun 2, 2021

👍 Thank you

shaal added a commit to shaal/ddev that referenced this issue Jun 2, 2021
rfay pushed a commit to ddev/ddev that referenced this issue Jun 2, 2021
@svenefftinge
Copy link
Member Author

@shaal since the semantics of init didn't seem to come across in the docs, you may have a good suggestion on how to better explain it?

@rfay
Copy link

rfay commented Jun 10, 2021

I'd say that https://www.gitpod.io/docs/config-start-tasks/ should probably be rewritten from scratch; examples with explanations would do the most good probably.

@mikenikles
Copy link
Contributor

mikenikles commented Jun 11, 2021

Reminders:

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 a pull request may close this issue.

5 participants