-
Notifications
You must be signed in to change notification settings - Fork 59
feat(code-server): add code-server offline support #184
feat(code-server): add code-server offline support #184
Conversation
@matifali - this is a draft PR to add support for "offline" and maybe an option for download caching (so it only installed on first launch) |
Is this ready for review or should I wait until it comes out of draft? |
It's a draft, as I want to see if it makes sense to add an option to use cached installed too |
@code-asher it's ready to look at. I did observe a weird behavior, when running from a cached version the "code-server" is available sooner, but the window is blank intialy. Also when it is open resizing the window does not repaint. |
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.
Nice! I did not notice anything abnormal with the window when I ran with a cached copy.
Co-authored-by: Asher <ash@coder.com>
Changes: - Update docs to include use_cached mode - Add validation checks - Add support for use_cached mode
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.
Looks great! I just have a question about a variable name in an error message.
Changes
code-server
if found, otherwise installs it from Github along with any extensionscode-server
, and if not found returns an erroroffline
mode does not allow for extensions to be installedChecklist
Documentation examples
By default the module looks for code-server at
/tmp/code-server
but this can be changed withinstall_prefix
.Run an existing copy of code-server if found, otherwise download from GitHub:
Just run code-server in the background, don't fetch it from GitHub:
Test cases
When offline is true and there is no copy of code-server is found
Then expect runtime error
When use_cached is true and there is no copy of code-server is found
Then expect code-server to be installed
When use_cached is true and offline is true
Then expect terraform validation error
When offline is true and extensions are set
Then expect terraform validation error
When offline or use_cached is true and a copy of code-server is found then just run code-server in background
Notes on air-gapped installations
Some cases for running
offline
installs ofcode-server
with extensions, is for performance reasons, or because the egress controls on the workspace is tightly controlled or is completely air-gapped.There is also cases where the coder terraform provisioner is also air-gapped, for which you might have modules hosted on an air-gapped terraform enterprise, other methods are in the coder documentation. It might also be useful to link to the coder offline docs
related to #181