opendatahub-io / notebooks

Notebook images for ODH
Apache License 2.0
15 stars 51 forks source link

Enable the installation of extensions after starting code-server #530

Closed atheo89 closed 2 months ago

atheo89 commented 2 months ago

Related to: https://issues.redhat.com/browse/RHOAIENG-6392

Description

This PR allow the extensions get installed after code-server start.

How Has This Been Tested?

Playground Cluster: https://rhods-dashboard-redhat-ods-applications.apps.dis-210nightly.osp.rh-ods.com/notebookController/spawner

  1. Build and push the image on the mirror registry for the disconnected
  2. Built image: bastion.dis-210nightly.osp.rh-ods.com:8443/modh/codeserver:v1 or alternatively bastion.dis-210nightly.osp.rh-ods.com:8443/modh/codeserver@sha256:b8b999bbcf86dcfcf1029ebb9f5fa77b58c9ef2fb75123a7b4d6643a2746f061
  3. Spin up an disconnected cluster
  4. Edit code-server-notebook ImageStream by adding a new tag with the above image.
    - name: background-installation
      annotations:
        opendatahub.io/notebook-build-commit: db8bd76
        opendatahub.io/notebook-python-dependencies: '[{"name":"code-server","version":"4.22"}]'
        opendatahub.io/notebook-software: '[{"name":"Python","version":"v3.9"}]'
        opendatahub.io/workbench-image-recommended: 'false'
        openshift.io/imported-from: quay.io/modh/codeserver
      from:
        kind: DockerImage
        name: 'bastion.dis-210nightly.osp.rh-ods.com:8443/modh/codeserver@sha256:b8b999bbcf86dcfcf1029ebb9f5fa77b58c9ef2fb75123a7b4d6643a2746f061'
      generation: 8
      importPolicy:
        importMode: Legacy
      referencePolicy:
        type: Source
  5. Spin up a new notebook, using background-installation tag
  6. Check if the status is Running
  7. Navigate to newly created notebook and check the logs. (It takes a bit of time to initialize the installation)
  8. The logs should looks like the following:
    spawn-fcgi: child spawned successfully: PID: 10
    Debug: User directory not found, creating '/opt/app-root/src/.local/share/code-server/User/'...
    Debug: '/opt/app-root/src/.local/share/code-server/User/settings.json' file created.
    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-13T12:10:14.719Z] info Wrote default config file to /opt/app-root/src/.config/code-server/config.yaml
    code-server is ready.
    [2024-05-13T12:10:15.151Z] info code-server 4.22.0 e5d145fdf32e82be2a0f8de9a3b05f65b13052b6
    [2024-05-13T12:10:15.152Z] info Using user-data-dir /opt/app-root/src/.local/share/code-server
    [2024-05-13T12:10:15.173Z] info Using config file /opt/app-root/src/.config/code-server/config.yaml
    [2024-05-13T12:10:15.173Z] info HTTP server listening on http://0.0.0.0:8787/
    [2024-05-13T12:10:15.173Z] info - Authentication is disabled
    [2024-05-13T12:10:15.173Z] info - Not serving HTTPS
    [2024-05-13T12:10:15.173Z] 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 [13/May/2024:12:10:53 +0000] "GET /notebook/test/cs1 HTTP/1.1" 302 145 "https://oauth-openshift.apps.dis-210nightly.osp.rh-ods.com/" "Mozilla/5.0 (X11; Linux x86_64; rv:125.0) Gecko/20100101 Firefox/125.0" "10.0.179.217, 10.131.0.2"
    [12:10:53]
    [12:10:53] Extension host agent started.
    File not found: /usr/lib/code-server/lib/vscode/out/vsda.js
    File not found: /usr/lib/code-server/lib/vscode/out/vsda_bg.wasm
    [12:10:56] [127.0.0.1][789a0ff1][ManagementConnection] New connection established.
    [12:10:58] [127.0.0.1][fcc613af][ExtensionHostConnection] New connection established.
    [12:10:58] [127.0.0.1][fcc613af][ExtensionHostConnection] <129> Launched Extension Host Process.
    No internet connection. Installing all extensions.
    Installing extensions...
    Extension 'ms-python.python-2024.2.1.vsix' was successfully installed.
    [12:17:45] Extensions added from another source ms-python.python file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-python.debugpy-2024.2.0@linux-x64.vsix' was successfully installed.
    [12:17:51] Extensions added from another source ms-python.debugpy file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-toolsai.jupyter-2023.9.100.vsix' was successfully installed.
    [12:20:04] Extensions added from another source ms-toolsai.jupyter file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-toolsai.jupyter-keymap-1.1.2.vsix' was successfully installed.
    [12:20:05] Extensions added from another source ms-toolsai.jupyter-keymap file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-toolsai.jupyter-renderers-1.0.17.vsix' was successfully installed.
    [12:20:07] Extensions added from another source ms-toolsai.jupyter-renderers file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-toolsai.vscode-jupyter-cell-tags-0.1.8.vsix' was successfully installed.
    [12:20:08] Extensions added from another source ms-toolsai.vscode-jupyter-cell-tags file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json
    Installing extensions...
    Extension 'ms-toolsai.vscode-jupyter-slideshow-0.1.5.vsix' was successfully installed.
    [12:20:09] Extensions added from another source ms-toolsai.vscode-jupyter-slideshow file:///opt/app-root/src/.local/share/code-server/extensions/extensions.json

Merge criteria:

openshift-ci[bot] commented 2 months ago

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Once this PR has been reviewed and has the lgtm label, please ask for approval from atheo89. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files: - **[OWNERS](https://github.com/opendatahub-io/notebooks/blob/main/OWNERS)** Approvers can indicate their approval by writing `/approve` in a comment Approvers can cancel approval by writing `/approve cancel` in a comment
openshift-ci[bot] commented 2 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/images ba9d85becafd4a2a5c0c3f341fa58b5fc371f6df link true /test images
ci/prow/notebooks-e2e-tests ba9d85becafd4a2a5c0c3f341fa58b5fc371f6df link true /test notebooks-e2e-tests

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).
atheo89 commented 2 months ago

Close this in favor of https://github.com/opendatahub-io/notebooks/pull/532