Move workspace project cloning to post start
Issue: Move project cloning to post start event (#545310 - closed)
What does this MR do and why?
This MR moved the project cloning in a workspace from an init container to a post start event in the main container of the workspace.
This does not result in any material change in the UX. The behaviour will be as follows
- When a workspaces startup, the first thing it will do is clone the project.
- If workspaces is restarted, the project will not be cloned again if it was successfully cloned the first time.
- If the project cloning fails due to some reason, the workspace will start and the user would be able to see the cloning error in
/project/workspace-logs/poststart-stdout.txt
. This is a small change in the behaviour as compared to earlier where if the project cloning failed, the workspace would never startup. This was challenging because it made debugging challenging for users.
The changes done in the MR as only to the devfile. Thus, will not affect existing workspaces.
Note - This MR does not change any git cloning behaviour. This will be addressed as part of Make project cloning faster in workspaces (#543982 - closed) .
References
Screenshots or screen recordings
When you create a new workspace, the project is cloned.
When you restart an existing workspace, the project is not cloned again.
How to set up and validate locally
- Create a workspace.
- Check the workspace pod in Kubernetes and verify there is no init container for cloning the project.
- Check the logs of the post start command stdout -
cat /projects/workspace-logs/poststart-stdout.log
and verify you can see the logs for cloning the project. - Stop the workspace.
- Start the worksapce.
- Check the logs of the post start command stdout -
cat /projects/workspace-logs/poststart-stdout.log
and verify you can see the logs for not cloning the project again.
MR acceptance checklist
Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.