-
Notifications
You must be signed in to change notification settings - Fork 60
feat(code-server): skip extension if installed #259
feat(code-server): skip extension if installed #259
Conversation
Skip if an extension was already installed
@code-asher turns out locally it is fast, it is actually slower when doing an install if it already exists. |
How about using Skipping altogether will stuck the extensions to the initially installed version and code-server will then prompt to update them after the workspace starts. |
Currently, i have set a very short lifecycle for workspace, so there are more restarts, so i am looking at all things to speed up start time. Our problem is slow starts of coder workspaces. I am trying to allow for caching of extensions and skipping over those already installed.
|
(so far terraform init, terraform plan is also a very slow like 16 secs, so i am looking for time anywhere i can find it) |
@matifali if installing extensions was non-blocking (or at least upgrading them) then we get a win win situation :) See related issue for running some tasks in the background : coder/coder#12448 |
Weird that it is so slow. I suppose it must be the query to the marketplace that is taking so long? Any idea if it is faster to install them all at once? If we do proceed with this, should there be another flag to control it? |
Oh. I did not know that could be done. Will add that for sure. |
Will look at the "CACHE_EXTENSIONS" option (false by default), then use that when skipping. And the "-force" would be the default |
@code-asher have a look. @matifali it seems like the tests are failing again (never mind restarting the CI fixed it..) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome thank you!
done | ||
return 1 | ||
} | ||
|
||
# Install each extension... | ||
IFS=',' read -r -a EXTENSIONLIST <<< "$${EXTENSIONS}" | ||
for extension in "$${EXTENSIONLIST[@]}"; do |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@code-asher - see example of why I need to escape the $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome!
To aid faster restarts of workspace with extensions already cached, this change will skip if an extension was already installed.
Before change, extensions would be try to be installed, but this operation can be slow, also extensions are not upgraded
After change with
use_cached_extensions
set, extensions that are already installed are skippedThis change only impacts when
use_cached_extensions
andextensions_dir
are set.Otherwise on restarts,
--force
is used to ensure existing extensions are upgraded.