feat(proposal): runonce scripts, eqivalent to .bashrc.d
but runs only once without any race conditions between several terminals
#1104
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
As IDEs start without loading the login shell for quick startup, previous assumptions about race condition between
.bashrc.d
startup scripts are not ideal anymore. This introduces a new directory alongside.bashrc.d
called.runonce
. Scripts placed inside$HOME/.runonce
will be executed once in the lifecycle of a workspace, and all task terminals will wait for.runonce
scripts to complete before proceeding to execute the.gitpod.yml
task commands. While scripts placed inside$HOME/.bashrc.d
are used for modifying the shell environment (e.g. exporting env vars) each time a terminal is created and not for starting services.This PR only migrates the VNC startup to
.runonce
. I plan to create a followup PR to migrate rust, dotnet, mysql, postgres, vnc and yugabyte startup scripts as well (see axonasif@7907f57).Related Issue(s)
Fixes #1067, gitpod-io/gitpod#18491, slack report, frontapp ticket.
How to test
Open https://gitpod.io/#https://github.com/axonasif/test/tree/vnc_test and check if all task terminals are attempting to start the vnc service.
Or if you want to emulate the race-condition environment from your existing workspace:
Documentation
/hold