opendatahub-io / notebooks

Notebook images for ODH
Apache License 2.0
17 stars 59 forks source link

Allow code-server extensions to be installed while the build time #532

Closed atheo89 closed 4 months ago

atheo89 commented 4 months ago

Related to: https://issues.redhat.com/browse/RHOAIENG-6392 https://github.com/opendatahub-io/notebooks/issues/421

Description

This PR Allow code-server extensions to be installed while the build time on --extensions-dir /opt/app-root/extensions-temp and we copy installed extensions to the src extensions directory on runtime vscode script.

How Has This Been Tested?

In disconnected env: Cluster: https://console-openshift-console.apps.dis-210n.osp.rh-ods.com/k8s/ns/redhat-ods-applications/imagestreams/code-server-notebook/yaml Image: bastion.dis-210n.osp.rh-ods.com:8443/rh_ee_atheodor/workbench-images@sha256:7ee0cf657d3c287523a5ed155a6fcb009a7aa686ffe828b7eb08e4e27b664048 ImageStreamName:Tag: code-server:pr-532 Notes: Sometimes not always we got some hits on http://127.0.0.1:8787/healthz until copy the tmp extension folder to src Logs:

spawn-fcgi: child spawned successfully: PID: 10
Debug: User directory already exists.
Debug: '/opt/app-root/src/.local/share/code-server/User/settings.json' file already exists.
Debug: Extension 'ms-python.debugpy-2024.6.0-linux-x64' already exists in runtime directory, skipping.
Debug: Extension 'ms-python.python-2024.2.1' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-2023.9.100' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-keymap-1.1.2-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-renderers-1.0.17-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.vscode-jupyter-cell-tags-0.1.8-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.vscode-jupyter-slideshow-0.1.5-universal' already exists in runtime directory, skipping.
Running command: /usr/bin/code-server --bind-addr 0.0.0.0:8787 --disable-telemetry --auth none --disable-update-check /opt/app-root/src
[2024-05-21T14:22:25.114Z] info code-server 4.22.0 e5d145fdf32e82be2a0f8de9a3b05f65b13052b6
[2024-05-21T14:22:25.115Z] info Using user-data-dir /opt/app-root/src/.local/share/code-server
[2024-05-21T14:22:25.131Z] info Using config file /opt/app-root/src/.config/code-server/config.yaml
[2024-05-21T14:22:25.131Z] info HTTP server listening on http://0.0.0.0:8787/
[2024-05-21T14:22:25.131Z] info - Authentication is disabled
[2024-05-21T14:22:25.131Z] info - Not serving HTTPS
[2024-05-21T14:22:25.131Z] info Session server listening on /opt/app-root/src/.local/share/code-server/code-server-ipc.sock
127.0.0.1 - htpasswd-cluster-admin-user [21/May/2024:14:23:59 +0000] "GET /notebook/test-532/q3 HTTP/1.1" 302 145 "https://oauth-openshift.apps.dis-210n.osp.rh-ods.com/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0" "10.0.96.119, 10.128.2.2"
[14:23:59]

In connected env: Image: quay.io/rh_ee_atheodor/workbench-images@sha256:7ee0cf657d3c287523a5ed155a6fcb009a7aa686ffe828b7eb08e4e27b664048 ImageStreamName:Tag: Add a new tag with the given image or the build image from the ci, ex: code-server:pr-532 Notes: Logs:

spawn-fcgi: child spawned successfully: PID: 10
Debug: User directory already exists.
Debug: '/opt/app-root/src/.local/share/code-server/User/settings.json' file already exists.
Debug: Extension 'ms-python.debugpy-2024.6.0-linux-x64' already exists in runtime directory, skipping.
Debug: Extension 'ms-python.python-2024.2.1' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-2023.9.100' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-keymap-1.1.2-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.jupyter-renderers-1.0.17-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.vscode-jupyter-cell-tags-0.1.8-universal' already exists in runtime directory, skipping.
Debug: Extension 'ms-toolsai.vscode-jupyter-slideshow-0.1.5-universal' already exists in runtime directory, skipping.
Running command: /usr/bin/code-server --bind-addr 0.0.0.0:8787 --disable-telemetry --auth none --disable-update-check /opt/app-root/src
[2024-05-21T14:22:25.114Z] info code-server 4.22.0 e5d145fdf32e82be2a0f8de9a3b05f65b13052b6
[2024-05-21T14:22:25.115Z] info Using user-data-dir /opt/app-root/src/.local/share/code-server
[2024-05-21T14:22:25.131Z] info Using config file /opt/app-root/src/.config/code-server/config.yaml
[2024-05-21T14:22:25.131Z] info HTTP server listening on http://0.0.0.0:8787/
[2024-05-21T14:22:25.131Z] info - Authentication is disabled
[2024-05-21T14:22:25.131Z] info - Not serving HTTPS
[2024-05-21T14:22:25.131Z] info Session server listening on /opt/app-root/src/.local/share/code-server/code-server-ipc.sock
127.0.0.1 - htpasswd-cluster-admin-user [21/May/2024:14:23:59 +0000] "GET /notebook/test-532/q3 HTTP/1.1" 302 145 "https://oauth-openshift.apps.dis-210n.osp.rh-ods.com/" "Mozilla/5.0 (X11; Linux x86_64; rv:126.0) Gecko/20100101 Firefox/126.0" "10.0.96.119, 10.128.2.2"
[14:23:59]

Merge criteria:

atheo89 commented 4 months ago

@harshad16 Thanks for noticing the overriding while the restart of the notebook. I added the logic on the runtime-script to check if an extension already exists. It works now as expected. Tested with this latest image: quay.io/rh_ee_atheodor/workbench-images@sha256:7ee0cf657d3c287523a5ed155a6fcb009a7aa686ffe828b7eb08e4e27b664048 (Also in the PR description)

openshift-ci[bot] commented 4 months ago

@atheo89: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/notebooks-e2e-tests a609ef0f2b2080e47a07f4d68fcb4d21eff3434f link true /test notebooks-e2e-tests
ci/prow/images a609ef0f2b2080e47a07f4d68fcb4d21eff3434f link true /test images

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available [here](https://git.k8s.io/community/contributors/guide/pull-requests.md). If you have questions or suggestions related to my behavior, please file an issue against the [kubernetes-sigs/prow](https://github.com/kubernetes-sigs/prow/issues/new?title=Prow%20issue:) repository. I understand the commands that are listed [here](https://go.k8s.io/bot-commands).
openshift-ci[bot] commented 4 months ago

[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: - ~~[OWNERS](https://github.com/opendatahub-io/notebooks/blob/main/OWNERS)~~ [harshad16] Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
shalberd commented 3 months ago

great job, thank y'all