-
Notifications
You must be signed in to change notification settings - Fork 66
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
Pre-install some extensions on code-server notebook #347
Conversation
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.
great work,
just had one suggestion.
99be874
to
ad50501
Compare
… disconnected enviroments
ad50501
to
0ffca51
Compare
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.
/lgtm
/approve
thanks for the work 💯
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: harshad16 The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@atheo89: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
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.
@atheo89 is there a particular reason you selected Version 2023.3.100 for the Jupyter extension? when I go to marketplace visualstudio, I get 2024 versions and there are a bunch of changelogs for e.g. February 2024 milestone
Does it have something to do with Codeserver 4.16.1 vs. Visual Studio proper? I guess for one thing, the location to go to for extensions is openvsx vs the official marketplace. But then, even there, the latest version is 2023.9.100
coder/code-server#6323 (comment)
Codeserver 4.16.1 ist VS Code 1.80.2 https://github.com/coder/code-server/releases?page=2 so I guess that might have played a role in your considerations for 2023.3.100?
Disclaimer: I am asking because I've got some extension requests unrelated to these here from a user and just now getting into the topic, i.e. Codeserver custom container build.
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.
Hi @shalberd , the reason we specifically selected these versions of the extension is to ensure compatibility with code-server version 4.16.1.
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.
Hi @atheo89 ok, from the vsx marketplace, or from the Github pages of the components, how can I see which code-server version or VS Code version the extension is for? I am looking for a kind of compatibility info. I do understand that
Codeserver 4.16.1 is VS Code 1.80.2, in essence.
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.
When installing an extension without specifying the version, code-server automatically selects the most compatible one. You can initially install them without specifying a version, then determine compatibility by running code --show-versions.
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.
@atheo89 found it, though with some research on stackoverflow, it is the package.json engine entry that shows the required version of code server / VS Code. https://github.com/microsoft/vscode-python/blob/main/package.json#L47 sorry for my long asking around, maybe this also helps others in future. Case closed.
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.
We downloaded the packages from vsx marketplace
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.
I am mostly focused on offline install, that is why I was looking around for this info so much.
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.
We downloaded the packages from vsx marketplace
Yes, but very un-user-friendly, the marketplace does not show the required code server / VS Code version. One always has to go to the engines section of package.json ...
You can initially install them without specifying a version, then determine compatibility by running code > --show-versions.
Yeah, though this is kinda complicated for a pure airgapped install, deciding which version to put into utils.
Thank you for your help, I know how to proceed now, also with more / other extensions to ensure compatibility (package.json)
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.
@atheo89 @harshad16 there is a problem with this approach and current Notebooks when installing more than just these few extensions at runtime. The defaults for liveness and readiness probe times come from odh-dashboard, I think, when assembling the notebook CR.
name: code-server-vs
livenessProbe:
failureThreshold: 3
httpGet:
path: /notebook/dstst-analytix-fraud/code-server-vs/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
Because installing extensions takes some time at the code-server-vs/api health check endpoint is not up and running until after all extensions install and the nginx http server is running, the container keeps re-starting without more than 5 or 6 extensions ever installed.
I solved this by patching the notebook CR to have a large initialDelaySeconds of 100, so then code server started.
What do you think? @guimou do you have an idea of how to circumvent this problem of premature container restart due to failing liveness probes when installing more than, say, 6 or 7 extensions?
This is definitely an issue if the probes can't keep up. Several solutions:
- Can we start code-server and then only install the extensions?
- Right now the probe calls are forwarded by NGINX to code-server. We could
modify this to make NGINX answer directly. But it defeats the purpose of
the probes...
Honestly, I would not install any extensions. As they are persisted anyway,
I would let the users install what they want, when they want. They have to
do it only once, so... Plus the extensions installed now are related mostly
to Jupyter. Who says I want to use notebooks in VSCode? Personally I don't.
If I create a VSCode workbench, it's to do standard Python or JavaScript
coding, so...
Le lun. 19 févr. 2024 à 17:28, Sven Thoms ***@***.***> a
écrit :
… ***@***.**** commented on this pull request.
------------------------------
On codeserver/ubi9-python-3.9/utils/ms-toolsai.jupyter-2023.3.100.vsix
<#347 (comment)>
:
@atheo89 <https://github.com/atheo89> @harshad16
<https://github.com/harshad16> there is a problem with this approach and
current Notebooks when installing more than just these few extensions at
runtime. The defaults for liveness and readiness probe times come from
odh-dashboard, I think, when assembling the notebook CR.
<https://github.com/shalberd/odh-dashboard/blob/c0dca01fa32691e45cef37cb7c84471950e193c8/frontend/src/api/k8s/notebooks.ts#L150>
name: code-server-vs
livenessProbe:
failureThreshold: 3
httpGet:
path: /notebook/dstst-analytix-fraud/code-server-vs/api
port: notebook-port
scheme: HTTP
initialDelaySeconds: 10
periodSeconds: 5
successThreshold: 1
timeoutSeconds: 1
Because installing extensions takes some time at the code-server-vs/api
health check endpoint is not up and running until after all extensions
install and the nginx http server is running, the container keeps
re-starting without more than 5 or 6 extensions ever installed.
I solved this by patching the notebook CR to have a large
initialDelaySeconds of 100, so then code server started.
What do you think? @guimou <https://github.com/guimou> do you have an
idea of how to circumvent this problem of premature container restart due
to failing liveness probes when installing more than, say, 6 or 7
extensions?
—
Reply to this email directly, view it on GitHub
<#347 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6C4YULOF6QWFPU7STUEPLYUPG2FAVCNFSM6AAAAAA7MU5ZHSVHI2DSMVQWIX3LMV43YUDVNRWFEZLROVSXG5CSMV3GSZLXHMYTQOBZGIZTMNBUHE>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@guimou about not installing any extensions and about the whole Jupyter stuff in general in VS Code: yes, though some things like material theme and other GUI things like German language pack are quite useful actually. about not installing any extensions and letting users install them: that is a good solution in non-airgapped environments. But in environments like ours, with a proxy not allowing connections to marketplaces, pypi.org and so on, this command-based install of extensions by providing them in the file system is the only way to go. I guess @atheo89 also had some restricted network customers in her automotive environment south of the Alps. Here's some example ;-)
I wonder if there is a better way than doing the code-server --install-extension at runtime. |
Sure. But then it's something that has to be fully customized to a specific
use case/environment. We can't impose all sorts of extensions, even a few,
to everyone just to cover this specific case.
In this scenario, one would only have to create a custom image deriving
from this one by adding the needed extensions in the utils folder.
…On Mon., Feb. 19, 2024, 18:24 Sven Thoms, ***@***.***> wrote:
about not installing any extensions and about the whole Jupyter stuff in
general in VS Code:
yes, though some things like material theme and other GUI things like
German language pack are quite useful actually.
about not installing any extensions and letting users install them:
that is a good solution in non-airgapped environments. But in environments
like ours, with a proxy not allowing connections to marketplaces, pypi.org
and so on, this command-based install of extensions by providing them in
the file system is the only way to go.
Here's some example ;-)
code-server --install-extension ${SCRIPT_DIR}/utils/steoates.autoimport-1.5.3.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/njpwerner.autodocstring-0.6.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/aaron-bond.better-comments-3.0.2.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/alefragnani.Bookmarks-13.0.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/Catppuccin.catppuccin-vsc-3.10.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/formulahendry.code-runner-0.12.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/streetsidesoftware.code-spell-checker-3.0.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/streetsidesoftware.code-spell-checker-german-2.3.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/MS-CEINTL.vscode-language-pack-de-1.80.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/davidlday.languagetool-linter-0.20.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/PKief.material-icon-theme-4.33.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/ionutvmi.path-autocomplete-1.25.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/alefragnani.project-manager-12.0.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/KevinRose.vsc-python-indent-1.18.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/donjayamanne.python-environment-manager-1.0.4.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/hbenl.test-adapter-converter-0.1.6.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/hbenl.vscode-test-explorer-2.21.1.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/LittleFoxTeam.vscode-python-test-adapter-0.8.2.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/njqdev.vscode-python-typehint-1.4.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/ms-python.black-formatter-2023.6.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/wmaurer.change-case-1.0.0.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/mgesbert.python-path-0.0.14.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/dongli.python-preview-0.0.4.vsix
code-server --install-extension ${SCRIPT_DIR}/utils/Semgrep.semgrep-1.6.3.vsix
—
Reply to this email directly, view it on GitHub
<#347 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA6C4YTIRTBGX5TDCXDNGMDYUPNKBAVCNFSM6AAAAAA7MU5ZHSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNJTGI3DSMBQGY>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@guimou Yes, this is what I did on contrib workbench images builder. I added a custom ide snippet for my vscode and used the logic here, with all the extensions I need in the utils folder.
But we could make this a special case or extended snippet, i.e. Code Server Airgapped Extensions, of Code Server in contrib workbench-images builder. However, the current approach here to install extensions fails due to the imposed liveness probe (initialDelaySeconds: 10) that I had to manually patch to be waiting 100s initially so the extension install can run through. Since liveness probe is something that is statically created by odh dashboard, this is not very good. Best way to install extensions would be with an init container mechanism, but we don't have that option with Notebook CRs here, I think. Another users in the comments below also tried to bake in the extensions at build time, I'll see what I can do. I don't want them installed at runtime in the entrypoint script, due to the liveness probe timeout problem I described. Best way would be to have an init Container in the pod that runs before coder/code-server#4778 (comment) Since that is not possible, I'm just creating a dedicated extensions (installed extensions) dir at I then install the extensions in the Containerfile instead of the entrypoint script, with an This works, of course, also having the usual directory permissions fixes for the new directory. Extensions are now baked in for airgapped. |
[pull] release-2023b from opendatahub-io:2023b
Related to: #336
Description
By default, code-server does not come with any installed extensions. This pull request aims to streamline the user experience by pre-installing several useful extensions on behalf of the end user. The extensions that we added are:
Test image:
quay.io/rh_ee_atheodor/workbench-images@sha256:ac16959bffb660397247100666729b314eb78a8b0ec387131b878697d3cb1e48
How Has This Been Tested?
code-server-notebook
imagestream by adding the following tag, Builds > ImageStreamsEnter on DSP and trigger a vs code using the
new
tag that you created above.Inspect on the extension tab, and check if there are already installed extensions.
You should see the following:
Or by a terminal should type:
code-server --list-extensions
You should see the following:
To locally test the notebook in air-gap env disconnect your internet connection and trigger by using
podman run --network=host --name validation-container quay.io/rh_ee_atheodor/workbench-images@sha256:ac16959bffb660397247100666729b314eb78a8b0ec387131b878697d3cb1e48
Merge criteria: